@instincthub/react-ui 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/assets/css/forms/submit-button.css +340 -102
- package/dist/src/components/auth/LoginForm.cjs +1 -1
- package/dist/src/components/auth/LoginForm.js +1 -1
- package/dist/src/components/forms/SubmitButton.cjs +1 -1
- package/dist/src/components/forms/SubmitButton.js +1 -1
- package/dist/src/components/lib/index.cjs +1 -1
- package/dist/src/components/lib/index.cjs.map +1 -1
- package/dist/src/components/lib/index.js +1 -1
- package/dist/src/components/lib/index.js.map +1 -1
- package/dist/src/components/lib/paystack.cjs +1 -1
- package/dist/src/components/lib/paystack.cjs.map +1 -1
- package/dist/src/components/lib/paystack.js +1 -1
- package/dist/src/components/lib/paystack.js.map +1 -1
- package/dist/src/components/ui/ComponentLists.cjs +1 -1
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/types/components/forms/SubmitButton.d.ts +4 -1
- package/dist/src/types/components/lib/paystack.d.ts +48 -12
- package/dist/src/types/types/index.d.ts +26 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paystack.js","sources":["../../../../src/components/lib/paystack.ts"],"sourcesContent":["import {\n API_HOST_URL,\n calculateCouponDeduction,\n reqOptions,\n setCookie,\n} from \"./helpFunction\";\nimport {\n getUserEmailInputModal,\n openConfirmModal,\n openToast,\n} from \"./modals/modals\";\nimport {\n PaystackConfigObjectType,\n PaystackConfigType,\n PaystackResponseType,\n PaymentContextType,\n CouponType,\n} from \"@/types\";\n\n/**\n * Context for processing payments\n * @property {Event | null} [e] - The event object that triggered the payment\n * @property {Object} objects - Details about the item being purchased\n * @property {string} objects.title - Title of the item\n * @property {string | number | null} [objects.object_type] - Model ID of the object being purchased\n * @property {string | number | null} [objects.object_id] - Object ID of the object being purchased\n * @property {PaystackConfigObjectType} configObj - Configuration for PayStack\n * @property {PaymentMethodType} [paymentMethod] - Saved payment method if available\n * @property {Function} setStatus - Function to update UI status during payment process\n * @property {Function} handleDBAction - Callback for processing successful payments\n * @property {boolean} [defaultConfirm] - Whether to show a confirmation dialog\n * @property {string} label - Label for the payment (usually item title)\n * @property {string} [coupon] - Coupon code if applicable\n * @property {string} [defaultMsg] - Custom confirmation message\n * @property {number} [gatwayCharges] - Payment gateway charges percentage\n */\n\n/**\n * Configures the Paystack payment data for processing\n * @param obj - Object containing payment details\n * @returns PaystackConfig - Configured payment data\n */\nexport const paystackDataConfig = (\n obj: PaystackConfigObjectType\n): PaystackConfigType => ({\n authorization_code: obj.authorization_code,\n reference: new Date().getTime().toString(),\n email: obj.email,\n first_name: obj.first_name,\n last_name: obj.last_name,\n amount: Math.round(obj.amount * 100), // Amount is in the country's lowest currency. E.g Kobo, so 20000 kobo = N200\n currency: obj.currency || \"NGN\",\n publicKey: process.env.NEXT_PUBLIC_PAYSTACK_SECRET_KEY,\n key: process.env.NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY,\n callback_url: window.location.href,\n metadata: obj.metadata,\n});\n\n/**\n * Charges a customer using an existing authorization\n * @param data - Payment configuration data\n * @returns Promise with transaction data\n */\nexport const chargeAuthorization = async (\n data: PaystackConfigType\n): Promise<any> => {\n // This function tries to charge user with existing card\n const url = \"https://api.paystack.co/transaction/charge_authorization\";\n const options = {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: {\n Authorization: `Bearer ${process.env.NEXT_PUBLIC_PAYSTACK_SECRET_KEY}`,\n \"Content-Type\": \"application/json\",\n },\n };\n\n try {\n const req = await fetch(url, options);\n const res = await req.json();\n\n if (res.data?.status === \"success\") {\n openToast(`Payment was successful with reference: ${res.data.reference}`);\n } else {\n openToast(`Payment failed with reference: ${res.data.reference}`, 400);\n }\n\n return res.data;\n } catch (error) {\n openToast(\"Payment processing error occurred\", 400);\n console.error(\"Payment authorization error:\", error);\n return { status: \"failed\", error };\n }\n};\n\n/**\n * Initiates payment with Paystack popup\n * @param config - Payment configuration\n * @returns Promise with payment response\n */\nexport const payWithPaystack = (\n config: PaystackConfigType\n): Promise<PaystackResponseType> => {\n return new Promise(async (resolve) => {\n try {\n // Ensure PaystackPop is available\n if (!window.PaystackPop) {\n throw new Error(\"Paystack script not loaded\");\n }\n\n let handler = await window.PaystackPop.setup({\n ...config,\n callback: (response: PaystackResponseType) => {\n // This happens after the payment is completed successfully\n openToast(\"Payment complete! Reference: \" + response.reference);\n resolve({ ...response, email: config.email, amount: config.amount });\n },\n onClose: () => {\n openToast(\"Transaction was not completed, window closed.\", 400);\n resolve({\n status: \"canceled\",\n cancelled: true,\n reference: config.reference,\n email: config.email,\n amount: config.amount,\n } as PaystackResponseType);\n },\n });\n handler.openIframe();\n } catch (error) {\n console.error(\"Paystack initialization error:\", error);\n openToast(\"Payment could not be initiated\", 400);\n resolve({\n status: \"failed\",\n cancelled: true,\n reference: config.reference,\n error,\n email: config.email,\n amount: config.amount,\n } as PaystackResponseType);\n }\n });\n};\n\n/**\n * Handles the complete payment submission process\n * @example\n * ```ts\n * handlePaymentSubmit({\n * openConfirm: true,\n * defaultConfirm: true,\n * defaultMsg: \"Are you sure you want to enroll for this course?\",\n * label: \"Course Name\",\n * objects: {\n * object_id: \"123\",\n * object_type: \"course\",\n * },\n * configObj: {\n * email: \"user@example.com\",\n * amount: 1000,\n * currency: \"NGN\",\n * authorization_code: \"1234567890\",\n * first_name: \"John\",\n * last_name: \"Doe\",\n * email: \"user@example.com\",\n * },\n * coupon: \"1234567890\",\n * gatwayCharges: 10,\n * paymentMethod: {\n * authorization: {\n * card_type: \"MasterCard\",\n * last4: \"1234\",\n * },\n * },\n * handleDBAction: (data: any) => {\n * console.log(data);\n * },\n * setStatus: (status: number) => {\n * console.log(status);\n * },\n * e: Event,\n * });\n * ```\n * @param contexts - Payment context information\n * @context This function orchestrates the entire payment flow from confirmation to processing\n */\nexport async function handlePaymentSubmit(\n contexts: PaymentContextType\n): Promise<void> {\n if (contexts.e) contexts.e.preventDefault();\n\n if (contexts.openConfirm && contexts.defaultConfirm) {\n let msg = `By clicking okay, you are enrolling for ${contexts.label} with id ${contexts.objects.object_id}.`;\n const confirm = await openConfirmModal(contexts.defaultMsg || msg);\n if (!confirm) return;\n }\n\n const makePayment = async (): Promise<void> => {\n contexts.setStatus(0);\n\n // Check if contexts.coupon is valid\n let coupon_res: CouponType = {\n id: 0,\n code: \"\",\n email_list: \"\",\n object_id: \"\",\n valid_from: \"\",\n valid_to: \"\",\n days_count: 0,\n discount_type: null,\n discount: 0,\n amount: 0,\n currency: \"\",\n active: false,\n timestamp: \"\",\n channel: \"\",\n content_type: 0,\n students: [],\n };\n\n let mewConfigObj: PaystackConfigObjectType;\n\n if (contexts.coupon) {\n const handle = contexts.configObj.metadata?.channel_username;\n const couponObj = JSON.stringify({\n code: contexts.coupon,\n email: contexts.configObj.email,\n content_type: contexts.configObj.content_type,\n object_id: contexts.configObj.object_id,\n });\n\n const requestOptions = reqOptions(\"POST\", couponObj, null, \"json\");\n const url = `${API_HOST_URL}coupons/${handle}/validate-coupon/`;\n\n try {\n const dataset = await fetch(url, requestOptions);\n coupon_res = (await dataset.json()) as CouponType;\n\n if (coupon_res.detail) {\n openToast(coupon_res.detail, 400);\n } else if (coupon_res.id) {\n openToast(\n `${\n coupon_res.discount ||\n `${coupon_res.currency}${coupon_res.amount}`\n }% token was applied.`\n );\n }\n } catch (error) {\n console.error(\"Coupon validation error:\", error);\n openToast(\"Could not validate coupon\", 400);\n }\n }\n\n // Remove the discount from actual amount\n if (coupon_res.discount || coupon_res.amount) {\n if (\n coupon_res.discount === 100 &&\n coupon_res.discount_type === \"percentage\"\n ) {\n const resContext = {\n email: contexts.configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${contexts.coupon}__${contexts.configObj.email}`,\n message: \"Payment complete with 100% token coupon\",\n transaction: \"\",\n canceled: false,\n };\n contexts.handleDBAction(resContext);\n contexts.setStatus(1);\n return;\n }\n\n const amount = calculateCouponDeduction(\n contexts.configObj.amount,\n contexts.configObj.currency || \"NGN\",\n coupon_res\n );\n\n if (!amount.discounted) {\n openToast(amount.detail, 400);\n\n // Abort payment due to invalid coupon\n mewConfigObj = contexts.configObj;\n } else {\n openToast(amount.detail);\n mewConfigObj = {\n ...contexts.configObj,\n ...amount,\n };\n }\n } else {\n // No coupon applied\n mewConfigObj = contexts.configObj;\n }\n\n // Add paystack charges\n if (contexts.gatwayCharges) {\n const fee = contexts.gatwayCharges / 100;\n // Calculate the amount to charge so that after the fee deduction, it matches the intended amount\n const totalAmount = mewConfigObj.amount / (1 - fee);\n // Returns the amount rounded to 2 decimal places\n const decimalAmount = parseFloat(totalAmount.toFixed(2));\n\n // Local transactions fees are capped at ₦2000, meaning that's the absolute maximum you'll ever pay in fees per transaction\n const localCharges = decimalAmount - mewConfigObj.amount;\n\n // Only charge 2k if charges exceed threshold\n const noMoreThan2k =\n localCharges > 2000 ? mewConfigObj.amount + 2000 : decimalAmount;\n\n mewConfigObj.amount = noMoreThan2k;\n }\n\n const dataset = paystackDataConfig(mewConfigObj);\n\n if (mewConfigObj.amount) {\n if (mewConfigObj.authorization_code && contexts.paymentMethod) {\n // Ask if user wants to use existing payment method\n const msg = `Would you prefer we charge your existing ${contexts.paymentMethod.authorization.card_type} card that ends with ${contexts.paymentMethod.last4}?`;\n const confirm = await openConfirmModal(msg, true);\n\n if (confirm) {\n // Charge user with existing card\n const res = await chargeAuthorization(dataset);\n contexts.handleDBAction(res);\n } else {\n // Request for user card details\n const payActivate = await payWithPaystack(dataset);\n\n contexts.handleDBAction(payActivate);\n }\n } else {\n // Request for user card details if payment method doesn't exist\n console.log(\"Pay with paystack: \");\n const payActivate = await payWithPaystack(dataset);\n contexts.handleDBAction(payActivate);\n }\n } else {\n // If cohort is free, don't request for payment\n const resContext = {\n email: contexts.configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${contexts.coupon}__${contexts.configObj.email}`,\n message: \"No payment required for free item\",\n transaction: \"\",\n canceled: false,\n };\n contexts.handleDBAction(resContext);\n }\n\n contexts.setStatus(1);\n };\n\n // Get user email input if doesn't exist\n const checkEmailInConfig = async (): Promise<void> => {\n if (!contexts.configObj.email) {\n const emailValue = await getUserEmailInputModal(contexts.label);\n if (emailValue) {\n contexts.configObj.email = emailValue;\n setCookie(\"email\", emailValue, 2); // store for signup use\n makePayment();\n } else {\n openToast(\"You need to enter a valid email!\", 400);\n await checkEmailInConfig();\n }\n } else {\n setCookie(\"email\", contexts.configObj.email, 2); // store for signup use\n makePayment();\n }\n };\n\n checkEmailInConfig();\n}\n\n/**\n * Handles payment submission without requiring user data upfront\n * Useful for guest checkout or anonymous payments\n * @example\n * ```ts\n * handlePaymentWithoutUserData({\n * amount: 5000,\n * label: \"Course Enrollment\",\n * currency: \"NGN\",\n * metadata: {\n * content_type: \"course\",\n * object_id: \"123\",\n * },\n * handleDBAction: (data: any) => {\n * console.log(data);\n * },\n * setStatus: (status: number) => {\n * console.log(status);\n * },\n * });\n * ```\n * @param config - Minimal payment configuration without user details\n */\nexport async function handlePaymentWithoutUserData(config: {\n amount: number;\n label: string;\n currency?: string;\n metadata?: PaystackConfigObjectType[\"metadata\"];\n handleDBAction: (data?: any) => void;\n setStatus: (status: number) => void;\n coupon?: string;\n gatwayCharges?: number;\n defaultConfirm?: boolean;\n defaultMsg?: string;\n e?: Event | null;\n content_type?: string | number;\n object_id?: string | number;\n}): Promise<void> {\n if (config.e) config.e.preventDefault();\n\n if (config.defaultConfirm) {\n const msg =\n config.defaultMsg ||\n `By clicking okay, you are proceeding with payment for ${config.label}.`;\n const confirm = await openConfirmModal(msg);\n if (!confirm) return;\n }\n\n config.setStatus(0);\n\n // Always prompt for email input\n const emailValue = await getUserEmailInputModal(config.label);\n\n if (!emailValue) {\n openToast(\"You need to enter a valid email to proceed!\", 400);\n config.setStatus(1);\n return;\n }\n\n // Store email for potential signup\n setCookie(\"email\", emailValue, 2);\n\n // Build minimal config object\n let configObj: PaystackConfigObjectType = {\n email: emailValue,\n first_name: \"Guest\",\n last_name: \"User\",\n amount: config.amount,\n currency: config.currency || \"NGN\",\n metadata: config.metadata,\n content_type: config.content_type,\n object_id: config.object_id,\n };\n\n // Handle coupon validation if provided\n if (config.coupon) {\n const handle = config.metadata?.channel_username;\n const couponObj = JSON.stringify({\n code: config.coupon,\n email: emailValue,\n content_type: config.content_type,\n object_id: config.object_id,\n });\n\n const requestOptions = reqOptions(\"POST\", couponObj, null, \"json\");\n const url = `${API_HOST_URL}coupons/${handle}/validate-coupon/`;\n\n try {\n const dataset = await fetch(url, requestOptions);\n const res = await dataset.json();\n\n const discount = res.discount || 0;\n if (res.detail) {\n openToast(res.detail, 400);\n } else if (res.id) {\n openToast(`${discount}% discount was applied.`);\n }\n\n const _discounted = calculateCouponDeduction(\n configObj.amount,\n configObj.currency || \"NGN\",\n res\n );\n\n // Apply discount\n if (_discounted.discounted) {\n if (discount === 100) {\n const resContext = {\n email: configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${config.coupon}__${configObj.email}`,\n message: \"No payment required for free item\",\n transaction: \"\",\n canceled: false,\n };\n config.handleDBAction(resContext);\n config.setStatus(1);\n return;\n }\n\n openToast(_discounted.detail);\n configObj = {\n ...configObj,\n ..._discounted,\n };\n }\n } catch (error) {\n console.error(\"Coupon validation error:\", error);\n openToast(\"Could not validate coupon\", 400);\n }\n }\n\n // Add gateway charges if applicable\n if (config.gatwayCharges) {\n const fee = config.gatwayCharges / 100;\n const totalAmount = configObj.amount / (1 - fee);\n const decimalAmount = parseFloat(totalAmount.toFixed(2));\n const localCharges = decimalAmount - configObj.amount;\n const noMoreThan2k =\n localCharges > 2000 ? configObj.amount + 2000 : decimalAmount;\n configObj.amount = noMoreThan2k;\n }\n\n const dataset = paystackDataConfig(configObj);\n\n if (configObj.amount > 0) {\n // Process payment with Paystack\n const payActivate = await payWithPaystack(dataset);\n config.handleDBAction(payActivate);\n } else {\n // Free item\n const resContext = {\n email: configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${config.coupon}__${configObj.email}`,\n message: \"No payment required for free item\",\n transaction: \"\",\n canceled: false,\n };\n config.handleDBAction(resContext);\n }\n\n config.setStatus(1);\n}\n\n// Add PaystackPop to Window interface\ndeclare global {\n interface Window {\n PaystackPop: {\n setup: (config: any) => { openIframe: () => void };\n };\n }\n}\n"],"names":["paystackDataConfig","obj","authorization_code","reference","Date","getTime","toString","email","first_name","last_name","amount","Math","round","currency","publicKey","process","env","NEXT_PUBLIC_PAYSTACK_SECRET_KEY","key","NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY","callback_url","window","location","href","metadata","chargeAuthorization","_ref","_asyncToGenerator","_regenerator","m","_callee","data","options","_res$data","req","res","_t","w","_context","p","n","method","body","JSON","stringify","headers","Authorization","concat","fetch","v","json","status","openToast","a","console","error","_x","apply","this","arguments","payWithPaystack","config","Promise","_ref2","_callee2","resolve","_t2","_context2","PaystackPop","Error","setup","_objectSpread","callback","response","onClose","cancelled","openIframe","_x2","handlePaymentSubmit","_x3","_handlePaymentSubmit","_callee5","contexts","msg","makePayment","_checkEmailInConfig","_context5","e","preventDefault","openConfirm","defaultConfirm","label","objects","object_id","openConfirmModal","defaultMsg","_ref3","_callee3","coupon_res","mewConfigObj","_contexts$configObj$m","handle","couponObj","requestOptions","url","_dataset","resContext","fee","totalAmount","decimalAmount","localCharges","noMoreThan2k","dataset","_msg","payActivate","_payActivate","_resContext","_t3","_context3","setStatus","id","code","email_list","valid_from","valid_to","days_count","discount_type","discount","active","timestamp","channel","content_type","students","coupon","configObj","channel_username","reqOptions","API_HOST_URL","detail","message","transaction","canceled","handleDBAction","calculateCouponDeduction","discounted","gatwayCharges","parseFloat","toFixed","paymentMethod","authorization","card_type","last4","log","checkEmailInConfig","_ref4","_callee4","emailValue","_context4","getUserEmailInputModal","setCookie","handlePaymentWithoutUserData","_x4","_handlePaymentWithoutUserData","_callee6","_config$metadata","_dataset2","_discounted","_resContext2","_t4","_context6"],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,EAAOiF,eAAepC,GAAY,KAAA,GAGpC7C,EAAO0D,UAAU,GAAG,KAAA,GAAA,OAAAkD,EAAApH,EAAA,GAAA,EAAA8G,EAAA,KAAA,CAAA,CAAA,EAAA,KACrB,KAAA1G,MAAAC,KAAAC,UAAA"}
|
|
1
|
+
{"version":3,"file":"paystack.js","sources":["../../../../src/components/lib/paystack.ts"],"sourcesContent":["import {\n API_HOST_URL,\n calculateCouponDeduction,\n reqOptions,\n setCookie,\n} from \"./helpFunction\";\nimport {\n getUserEmailInputModal,\n openConfirmModal,\n openToast,\n} from \"./modals/modals\";\nimport {\n PaystackConfigObjectType,\n PaystackConfigType,\n PaystackResponseType,\n PaymentContextType,\n CouponType,\n SavedCardChargeOptionsType,\n} from \"@/types\";\n\n/** Paystack inline v2 script, needed for server-initialised transactions. */\nexport const PAYSTACK_INLINE_V2_URL = \"https://js.paystack.co/v2/inline.js\";\n\n/**\n * Context for processing payments\n * @property {Event | null} [e] - The event object that triggered the payment\n * @property {Object} objects - Details about the item being purchased\n * @property {string} objects.title - Title of the item\n * @property {string | number | null} [objects.object_type] - Model ID of the object being purchased\n * @property {string | number | null} [objects.object_id] - Object ID of the object being purchased\n * @property {PaystackConfigObjectType} configObj - Configuration for PayStack\n * @property {PaymentMethodType} [paymentMethod] - Saved payment method if available\n * @property {Function} setStatus - Function to update UI status during payment process\n * @property {Function} handleDBAction - Callback for processing successful payments\n * @property {boolean} [defaultConfirm] - Whether to show a confirmation dialog\n * @property {string} label - Label for the payment (usually item title)\n * @property {string} [coupon] - Coupon code if applicable\n * @property {string} [defaultMsg] - Custom confirmation message\n * @property {number} [gatwayCharges] - Payment gateway charges percentage\n */\n\n/**\n * Configures the Paystack popup data.\n *\n * Only the PUBLIC key (`NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY`) is ever read here.\n * The secret key must never reach the browser: anything a `NEXT_PUBLIC_*`\n * variable holds is inlined into the shipped JavaScript.\n * @param obj - Object containing payment details\n * @returns PaystackConfig - Configured payment data\n */\nexport const paystackDataConfig = (\n obj: PaystackConfigObjectType\n): PaystackConfigType => ({\n reference: new Date().getTime().toString(),\n email: obj.email,\n first_name: obj.first_name,\n last_name: obj.last_name,\n amount: Math.round(obj.amount * 100), // Amount is in the country's lowest currency. E.g Kobo, so 20000 kobo = N200\n currency: obj.currency || \"NGN\",\n key: process.env.NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY,\n callback_url: window.location.href,\n metadata: obj.metadata,\n});\n\n/**\n * Charges the logged-in user's saved card THROUGH THE APP'S SERVER.\n *\n * The browser never calls Paystack's charge_authorization API and never sends\n * an authorization code or an amount the server trusts. It POSTs only what\n * identifies the purchase (`body`, e.g. the saved payment method id, the item\n * and a coupon code) to `chargeUrl`; the server looks the card up by the\n * logged-in user, prices the item itself and charges it with its own secret\n * key. The server is expected to answer with the Paystack transaction object\n * (`status`, `reference`, `amount`, ...), optionally wrapped in `data`.\n *\n * @example\n * ```ts\n * const res = await chargeAuthorization({\n * chargeUrl: `${API_HOST_URL}payments/${channel}/paystack/charge-saved-card/`,\n * token,\n * body: { payment_method_id: card.id, item_type: \"course\", item_id: course.id },\n * });\n * if (res.status === \"success\") recordPayment(res);\n * ```\n * @param options - Server endpoint, auth token and purchase identifiers\n * @returns Promise with the transaction data (status \"failed\" on error)\n */\nexport const chargeAuthorization = async (\n options: SavedCardChargeOptionsType\n): Promise<any> => {\n if (!options?.chargeUrl) {\n openToast(\"Saved card payments are not available here.\", 400);\n return { status: \"failed\", message: \"chargeUrl is required\" };\n }\n\n const requestOptions = reqOptions(\n \"POST\",\n JSON.stringify(options.body || {}),\n options.token || null,\n \"json\",\n options.channel || null\n );\n\n try {\n const req = await fetch(options.chargeUrl, requestOptions);\n const res = await req.json().catch(() => ({}));\n const data = res?.data && typeof res.data === \"object\" ? res.data : res;\n\n if (req.ok && data?.status === \"success\") {\n openToast(`Payment was successful with reference: ${data.reference}`);\n return data;\n }\n\n const message =\n res?.detail ||\n data?.gateway_response ||\n data?.message ||\n \"Payment could not be completed with the saved card\";\n openToast(message, 400);\n return { ...data, status: data?.status || \"failed\", message };\n } catch (error) {\n openToast(\"Payment processing error occurred\", 400);\n console.error(\"Saved card charge error:\", error);\n return { status: \"failed\", error };\n }\n};\n\n/**\n * Opens the Paystack popup for a transaction the app's SERVER initialised\n * (POST /transaction/initialize with the secret key), so amount, email and\n * metadata are fixed server-side and cannot be changed in the browser.\n *\n * Uses Paystack inline v2 (`resumeTransaction`). The v2 script is loaded on\n * demand when it is not already on the page.\n * @param accessCode - `access_code` returned by the server's initialize call\n * @returns Promise with the payment response (`status: \"canceled\"` on close)\n */\nexport const payWithAccessCode = (\n accessCode: string\n): Promise<PaystackResponseType> => {\n const empty = { email: \"\", amount: 0 };\n\n const loadV2 = (): Promise<any> =>\n new Promise((resolve, reject) => {\n const existing = (window as any).PaystackPop;\n if (existing && typeof existing === \"function\") {\n return resolve(existing);\n }\n const script = document.createElement(\"script\");\n script.src = PAYSTACK_INLINE_V2_URL;\n script.async = true;\n script.onload = () => resolve((window as any).PaystackPop);\n script.onerror = () => reject(new Error(\"Paystack script failed to load\"));\n document.body.appendChild(script);\n });\n\n return new Promise(async (resolve) => {\n try {\n if (!accessCode) throw new Error(\"accessCode is required\");\n const Pop = await loadV2();\n const popup = new Pop();\n popup.resumeTransaction(accessCode, {\n onSuccess: (response: PaystackResponseType) => {\n openToast(\"Payment complete! Reference: \" + response.reference);\n resolve({ ...empty, ...response, status: response.status || \"success\" });\n },\n onCancel: () => {\n openToast(\"Transaction was not completed, window closed.\", 400);\n resolve({\n ...empty,\n status: \"canceled\",\n cancelled: true,\n reference: \"\",\n } as PaystackResponseType);\n },\n onError: (error: any) => {\n openToast(error?.message || \"Payment could not be initiated\", 400);\n resolve({ ...empty, status: \"failed\", reference: \"\", error });\n },\n });\n } catch (error) {\n console.error(\"Paystack access code error:\", error);\n openToast(\"Payment could not be initiated\", 400);\n resolve({ ...empty, status: \"failed\", reference: \"\", error });\n }\n });\n};\n\n/**\n * Initiates payment with Paystack popup\n * @param config - Payment configuration\n * @returns Promise with payment response\n */\nexport const payWithPaystack = (\n config: PaystackConfigType\n): Promise<PaystackResponseType> => {\n return new Promise(async (resolve) => {\n try {\n // Ensure PaystackPop is available\n if (!window.PaystackPop) {\n throw new Error(\"Paystack script not loaded\");\n }\n\n let handler = await window.PaystackPop.setup({\n ...config,\n callback: (response: PaystackResponseType) => {\n // This happens after the payment is completed successfully\n openToast(\"Payment complete! Reference: \" + response.reference);\n resolve({ ...response, email: config.email, amount: config.amount });\n },\n onClose: () => {\n openToast(\"Transaction was not completed, window closed.\", 400);\n resolve({\n status: \"canceled\",\n cancelled: true,\n reference: config.reference,\n email: config.email,\n amount: config.amount,\n } as PaystackResponseType);\n },\n });\n handler.openIframe();\n } catch (error) {\n console.error(\"Paystack initialization error:\", error);\n openToast(\"Payment could not be initiated\", 400);\n resolve({\n status: \"failed\",\n cancelled: true,\n reference: config.reference,\n error,\n email: config.email,\n amount: config.amount,\n } as PaystackResponseType);\n }\n });\n};\n\n/**\n * Handles the complete payment submission process\n * @example\n * ```ts\n * handlePaymentSubmit({\n * openConfirm: true,\n * defaultConfirm: true,\n * defaultMsg: \"Are you sure you want to enroll for this course?\",\n * label: \"Course Name\",\n * objects: {\n * object_id: \"123\",\n * object_type: \"course\",\n * },\n * configObj: {\n * email: \"user@example.com\",\n * amount: 1000,\n * currency: \"NGN\",\n * first_name: \"John\",\n * last_name: \"Doe\",\n * email: \"user@example.com\",\n * },\n * coupon: \"1234567890\",\n * gatwayCharges: 10,\n * paymentMethod: savedCard, // from user-payment-method-list\n * // Saved cards are charged by YOUR server, never from the browser.\n * // Without savedCardCharge the user always gets the Paystack popup.\n * savedCardCharge: {\n * chargeUrl: `${API_HOST_URL}payments/${channel}/paystack/charge-saved-card/`,\n * token,\n * body: { item_type: \"course\", item_id: \"123\" },\n * },\n * handleDBAction: (data: any) => {\n * console.log(data);\n * },\n * setStatus: (status: number) => {\n * console.log(status);\n * },\n * e: Event,\n * });\n * ```\n * @param contexts - Payment context information\n * @context This function orchestrates the entire payment flow from confirmation to processing\n */\nexport async function handlePaymentSubmit(\n contexts: PaymentContextType\n): Promise<void> {\n if (contexts.e) contexts.e.preventDefault();\n\n if (contexts.openConfirm && contexts.defaultConfirm) {\n let msg = `By clicking okay, you are enrolling for ${contexts.label} with id ${contexts.objects.object_id}.`;\n const confirm = await openConfirmModal(contexts.defaultMsg || msg);\n if (!confirm) return;\n }\n\n const makePayment = async (): Promise<void> => {\n contexts.setStatus(0);\n\n // Check if contexts.coupon is valid\n let coupon_res: CouponType = {\n id: 0,\n code: \"\",\n email_list: \"\",\n object_id: \"\",\n valid_from: \"\",\n valid_to: \"\",\n days_count: 0,\n discount_type: null,\n discount: 0,\n amount: 0,\n currency: \"\",\n active: false,\n timestamp: \"\",\n channel: \"\",\n content_type: 0,\n students: [],\n };\n\n let mewConfigObj: PaystackConfigObjectType;\n\n if (contexts.coupon) {\n const handle = contexts.configObj.metadata?.channel_username;\n const couponObj = JSON.stringify({\n code: contexts.coupon,\n email: contexts.configObj.email,\n content_type: contexts.configObj.content_type,\n object_id: contexts.configObj.object_id,\n });\n\n const requestOptions = reqOptions(\"POST\", couponObj, null, \"json\");\n const url = `${API_HOST_URL}coupons/${handle}/validate-coupon/`;\n\n try {\n const dataset = await fetch(url, requestOptions);\n coupon_res = (await dataset.json()) as CouponType;\n\n if (coupon_res.detail) {\n openToast(coupon_res.detail, 400);\n } else if (coupon_res.id) {\n openToast(\n `${\n coupon_res.discount ||\n `${coupon_res.currency}${coupon_res.amount}`\n }% token was applied.`\n );\n }\n } catch (error) {\n console.error(\"Coupon validation error:\", error);\n openToast(\"Could not validate coupon\", 400);\n }\n }\n\n // Remove the discount from actual amount\n if (coupon_res.discount || coupon_res.amount) {\n if (\n coupon_res.discount === 100 &&\n coupon_res.discount_type === \"percentage\"\n ) {\n const resContext = {\n email: contexts.configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${contexts.coupon}__${contexts.configObj.email}`,\n message: \"Payment complete with 100% token coupon\",\n transaction: \"\",\n canceled: false,\n };\n contexts.handleDBAction(resContext);\n contexts.setStatus(1);\n return;\n }\n\n const amount = calculateCouponDeduction(\n contexts.configObj.amount,\n contexts.configObj.currency || \"NGN\",\n coupon_res\n );\n\n if (!amount.discounted) {\n openToast(amount.detail, 400);\n\n // Abort payment due to invalid coupon\n mewConfigObj = contexts.configObj;\n } else {\n openToast(amount.detail);\n mewConfigObj = {\n ...contexts.configObj,\n ...amount,\n };\n }\n } else {\n // No coupon applied\n mewConfigObj = contexts.configObj;\n }\n\n // Add paystack charges\n if (contexts.gatwayCharges) {\n const fee = contexts.gatwayCharges / 100;\n // Calculate the amount to charge so that after the fee deduction, it matches the intended amount\n const totalAmount = mewConfigObj.amount / (1 - fee);\n // Returns the amount rounded to 2 decimal places\n const decimalAmount = parseFloat(totalAmount.toFixed(2));\n\n // Local transactions fees are capped at ₦2000, meaning that's the absolute maximum you'll ever pay in fees per transaction\n const localCharges = decimalAmount - mewConfigObj.amount;\n\n // Only charge 2k if charges exceed threshold\n const noMoreThan2k =\n localCharges > 2000 ? mewConfigObj.amount + 2000 : decimalAmount;\n\n mewConfigObj.amount = noMoreThan2k;\n }\n\n const dataset = paystackDataConfig(mewConfigObj);\n\n if (mewConfigObj.amount) {\n if (contexts.paymentMethod && contexts.savedCardCharge?.chargeUrl) {\n // Ask if user wants to use existing payment method\n const msg = `Would you prefer we charge your existing ${contexts.paymentMethod.authorization?.card_type || \"\"} card that ends with ${contexts.paymentMethod.last4}?`;\n const confirm = await openConfirmModal(msg, true);\n\n if (confirm) {\n // Charge the saved card on the server: it prices the item itself.\n const res = await chargeAuthorization({\n ...contexts.savedCardCharge,\n body: {\n payment_method_id: contexts.paymentMethod.id,\n coupon: contexts.coupon || null,\n content_type: contexts.configObj.content_type ?? null,\n object_id: contexts.configObj.object_id ?? null,\n metadata: dataset.metadata || {},\n ...(contexts.savedCardCharge.body || {}),\n },\n });\n contexts.handleDBAction(res);\n } else {\n // Request for user card details\n const payActivate = await payWithPaystack(dataset);\n\n contexts.handleDBAction(payActivate);\n }\n } else {\n // Request for user card details if payment method doesn't exist\n console.log(\"Pay with paystack: \");\n const payActivate = await payWithPaystack(dataset);\n contexts.handleDBAction(payActivate);\n }\n } else {\n // If cohort is free, don't request for payment\n const resContext = {\n email: contexts.configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${contexts.coupon}__${contexts.configObj.email}`,\n message: \"No payment required for free item\",\n transaction: \"\",\n canceled: false,\n };\n contexts.handleDBAction(resContext);\n }\n\n contexts.setStatus(1);\n };\n\n // Get user email input if doesn't exist\n const checkEmailInConfig = async (): Promise<void> => {\n if (!contexts.configObj.email) {\n const emailValue = await getUserEmailInputModal(contexts.label);\n if (emailValue) {\n contexts.configObj.email = emailValue;\n setCookie(\"email\", emailValue, 2); // store for signup use\n makePayment();\n } else {\n openToast(\"You need to enter a valid email!\", 400);\n await checkEmailInConfig();\n }\n } else {\n setCookie(\"email\", contexts.configObj.email, 2); // store for signup use\n makePayment();\n }\n };\n\n checkEmailInConfig();\n}\n\n/**\n * Handles payment submission without requiring user data upfront\n * Useful for guest checkout or anonymous payments\n * @example\n * ```ts\n * handlePaymentWithoutUserData({\n * amount: 5000,\n * label: \"Course Enrollment\",\n * currency: \"NGN\",\n * metadata: {\n * content_type: \"course\",\n * object_id: \"123\",\n * },\n * handleDBAction: (data: any) => {\n * console.log(data);\n * },\n * setStatus: (status: number) => {\n * console.log(status);\n * },\n * });\n * ```\n * @param config - Minimal payment configuration without user details\n */\nexport async function handlePaymentWithoutUserData(config: {\n amount: number;\n label: string;\n currency?: string;\n metadata?: PaystackConfigObjectType[\"metadata\"];\n handleDBAction: (data?: any) => void;\n setStatus: (status: number) => void;\n coupon?: string;\n gatwayCharges?: number;\n defaultConfirm?: boolean;\n defaultMsg?: string;\n e?: Event | null;\n content_type?: string | number;\n object_id?: string | number;\n}): Promise<void> {\n if (config.e) config.e.preventDefault();\n\n if (config.defaultConfirm) {\n const msg =\n config.defaultMsg ||\n `By clicking okay, you are proceeding with payment for ${config.label}.`;\n const confirm = await openConfirmModal(msg);\n if (!confirm) return;\n }\n\n config.setStatus(0);\n\n // Always prompt for email input\n const emailValue = await getUserEmailInputModal(config.label);\n\n if (!emailValue) {\n openToast(\"You need to enter a valid email to proceed!\", 400);\n config.setStatus(1);\n return;\n }\n\n // Store email for potential signup\n setCookie(\"email\", emailValue, 2);\n\n // Build minimal config object\n let configObj: PaystackConfigObjectType = {\n email: emailValue,\n first_name: \"Guest\",\n last_name: \"User\",\n amount: config.amount,\n currency: config.currency || \"NGN\",\n metadata: config.metadata,\n content_type: config.content_type,\n object_id: config.object_id,\n };\n\n // Handle coupon validation if provided\n if (config.coupon) {\n const handle = config.metadata?.channel_username;\n const couponObj = JSON.stringify({\n code: config.coupon,\n email: emailValue,\n content_type: config.content_type,\n object_id: config.object_id,\n });\n\n const requestOptions = reqOptions(\"POST\", couponObj, null, \"json\");\n const url = `${API_HOST_URL}coupons/${handle}/validate-coupon/`;\n\n try {\n const dataset = await fetch(url, requestOptions);\n const res = await dataset.json();\n\n const discount = res.discount || 0;\n if (res.detail) {\n openToast(res.detail, 400);\n } else if (res.id) {\n openToast(`${discount}% discount was applied.`);\n }\n\n const _discounted = calculateCouponDeduction(\n configObj.amount,\n configObj.currency || \"NGN\",\n res\n );\n\n // Apply discount\n if (_discounted.discounted) {\n if (discount === 100) {\n const resContext = {\n email: configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${config.coupon}__${configObj.email}`,\n message: \"No payment required for free item\",\n transaction: \"\",\n canceled: false,\n };\n config.handleDBAction(resContext);\n config.setStatus(1);\n return;\n }\n\n openToast(_discounted.detail);\n configObj = {\n ...configObj,\n ..._discounted,\n };\n }\n } catch (error) {\n console.error(\"Coupon validation error:\", error);\n openToast(\"Could not validate coupon\", 400);\n }\n }\n\n // Add gateway charges if applicable\n if (config.gatwayCharges) {\n const fee = config.gatwayCharges / 100;\n const totalAmount = configObj.amount / (1 - fee);\n const decimalAmount = parseFloat(totalAmount.toFixed(2));\n const localCharges = decimalAmount - configObj.amount;\n const noMoreThan2k =\n localCharges > 2000 ? configObj.amount + 2000 : decimalAmount;\n configObj.amount = noMoreThan2k;\n }\n\n const dataset = paystackDataConfig(configObj);\n\n if (configObj.amount > 0) {\n // Process payment with Paystack\n const payActivate = await payWithPaystack(dataset);\n config.handleDBAction(payActivate);\n } else {\n // Free item\n const resContext = {\n email: configObj.email,\n amount: 0,\n status: \"success\",\n reference: `COUPON__${config.coupon}__${configObj.email}`,\n message: \"No payment required for free item\",\n transaction: \"\",\n canceled: false,\n };\n config.handleDBAction(resContext);\n }\n\n config.setStatus(1);\n}\n\n// Add PaystackPop to Window interface\ndeclare global {\n interface Window {\n PaystackPop: {\n setup: (config: any) => { openIframe: () => void };\n };\n }\n}\n"],"names":["PAYSTACK_INLINE_V2_URL","paystackDataConfig","obj","reference","Date","getTime","toString","email","first_name","last_name","amount","Math","round","currency","key","process","env","NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY","callback_url","window","location","href","metadata","chargeAuthorization","_ref","_asyncToGenerator","_regenerator","m","_callee","options","requestOptions","req","res","data","message","_t","w","_context","p","n","chargeUrl","openToast","a","status","reqOptions","JSON","stringify","body","token","channel","fetch","v","json","_typeof","ok","concat","detail","gateway_response","_objectSpread","console","error","_x","apply","this","arguments","payWithAccessCode","accessCode","empty","loadV2","Promise","resolve","reject","existing","PaystackPop","script","document","createElement","src","async","onload","onerror","Error","appendChild","_ref2","_callee2","Pop","_t2","_context2","resumeTransaction","onSuccess","response","onCancel","cancelled","onError","_x2","payWithPaystack","config","_ref3","_callee3","_t3","_context3","setup","callback","onClose","openIframe","_x3","handlePaymentSubmit","_x4","_handlePaymentSubmit","_callee6","contexts","msg","makePayment","_checkEmailInConfig","_context6","e","preventDefault","openConfirm","defaultConfirm","label","objects","object_id","openConfirmModal","defaultMsg","_ref4","_callee4","coupon_res","mewConfigObj","_contexts$configObj$m","handle","couponObj","url","_dataset","resContext","fee","totalAmount","decimalAmount","localCharges","noMoreThan2k","dataset","_contexts$savedCardCh","_contexts$paymentMeth","_msg","_contexts$configObj$c","_contexts$configObj$o","payActivate","_payActivate","_resContext","_t4","_context4","setStatus","id","code","email_list","valid_from","valid_to","days_count","discount_type","discount","active","timestamp","content_type","students","coupon","configObj","channel_username","API_HOST_URL","transaction","canceled","handleDBAction","calculateCouponDeduction","discounted","gatwayCharges","parseFloat","toFixed","paymentMethod","savedCardCharge","authorization","card_type","last4","payment_method_id","log","checkEmailInConfig","_ref5","_callee5","emailValue","_context5","getUserEmailInputModal","setCookie","handlePaymentWithoutUserData","_x5","_handlePaymentWithoutUserData","_callee7","_config$metadata","_dataset2","_discounted","_resContext2","_t5","_context7"],"mappings":"iVAqBO,IAAMA,EAAyB,sCA6BzBC,EAAqB,SAChCC,GAA6B,MACL,CACxBC,WAAW,IAAIC,MAAOC,UAAUC,WAChCC,MAAOL,EAAIK,MACXC,WAAYN,EAAIM,WAChBC,UAAWP,EAAIO,UACfC,OAAQC,KAAKC,MAAmB,IAAbV,EAAIQ,QACvBG,SAAUX,EAAIW,UAAY,MAC1BC,IAAKC,QAAQC,IAAIC,gCACjBC,aAAcC,OAAOC,SAASC,KAC9BC,SAAUpB,EAAIoB,SACf,EAyBYC,EAAmB,WAAA,IAAAC,EAAAC,EAAAC,IAAAC,EAAG,SAAAC,EACjCC,GAAmC,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAT,IAAAU,EAAA,SAAAC,GAAA,cAAAA,EAAAC,EAAAD,EAAAE,GAAA,KAAA,EAAA,GAE9BV,SAAAA,EAASW,UAAS,CAAAH,EAAAE,EAAA,EAAA,KAAA,CACyC,OAA9DE,EAAU,8CAA+C,KAAKJ,EAAAK,EACvD,EAAA,CAAEC,OAAQ,SAAUT,QAAS,0BAAyB,KAAA,EAS9D,OANKJ,EAAiBc,EACrB,OACAC,KAAKC,UAAUjB,EAAQkB,MA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,EAAA,GAAA+J,EAAAC,EAAAnJ,EAGJQ,QAAQC,MAAM,2BAA0ByI,GACxC5J,EAAU,4BAA6B,KAAK,KAAA,GAeH,GAVzCuD,EAAO4E,gBACHtC,EAAMtC,EAAO4E,cAAgB,IAC7BrC,EAAc6B,EAAU1J,QAAU,EAAI4H,GACtCE,EAAgBqC,WAAWtC,EAAYuC,QAAQ,IAC/CrC,EAAeD,EAAgB4B,EAAU1J,OACzCgI,EACJD,EAAe,IAAO2B,EAAU1J,OAAS,IAAO8H,EAClD4B,EAAU1J,OAASgI,GAGfC,EAAU1I,EAAmBmK,KAE/BA,EAAU1J,OAAS,GAAC,CAAA4L,EAAA/J,EAAA,GAAA,KAAA,CAAA,OAAA+J,EAAA/J,EAAA,GAEIwD,EAAgB4C,GAAQ,KAAA,GAA5CM,EAAWqD,EAAAnJ,EACjB6C,EAAOyE,eAAexB,GAAaqD,EAAA/J,EAAA,GAAA,MAAA,KAAA,GAG7B8F,EAAa,CACjB9H,MAAO6J,EAAU7J,MACjBG,OAAQ,EACRiC,OAAQ,UACRxC,UAASoD,WAAAA,OAAayC,EAAOmE,OAAM5G,MAAAA,OAAK6G,EAAU7J,OAClD2B,QAAS,oCACTqI,YAAa,GACbC,UAAU,GAEZxE,EAAOyE,eAAepC,GAAY,KAAA,GAGpCrC,EAAOsD,UAAU,GAAG,KAAA,GAAA,OAAAgD,EAAA5J,EAAA,GAAA,EAAAsJ,EAAA,KAAA,CAAA,CAAA,EAAA,KACrB,KAAAlI,MAAAC,KAAAC,UAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.cjs"),o=require("react/jsx-runtime"),t=require("../../../node_modules/.pnpm/lucide-react@0.525.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/check.cjs"),n=require("../../../node_modules/.pnpm/lucide-react@0.525.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/copy.cjs"),s=require("react"),a=require("../forms/FilterObjects.cjs"),r=require("../forms/InputText.cjs");exports.default=function(){var c=s.useState(""),p=e.slicedToArray(c,2),i=p[0],m=p[1],d=s.useState(""),l=e.slicedToArray(d,2),u=l[0],h=l[1],x=s.useState(null),_=e.slicedToArray(x,2),g=_[0],b=_[1],y=[{name:"FormComponent",description:"Reusable form component for user input",category:"Forms",repo_path:"src/components/forms",example_path:"docs/static-docs/examples/FormComponent.md",visual_demo_url:"/components/auth/signup-form"},{name:"ActionDropdown",description:"Dropdown component for actions",category:"Forms",repo_path:"src/components/forms/ActionDropdown.tsx",example_path:"docs/static-docs/components/ActionDropdown.md",visual_demo_url:"/components/forms/action-dropdown"},{name:"AnimatedBox",description:"Animated container component",category:"Forms",repo_path:"src/components/forms/AnimatedBox.tsx",example_path:"docs/static-docs/components/AnimatedBox.md",visual_demo_url:"/components/forms/animated-box"},{name:"PasswordField",description:"Secure password input field",category:"Forms",repo_path:"src/components/forms/PasswordField.tsx",example_path:"docs/static-docs/components/PasswordField.md",visual_demo_url:"/components/forms/password-field"},{name:"DateInput",description:"Date selection input field",category:"Forms",repo_path:"src/components/forms/DateInput.tsx",example_path:"docs/static-docs/components/DateInput.md",visual_demo_url:"/components/forms/date-input"},{name:"DateTimeInput",description:"Date and time selection input field",category:"Forms",repo_path:"src/components/forms/DateTimeInput.tsx",example_path:"docs/static-docs/components/DateTimeInput.md"},{name:"DateTimePicker",description:"Modern date and time picker with calendar popup",category:"Forms",repo_path:"src/components/forms/DateTimePicker.tsx",example_path:"docs/static-docs/components/DateTimePicker.md",visual_demo_url:"/components/forms/time-picker"},{name:"DateRangePicker",description:"Date range picker with two-click selection, hover preview, and quick presets",category:"Forms",repo_path:"src/components/forms/DateRangePicker.tsx",example_path:"docs/static-docs/components/DateRangePicker.md",visual_demo_url:"/components/forms/date-range-picker"},{name:"DropFile",description:"File drag and drop component",category:"Forms",repo_path:"src/components/forms/DropFile.tsx",example_path:"docs/static-docs/components/DropFile.md",visual_demo_url:"/components/forms/drop-file"},{name:"EmailList",description:"Email list display component",category:"Forms",repo_path:"src/components/forms/EmailList.tsx",example_path:"docs/static-docs/components/EmailList.md",visual_demo_url:"/components/forms/email-list"},{name:"FilterArray",description:"Array filtering component",category:"Forms",repo_path:"src/components/forms/FilterArray.tsx",example_path:"docs/static-docs/components/FilterArray.md",visual_demo_url:"/components/forms/filter-array"},{name:"FilterBy",description:"Filtering component with criteria",category:"Forms",repo_path:"src/components/forms/FilterBy.tsx",example_path:"docs/static-docs/components/FilterBy.md"},{name:"FilterObjects",description:"Object filtering component",category:"Forms",repo_path:"src/components/forms/FilterObjects.tsx",example_path:"docs/static-docs/components/FilterObjects.md",visual_demo_url:"/components/forms/filter-objects"},{name:"FormError",description:"Form error display component",category:"Forms",repo_path:"src/components/forms/FormError.tsx",example_path:"docs/static-docs/components/FormError.md"},{name:"HandleError",description:"Error handling component",category:"Forms",repo_path:"src/components/forms/HandleError.tsx",example_path:"docs/static-docs/components/HandleError.md"},{name:"Logout",description:"Logout functionality component",category:"Forms",repo_path:"src/components/forms/Logout.tsx",example_path:"docs/static-docs/components/Logout.md"},{name:"MessageDisplay",description:"Message display component",category:"Forms",repo_path:"src/components/forms/MessageDisplay.tsx",example_path:"docs/static-docs/components/MessageDisplay.md"},{name:"MultipleEmail",description:"Multiple email input component",category:"Forms",repo_path:"src/components/forms/MultipleEmail.tsx",example_path:"docs/static-docs/components/MultipleEmail.md",visual_demo_url:"/components/forms/multiple-email"},{name:"PageLoading",description:"Page loading indicator component",category:"Forms",repo_path:"src/components/forms/PageLoading.tsx",example_path:"docs/static-docs/components/PageLoading.md"},{name:"PhoneNumberInput",description:"Phone number input with searchable country picker, paste detection and E.164 output",category:"Forms",repo_path:"src/components/forms/PhoneNumberInput.tsx",example_path:"docs/static-docs/components/PhoneNumberInput.md",visual_demo_url:"/components/forms/phone-number-input"},{name:"RadioField",description:"Radio button input field",category:"Forms",repo_path:"src/components/forms/RadioField.tsx",example_path:"docs/static-docs/components/RadioField.md"},{name:"RadioSimple",description:"Simplified radio button component",category:"Forms",repo_path:"src/components/forms/RadioSimple.tsx",example_path:"docs/static-docs/components/RadioSimple.md"},{name:"ReactTimeAgo",description:"Time ago display component",category:"Forms",repo_path:"src/components/forms/ReactTimeAgo.tsx",example_path:"docs/static-docs/components/ReactTimeAgo.md"},{name:"ReadTermsAndCondition",description:"Terms and conditions acceptance component",category:"Forms",repo_path:"src/components/forms/ReadTermsAndCondition.tsx",example_path:"docs/static-docs/components/ReadTermsAndCondition.md"},{name:"SearchField",description:"Search input field component",category:"Forms",repo_path:"src/components/forms/SearchField.tsx",example_path:"docs/static-docs/components/SearchField.md",visual_demo_url:"/components/forms/search-field"},{name:"SearchFieldDB",description:"Database search field component",category:"Forms",repo_path:"src/components/forms/SearchFieldDB.tsx",example_path:"docs/static-docs/components/SearchFieldDB.md"},{name:"SearchableDropdown",description:"API-powered searchable dropdown with debounced search, selection, and clear",category:"Forms",repo_path:"src/components/forms/SearchableDropdown.tsx",example_path:"docs/static-docs/components/SearchableDropdown.md",visual_demo_url:"/components/forms/searchable-dropdown"},{name:"StepProgressBar",description:"Step progress indicator component",category:"Forms",repo_path:"src/components/forms/StepProgressBar.tsx",example_path:"docs/static-docs/components/StepProgressBar.md"},{name:"SubmitButton",description:"Form submission button component",category:"Forms",repo_path:"src/components/forms/SubmitButton.tsx",example_path:"docs/static-docs/components/SubmitButton.md"},{name:"Tables",description:"Table display component",category:"Forms",repo_path:"src/components/forms/Tables.tsx",example_path:"docs/static-docs/components/Tables.md"},{name:"TextArea",description:"Multi-line text input component",category:"Forms",repo_path:"src/components/forms/TextArea.tsx",example_path:"docs/static-docs/components/TextArea.md"},{name:"TextField",description:"Text input field component",category:"Forms",repo_path:"src/components/forms/TextField.tsx",example_path:"docs/static-docs/components/TextField.md"},{name:"Tooltip",description:"Tooltip display component",category:"Forms",repo_path:"src/components/forms/Tooltip.tsx",example_path:"docs/static-docs/components/Tooltip.md"},{name:"UnsplashRandomImage",description:"Random image from Unsplash component",category:"Forms",repo_path:"src/components/forms/UnsplashRandomImage.tsx",example_path:"docs/static-docs/components/UnsplashRandomImage.md"},{name:"DownloadAsExcel",description:"Excel download functionality component",category:"Forms",repo_path:"src/components/forms/DownloadAsExcel.tsx",example_path:"docs/static-docs/components/DownloadAsExcel.md"},{name:"THeadSortBtn",description:"Table header sort button component",category:"Forms",repo_path:"src/components/forms/THeadSortBtn.tsx",example_path:"docs/static-docs/components/THeadSortBtn.md"},{name:"THeadSortList",description:"Table header sort list component",category:"Forms",repo_path:"src/components/forms/THeadSortList.tsx",example_path:"docs/static-docs/components/THeadSortList.md"},{name:"TBodyNoData",description:"Table body empty state component",category:"Forms",repo_path:"src/components/forms/TBodyNoData.tsx",example_path:"docs/static-docs/components/TBodyNoData.md"},{name:"FileUploader",description:"File upload component",category:"Forms",repo_path:"src/components/forms/uploads/FileUploader.tsx",example_path:"docs/static-docs/components/FileUploader.md",visual_demo_url:"/components/forms/file-uploader"},{name:"IhubFileUploader",description:"InstinctHub file upload component",category:"Forms",repo_path:"src/components/forms/uploads/IhubFileUploader.tsx",example_path:"docs/static-docs/components/IhubFileUploader.md"},{name:"S3MultiUploader",description:"Multi-file queue uploader with per-file progress bars and direct S3 multipart upload via @aws-sdk/lib-storage",category:"Forms",repo_path:"src/components/forms/uploads/S3MultiUploader.tsx",example_path:"docs/static-docs/components/S3MultiUploader.md",visual_demo_url:"/components/ui/s3-multi-uploader"},{name:"ActionCallbackDropdown",description:"Action callback dropdown component",category:"Forms",repo_path:"src/components/forms/ActionCallbackDropdown.tsx",example_path:"docs/static-docs/components/ActionCallbackDropdown.md"},{name:"InputNumber",description:"InputNumber component for numerical input",category:"Form",repo_path:"src/components/forms/InputNumber.tsx",example_path:"docs/static-docs/components/InputNumber.md",visual_demo_url:"/components/forms/input-number"},{name:"InputText",description:"InputText component for text input",category:"Form",repo_path:"src/components/forms/InputText.tsx",example_path:"docs/static-docs/components/InputText.md",visual_demo_url:"/components/forms/input-text"},{name:"InputTextarea",description:"InputTextarea component for text input",category:"Form",repo_path:"src/components/forms/InputTextarea.tsx",example_path:"docs/static-docs/components/InputTextarea.md",visual_demo_url:"/components/forms/input-textarea"},{name:"SearchObjectsFromDB",description:"SearchObjectsFromDB component for searching objects from database",category:"Form",repo_path:"src/components/forms/SearchObjectsFromDB.tsx",example_path:"docs/static-docs/components/SearchObjectsFromDB.md"},{name:"ToggleButton",description:"ToggleButton component for changing state.",category:"Form",repo_path:"src/components/forms/ToggleButton.tsx",example_path:"docs/static-docs/components/ToggleButton.md"},{name:"DateInputPicker",description:"DateInputPicker component for picking date and time.",category:"Form",repo_path:"src/components/forms/DateInputPicker.tsx",example_path:"docs/static-docs/components/DateInputPicker.md"},{name:"TimePicker",description:"TimePicker component for selecting time with 12/24-hour format support.",category:"Form",repo_path:"src/components/forms/TimePicker.tsx",example_path:"docs/static-docs/components/TimePicker.md"},{name:"ChipsInput",description:"ChipsInput is used to enter multiple values on an input field.",category:"Form",repo_path:"src/components/forms/ChipsInput.tsx",example_path:"docs/static-docs/components/ChipsInput.md"},{name:"RadioButton",description:"RadioButton is used to enter single value on an input field.",category:"Form",repo_path:"src/components/forms/radio-btn/RadioButton.tsx",example_path:"docs/static-docs/components/RadioButton.md"},{name:"RadioGroup",description:"RadioGroup is used to select each from group value on an input field.",category:"Form",repo_path:"src/components/forms/radio-btn/RadioGroup.tsx",example_path:"docs/static-docs/components/RadioGroup.md"},{name:"InputAmount",description:"InputAmount is used to enter amount on an input field.",category:"Form",repo_path:"src/components/forms/InputAmount.tsx",example_path:"docs/static-docs/components/InputAmount.md"},{name:"CheckBoxes",description:"CheckBoxes is used to enter multiple values on an input field.",category:"Form",repo_path:"src/components/forms/CheckBoxes.tsx",example_path:"docs/static-docs/components/CheckBoxes.md"},{name:"CheckBoxesField",description:"CheckBoxesField is used to enter multiple values on an input field.",category:"Form",repo_path:"src/components/forms/CheckboxesField.tsx",example_path:"docs/static-docs/components/CheckBoxesField.md"},{name:"CountryInput",description:"Searchable country selector input field",category:"Form",repo_path:"src/components/forms/CountryInput.tsx",example_path:"docs/static-docs/components/CountryInput.md"},{name:"CountryStateInput",description:"Searchable state/province selector based on selected country",category:"Form",repo_path:"src/components/forms/CountryStateInput.tsx",example_path:"docs/static-docs/components/CountryStateInput.md"},{name:"InputSearchDropdown",description:"Generic searchable dropdown component for organizations",category:"Form",repo_path:"src/components/forms/InputSearchDropdown.tsx",example_path:"docs/static-docs/components/InputSearchDropdown.md"},{name:"RangeRadio",description:"Range radio button component for selecting values within a range",category:"Form",repo_path:"src/components/forms/RangeRadio.tsx",example_path:"docs/static-docs/components/RangeRadio.md"},{name:"IsUsernameEmailTaken",description:"Username/email availability checker",category:"Auth",repo_path:"src/components/auth/IsUsernameEmailTaken.tsx",example_path:"docs/static-docs/components/IsUsernameEmailTaken.md",visual_demo_url:"/components/auth/username-email-checker"},{name:"ClientDetector",description:"Client device detection component",category:"Auth",repo_path:"src/components/auth/ClientDetector.tsx",example_path:"docs/static-docs/components/ClientDetector.md",visual_demo_url:"/components/auth/client-detector"},{name:"PasswordsMatch",description:"Password matching validation component",category:"Auth",repo_path:"src/components/auth/PasswordsMatch.tsx",example_path:"docs/static-docs/components/PasswordsMatch.md"},{name:"FromInstinctHub",description:"From InstinctHub component",category:"Auth",repo_path:"src/components/auth/FromInstinctHub.tsx",example_path:"docs/static-docs/components/FromInstinctHub.md"},{name:"LoginForm",description:"Login form component",category:"Auth",repo_path:"src/components/auth/LoginForm.tsx",example_path:"docs/static-docs/components/LoginForm.md",visual_demo_url:"/components/auth/login-form"},{name:"SignUpForm",description:"Sign up form component",category:"Auth",repo_path:"src/__examples__/src/components/forms/SignUpFormExample.tsx",example_path:"docs/static-docs/components/SignUpForm.md",visual_demo_url:"/components/auth/signup-form"},{name:"ReactClientProviders",description:"Comprehensive wrapper providing all essential React providers",category:"Auth",repo_path:"src/components/auth/ReactClientProviders.tsx",example_path:"docs/static-docs/components/ReactClientProviders.md"},{name:"ClientOnly",description:"Wrapper component that only renders children on client side",category:"Auth",repo_path:"src/components/auth/ClientOnly.tsx",example_path:"docs/static-docs/components/ClientOnly.md"},{name:"useClientSide",description:"Hook for safely handling client-side initialization",category:"Auth",repo_path:"src/components/auth/useClientSide.ts",example_path:"docs/static-docs/components/useClientSide.md"},{name:"useFormattedDate",description:"Hook for consistent date formatting between server and client",category:"Auth",repo_path:"src/components/auth/useFormattedDate.ts",example_path:"docs/static-docs/components/useFormattedDate.md"},{name:"useStableRandom",description:"Hook for generating stable random values",category:"Auth",repo_path:"src/components/auth/useStableRandom.ts",example_path:"docs/static-docs/components/useStableRandom.md"},{name:"useExternalData",description:"Hook for safely handling external data to prevent hydration mismatches",category:"Auth",repo_path:"src/components/auth/useExternalData.ts",example_path:"docs/static-docs/components/useExternalData.md"},{name:"PermissionWrapper",description:"Component that conditionally renders children based on user permissions using role-based access control",category:"Auth",repo_path:"src/components/auth/PermissionWrapper.tsx",example_path:"docs/static-docs/components/PermissionWrapper.md"},{name:"ChannelListAvatar",description:"Channel list avatar component",category:"Navbar",repo_path:"src/components/navbar/ChannelListAvatar.tsx",example_path:"docs/static-docs/components/ChannelListAvatar.md"},{name:"MenuDropdown",description:"Menu dropdown component",category:"Navbar",repo_path:"src/components/navbar/MenuDropdown.tsx",example_path:"docs/static-docs/components/MenuDropdown.md"},{name:"Breadcrumb",description:"Breadcrumb component",category:"Navbar",repo_path:"src/components/navbar/Breadcrumb.tsx",example_path:"docs/static-docs/components/Breadcrumb.md"},{name:"ResponsiveNavbar",description:"Responsive navbar component",category:"Navbar",repo_path:"src/components/navbar/ResponsiveNavbar.tsx",example_path:"docs/static-docs/components/ResponsiveNavbar.md"},{name:"SideNavbar",description:"Side navbar component",category:"Navbar",repo_path:"src/components/navbar/SideNavbar.tsx",example_path:"docs/static-docs/components/SideNavbar.md",visual_demo_url:"/components/navbars/sidenav"},{name:"SideNavbarContext",description:"Context provider for side navigation state management",category:"Navbar",repo_path:"src/components/navbar/SideNavbarContext.tsx",example_path:"docs/static-docs/components/SideNavbarContext.md"},{name:"CustomTextEditor",description:"Custom text editor component",category:"UI",repo_path:"src/components/ui/editor/CustomTextEditor.tsx",example_path:"docs/static-docs/components/CustomTextEditor.md"},{name:"IHubTextEditor",description:"Notion-style rich text editor: slash commands, flexible tables (row/column handles, add, move, duplicate, colour), image/video/audio/PDF/file uploads, embeds, section banners, callouts, toggles, CTA buttons, and rich HTML that keeps its inline styles",category:"UI",repo_path:"src/components/ui/editor/ihub-editor/IHubTextEditor.tsx",example_path:"docs/static-docs/components/IHubTextEditor.md",visual_demo_url:"/components/ui/ihub-text-editor"},{name:"ContentViewer",description:"Content viewer component",category:"UI",repo_path:"src/components/ui/viewer/ContentViewer.tsx",example_path:"docs/static-docs/components/ContentViewer.md",visual_demo_url:"/components/ui/content-viewer"},{name:"ContentViewOrEdit",description:"Content view or edit component",category:"UI",repo_path:"src/components/ui/viewer/ContentViewOrEdit.tsx",example_path:"docs/static-docs/components/ContentViewOrEdit.md",visual_demo_url:"/components/ui/content-view-or-edit"},{name:"CodeDisplay",description:"Code display component",category:"UI",repo_path:"src/components/ui/viewer/CodeDisplay.tsx",example_path:"docs/static-docs/components/CodeDisplay.md"},{name:"DangerousRenderer",description:"Safe-by-default renderer for untrusted HTML/Markdown — DOMPurify sanitization, link hardening, DoS guards, and optional custom wrapper via children.",category:"UI",repo_path:"src/components/ui/viewer/DangerousRenderer.tsx",example_path:"docs/static-docs/components/DangerousRenderer.md",visual_demo_url:"/components/ui/dangerous-renderer"},{name:"IHubTable",description:"InstinctHub client-side table with search, sort, filter, pagination and CSV/Excel/PDF export",category:"UI",repo_path:"src/components/ui/tables/IHubTable.tsx",example_path:"docs/static-docs/components/IHubTable.md"},{name:"IHubTableServer",description:"InstinctHub server-side table with API pagination, search, sorting and full-dataset CSV/Excel/PDF export",category:"UI",repo_path:"src/components/ui/tables/IHubTableServer.tsx",example_path:"docs/static-docs/components/IHubTableServer.md",visual_demo_url:"/components/ui/table-server-examples"},{name:"OrDivider",description:"Or divider component",category:"UI",repo_path:"src/components/ui/OrDivider.tsx",example_path:"docs/static-docs/components/OrDivider.md",visual_demo_url:"/components/ui/or-divider"},{name:"Card",description:"Card component",category:"UI",repo_path:"src/components/ui/cards/Card.tsx",example_path:"docs/static-docs/components/Card.md"},{name:"CardList",description:"Card list component",category:"UI",repo_path:"src/components/ui/cards/CardList.tsx",example_path:"docs/static-docs/components/CardList.md",visual_demo_url:"/components/ui/card-list"},{name:"CardGrid",description:"Card grid component",category:"UI",repo_path:"src/components/ui/cards/CardGrid.tsx",example_path:"docs/static-docs/components/CardGrid.md",visual_demo_url:"/components/ui/card-grid"},{name:"HorizontalCard",description:"Horizontal card component",category:"UI",repo_path:"src/components/ui/cards/HorizontalCard.tsx",example_path:"docs/static-docs/components/HorizontalCard.md"},{name:"FeatureCard",description:"Feature card component",category:"UI",repo_path:"src/components/ui/cards/FeatureCard.tsx",example_path:"docs/static-docs/components/FeatureCard.md"},{name:"MediaCard",description:"Media card component",category:"UI",repo_path:"src/components/ui/cards/MediaCard.tsx",example_path:"docs/static-docs/components/MediaCard.md"},{name:"PricingCard",description:"Pricing card component",category:"UI",repo_path:"src/components/ui/cards/PricingCard.tsx",example_path:"docs/static-docs/components/PricingCard.md"},{name:"ProfileCard",description:"Profile card component",category:"UI",repo_path:"src/components/ui/cards/ProfileCard.tsx",example_path:"docs/static-docs/components/ProfileCard.md"},{name:"RandomGradientImage",description:"Random gradient image component",category:"UI",repo_path:"src/components/ui/images/RandomGradientImage.tsx",example_path:"docs/static-docs/components/RandomGradientImage.md",visual_demo_url:"/components/ui/random-gradient-image"},{name:"Dialog",description:"A reusable dialog component",category:"UI",repo_path:"src/components/ui/dialogs/Dialog.tsx",example_path:"docs/static-docs/components/Dialog.md"},{name:"Badge",description:"A reusable Badge component",category:"UI",repo_path:"src/components/ui/Badge.tsx",example_path:"docs/static-docs/components/Badge.md"},{name:"Action",description:"A reusable Action component",category:"UI",repo_path:"src/components/ui/Action.tsx",example_path:"docs/static-docs/components/Action.md"},{name:"Dropdown",description:"A reusable Dropdown component",category:"UI",repo_path:"src/components/ui/Dropdown.tsx",example_path:"docs/static-docs/components/Dropdown.md"},{name:"ColorPicker",description:"A reusable ColorPicker component",category:"UI",repo_path:"src/components/ui/ColorPicker.tsx",example_path:"docs/static-docs/components/ColorPicker.md"},{name:"Pagination",description:"A reusable Pagination component",category:"UI",repo_path:"src/components/ui/pagination/Pagination.tsx",example_path:"docs/static-docs/components/Pagination.md",visual_demo_url:"/components/ui/pagination"},{name:"PaginationDemo",description:"A demo for the Pagination component",category:"UI",repo_path:"src/components/ui/pagination/PaginationDemo.tsx",example_path:"docs/static-docs/components/PaginationDemo.md"},{name:"CreateButton",description:"A reusable CreateButton component",category:"UI",repo_path:"src/components/ui/create-button/CreateButton.tsx",example_path:"docs/static-docs/components/CreateButton.md"},{name:"CreateButtonExample",description:"An example of the CreateButton component",category:"UI",repo_path:"src/components/ui/create-button/CreateButtonExample.tsx",example_path:"docs/static-docs/components/CreateButtonExample.md"},{name:"MenuBar",description:"Toolbar component for the TipTap rich text editor",category:"UI",repo_path:"src/components/ui/editor/MenuBar.tsx",example_path:"docs/static-docs/components/MenuBar.md"},{name:"InstinctHubChart",description:"Versatile chart component supporting multiple chart types",category:"UI",repo_path:"src/components/ui/charts/InstinctHubChart.tsx",example_path:"docs/static-docs/components/InstinctHubChart.md"},{name:"InstinctHubChartDashboard",description:"Dashboard component showcasing multiple charts",category:"UI",repo_path:"src/components/ui/charts/InstinctHubChartDashboard.tsx",example_path:"docs/static-docs/components/InstinctHubChartDashboard.md"},{name:"ChartConfigurator",description:"Interactive chart configuration interface",category:"UI",repo_path:"src/components/ui/charts/ChartConfigurator.tsx",example_path:"docs/static-docs/components/ChartConfigurator.md"},{name:"ChangeStyleVariable",description:"Style variable changer component",category:"Theme",repo_path:"src/components/theme/ChangeStyleVariable.tsx",example_path:"docs/static-docs/components/ChangeStyleVariable.md"},{name:"DarkModeProvider",description:"Dark mode provider component",category:"Theme",repo_path:"src/components/theme/DarkModeProvider.tsx",example_path:"docs/static-docs/components/DarkModeProvider.md"},{name:"LoadingAnimate",description:"Loading animation component",category:"Theme",repo_path:"src/components/theme/LoadingAnimate.tsx",example_path:"docs/static-docs/components/LoadingAnimate.md"},{name:"SessionProviders",description:"Session providers component",category:"Theme",repo_path:"src/components/theme/SessionProviders.tsx",example_path:"docs/static-docs/components/SessionProviders.md"},{name:"SessionExpiresLogout",description:"Session expiration logout component",category:"Theme",repo_path:"src/components/theme/signout/SessionExpiresLogout.tsx",example_path:"docs/static-docs/components/SessionExpiresLogout.md"},{name:"SignOutSession",description:"Sign out session component",category:"Theme",repo_path:"src/components/theme/signout/SignOutSession.tsx",example_path:"docs/static-docs/components/SignOutSession.md"},{name:"TimeTracker",description:"Time tracking component",category:"Status",repo_path:"src/components/status/ReactTimeTracker.tsx",example_path:"docs/static-docs/components/TimeTracker.md"},{name:"SessionHandleProvider",description:"Session handling provider component",category:"Status",repo_path:"src/components/status/SessionHandleProvider.tsx",example_path:"docs/static-docs/components/SessionHandleProvider.md"},{name:"Error500",description:"500 error display component",category:"Status",repo_path:"src/components/status/Error500.tsx",example_path:"docs/static-docs/components/Error500.md"},{name:"ErrorState",description:"Error state display component",category:"Status",repo_path:"src/components/status/ErrorState.tsx",example_path:"docs/static-docs/components/ErrorState.md"},{name:"ReactTimeTracker",description:"React time tracking component",category:"Status",repo_path:"src/components/status/ReactTimeTracker.tsx",example_path:"docs/static-docs/components/ReactTimeTracker.md"},{name:"DeleteConfirmationModal",description:"Delete confirmation modal component",category:"Status",repo_path:"src/components/status/DeleteConfirmationModal.tsx",example_path:"docs/static-docs/components/DeleteConfirmationModal.md"},{name:"CopyToClipboard",description:"Copy to clipboard functionality component",category:"Status",repo_path:"src/components/status/CopyToClipBoard.tsx",example_path:"docs/static-docs/components/CopyToClipboard.md"},{name:"MultiPurposeModal",description:"Multi-purpose modal component",category:"Status",repo_path:"src/components/status/MultiPurposeModal.tsx",example_path:"docs/static-docs/components/MultiPurposeModal.md"},{name:"ModalExamples",description:"Modal examples component",category:"Status",repo_path:"src/components/status/ModalExamples.tsx",example_path:"docs/static-docs/components/ModalExamples.md"},{name:"NotFound",description:"Not found component",category:"Status",repo_path:"src/components/status/NotFound.tsx",example_path:"docs/static-docs/components/NotFound.md"},{name:"Unauthorized",description:"Unauthorized component",category:"Status",repo_path:"src/components/status/Unauthorized.tsx",example_path:"docs/static-docs/components/Unauthorized.md"},{name:"ModalWrapper",description:"ModalWrapper component",category:"Status",repo_path:"src/components/status/ModalWrapper.tsx",example_path:"docs/static-docs/components/ModalWrapper.md"},{name:"Tabs",description:"Tab navigation component",category:"Tabs",repo_path:"src/components/tabs/Tabs.tsx",example_path:"docs/static-docs/components/Tabs.md"},{name:"VerticalTabs",description:"Vertical tab navigation component",category:"Tabs",repo_path:"src/components/tabs/VerticalTabs.tsx",example_path:"docs/static-docs/components/VerticalTabs.md"},{name:"TabContent",description:"Tab content display component",category:"Tabs",repo_path:"src/components/tabs/TabContent.tsx",example_path:"docs/static-docs/components/TabContent.md"},{name:"Cursor",description:"Custom cursor component with trailing effects and animations",category:"Cursors",repo_path:"src/components/cursors/Cursor.tsx",example_path:"docs/static-docs/components/Cursor.md"},{name:"MagneticButton",description:"Button component with magnetic cursor attraction effect",category:"Cursors",repo_path:"src/components/cursors/MagneticButton.tsx",example_path:"docs/static-docs/components/MagneticButton.md"},{name:"CursorContext",description:"Context provider for cursor state management across the application",category:"Cursors",repo_path:"src/components/cursors/CursorContext.tsx",example_path:"docs/static-docs/components/CursorContext.md"},{name:"useCursorInteraction",description:"Hook for adding interactive cursor effects to elements",category:"Cursors",repo_path:"src/components/cursors/useCursorInteraction.tsx",example_path:"docs/static-docs/components/useCursorInteraction.md"},{name:"CursorControlDemo",description:"Comprehensive demo component for the cursor system",category:"Cursors",repo_path:"src/components/cursors/CursorControlDemo.tsx",example_path:"docs/static-docs/components/CursorControlDemo.md"},{name:"Paystack",description:"Paystack payment integration component",category:"Library",repo_path:"src/components/lib/readme/paystack.md",example_path:"docs/static-docs/components/Paystack.md"}],f=s.useMemo(function(){var o=Array.from(new Set(y.map(function(e){return e.category}))).sort();return[{id:"",title:"All Categories"}].concat(e.toConsumableArray(o.map(function(e){return{id:e,title:e}})))},[y]),C=s.useMemo(function(){var e=y;if(u&&(e=e.filter(function(e){return e.category===u})),i.trim()){var o=i.toLowerCase();e=e.filter(function(e){return e.name.toLowerCase().includes(o)||e.description.toLowerCase().includes(o)||e.category.toLowerCase().includes(o)})}return e},[y,i,u]),v=s.useMemo(function(){return C.reduce(function(e,o){return e[o.category]||(e[o.category]=[]),e[o.category].push(o),e},{})},[C]),F="https://github.com/instincthub/instincthub-react-ui/blob/main/",T=s.useState(""),I=e.slicedToArray(T,2),S=I[0],D=I[1];s.useEffect(function(){D(window.location.origin)},[]);var k=function(){var o=e.asyncToGenerator(e.regenerator().m(function o(t,n){var s;return e.regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,navigator.clipboard.writeText(t);case 1:b("".concat(n,"-").concat(t)),setTimeout(function(){return b(null)},2e3),e.n=3;break;case 2:e.p=2,s=e.v,console.error("Failed to copy: ",s);case 3:return e.a(2)}},o,null,[[0,2]])}));return function(e,t){return o.apply(this,arguments)}}();return o.jsxs("div",{className:"ihub-component-lists",children:[o.jsx("h1",{className:"ihub-component-lists-title",children:"InstinctHub React UI Components"}),o.jsx("p",{className:"ihub-component-lists-description",children:"A comprehensive list of all available components in the InstinctHub React UI library."}),o.jsxs("div",{className:"ihub-search-container",children:[o.jsxs("div",{className:"ihub-flex ihub-gap-3 ihub-mb-3",children:[o.jsx("div",{style:{flex:1},children:o.jsx(r.default,{label:"Search",name:"search",placeholder:"Search components by name, description, or category...",value:i,onChange:function(e){return m(e.target.value)},activeLabel:!0})}),o.jsx("div",{className:"ihub-mt-1 ihub-pl-3",children:o.jsx(a.default,{options:f,defaultValue:u||"",name:"category",setValue:function(e){return h(String(e.id))},defaultWidth:"200px"})})]}),(i||u)&&o.jsxs("div",{className:"ihub-search-results-info",children:["Found ",C.length," component",1!==C.length?"s":"",i&&' matching "'.concat(i,'"'),u&&' in category "'.concat(u,'"'),(i||u)&&o.jsx("button",{onClick:function(){m(""),h("")},style:{marginLeft:"10px",padding:"4px 8px",backgroundColor:"#f5f5f5",border:"1px solid #ddd",borderRadius:"4px",fontSize:"12px",cursor:"pointer"},children:"Clear Filters"})]})]}),Object.entries(v).map(function(s){var a=e.slicedToArray(s,2),r=a[0],c=a[1];return o.jsxs("div",{className:"ihub-component-category",children:[o.jsx("h2",{className:"ihub-component-category-title",children:r}),o.jsx("div",{className:"ihub-component-grid",children:c.map(function(e){return o.jsxs("div",{className:"ihub-component-card",children:[o.jsx("h3",{className:"ihub-component-name",children:e.name}),o.jsx("p",{className:"ihub-component-description",children:e.description}),o.jsxs("div",{className:"ihub-component-links",children:[o.jsxs("div",{className:"ihub-link-group ihub-flex",children:[o.jsx("a",{href:"".concat(F).concat(e.repo_path),target:"_blank",rel:"noopener noreferrer",className:"ihub-component-link",children:"Repository"}),o.jsx("button",{onClick:function(){return k("".concat(F).concat(e.repo_path),"repo")},className:"ihub-copy-btn",title:"Copy ".concat(e.name," repository link"),children:g==="repo-".concat(F).concat(e.repo_path)?o.jsx(t.default,{}):o.jsx(n.default,{})})]}),o.jsxs("div",{className:"ihub-link-group ihub-flex ihub-mt-2",children:[o.jsx("a",{href:"".concat(F).concat(e.example_path),target:"_blank",rel:"noopener noreferrer",className:"ihub-component-link",children:"Example"}),o.jsx("button",{onClick:function(){return k("".concat(F).concat(e.example_path),"example")},className:"ihub-copy-btn",title:"Copy ".concat(e.name," example link"),children:g==="example-".concat(F).concat(e.example_path)?o.jsx(t.default,{}):o.jsx(n.default,{})})]}),e.visual_demo_url&&o.jsxs("div",{className:"ihub-link-group ihub-flex ihub-mt-2",children:[o.jsx("a",{href:e.visual_demo_url,target:"_blank",rel:"noopener noreferrer",className:"ihub-component-link ihub-demo-link",children:"Live Demo"}),o.jsx("button",{onClick:function(){return k(S+e.visual_demo_url,"demo")},className:"ihub-copy-btn",title:"Copy ".concat(e.name,"live demo link"),children:g==="demo-".concat(S).concat(e.visual_demo_url)?o.jsx(t.default,{}):o.jsx(n.default,{})})]})]})]},e.name)})})]},r)}),0===Object.keys(v).length&&(i||u)&&o.jsxs("div",{className:"ihub-no-results",children:[o.jsxs("p",{children:["No components found",i&&' matching "'.concat(i,'"'),u&&' in category "'.concat(u,'"')]}),o.jsx("button",{onClick:function(){m(""),h("")},className:"ihub-clear-search-btn",children:"Clear Filters"})]})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.cjs"),o=require("react/jsx-runtime"),t=require("../../../node_modules/.pnpm/lucide-react@0.525.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/check.cjs"),n=require("../../../node_modules/.pnpm/lucide-react@0.525.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/copy.cjs"),s=require("react"),a=require("../forms/FilterObjects.cjs"),r=require("../forms/InputText.cjs");exports.default=function(){var c=s.useState(""),p=e.slicedToArray(c,2),i=p[0],m=p[1],d=s.useState(""),l=e.slicedToArray(d,2),u=l[0],h=l[1],x=s.useState(null),_=e.slicedToArray(x,2),g=_[0],b=_[1],y=[{name:"FormComponent",description:"Reusable form component for user input",category:"Forms",repo_path:"src/components/forms",example_path:"docs/static-docs/examples/FormComponent.md",visual_demo_url:"/components/auth/signup-form"},{name:"ActionDropdown",description:"Dropdown component for actions",category:"Forms",repo_path:"src/components/forms/ActionDropdown.tsx",example_path:"docs/static-docs/components/ActionDropdown.md",visual_demo_url:"/components/forms/action-dropdown"},{name:"AnimatedBox",description:"Animated container component",category:"Forms",repo_path:"src/components/forms/AnimatedBox.tsx",example_path:"docs/static-docs/components/AnimatedBox.md",visual_demo_url:"/components/forms/animated-box"},{name:"PasswordField",description:"Secure password input field",category:"Forms",repo_path:"src/components/forms/PasswordField.tsx",example_path:"docs/static-docs/components/PasswordField.md",visual_demo_url:"/components/forms/password-field"},{name:"DateInput",description:"Date selection input field",category:"Forms",repo_path:"src/components/forms/DateInput.tsx",example_path:"docs/static-docs/components/DateInput.md",visual_demo_url:"/components/forms/date-input"},{name:"DateTimeInput",description:"Date and time selection input field",category:"Forms",repo_path:"src/components/forms/DateTimeInput.tsx",example_path:"docs/static-docs/components/DateTimeInput.md"},{name:"DateTimePicker",description:"Modern date and time picker with calendar popup",category:"Forms",repo_path:"src/components/forms/DateTimePicker.tsx",example_path:"docs/static-docs/components/DateTimePicker.md",visual_demo_url:"/components/forms/time-picker"},{name:"DateRangePicker",description:"Date range picker with two-click selection, hover preview, and quick presets",category:"Forms",repo_path:"src/components/forms/DateRangePicker.tsx",example_path:"docs/static-docs/components/DateRangePicker.md",visual_demo_url:"/components/forms/date-range-picker"},{name:"DropFile",description:"File drag and drop component",category:"Forms",repo_path:"src/components/forms/DropFile.tsx",example_path:"docs/static-docs/components/DropFile.md",visual_demo_url:"/components/forms/drop-file"},{name:"EmailList",description:"Email list display component",category:"Forms",repo_path:"src/components/forms/EmailList.tsx",example_path:"docs/static-docs/components/EmailList.md",visual_demo_url:"/components/forms/email-list"},{name:"FilterArray",description:"Array filtering component",category:"Forms",repo_path:"src/components/forms/FilterArray.tsx",example_path:"docs/static-docs/components/FilterArray.md",visual_demo_url:"/components/forms/filter-array"},{name:"FilterBy",description:"Filtering component with criteria",category:"Forms",repo_path:"src/components/forms/FilterBy.tsx",example_path:"docs/static-docs/components/FilterBy.md"},{name:"FilterObjects",description:"Object filtering component",category:"Forms",repo_path:"src/components/forms/FilterObjects.tsx",example_path:"docs/static-docs/components/FilterObjects.md",visual_demo_url:"/components/forms/filter-objects"},{name:"FormError",description:"Form error display component",category:"Forms",repo_path:"src/components/forms/FormError.tsx",example_path:"docs/static-docs/components/FormError.md"},{name:"HandleError",description:"Error handling component",category:"Forms",repo_path:"src/components/forms/HandleError.tsx",example_path:"docs/static-docs/components/HandleError.md"},{name:"Logout",description:"Logout functionality component",category:"Forms",repo_path:"src/components/forms/Logout.tsx",example_path:"docs/static-docs/components/Logout.md"},{name:"MessageDisplay",description:"Message display component",category:"Forms",repo_path:"src/components/forms/MessageDisplay.tsx",example_path:"docs/static-docs/components/MessageDisplay.md"},{name:"MultipleEmail",description:"Multiple email input component",category:"Forms",repo_path:"src/components/forms/MultipleEmail.tsx",example_path:"docs/static-docs/components/MultipleEmail.md",visual_demo_url:"/components/forms/multiple-email"},{name:"PageLoading",description:"Page loading indicator component",category:"Forms",repo_path:"src/components/forms/PageLoading.tsx",example_path:"docs/static-docs/components/PageLoading.md"},{name:"PhoneNumberInput",description:"Phone number input with searchable country picker, paste detection and E.164 output",category:"Forms",repo_path:"src/components/forms/PhoneNumberInput.tsx",example_path:"docs/static-docs/components/PhoneNumberInput.md",visual_demo_url:"/components/forms/phone-number-input"},{name:"RadioField",description:"Radio button input field",category:"Forms",repo_path:"src/components/forms/RadioField.tsx",example_path:"docs/static-docs/components/RadioField.md"},{name:"RadioSimple",description:"Simplified radio button component",category:"Forms",repo_path:"src/components/forms/RadioSimple.tsx",example_path:"docs/static-docs/components/RadioSimple.md"},{name:"ReactTimeAgo",description:"Time ago display component",category:"Forms",repo_path:"src/components/forms/ReactTimeAgo.tsx",example_path:"docs/static-docs/components/ReactTimeAgo.md"},{name:"ReadTermsAndCondition",description:"Terms and conditions acceptance component",category:"Forms",repo_path:"src/components/forms/ReadTermsAndCondition.tsx",example_path:"docs/static-docs/components/ReadTermsAndCondition.md"},{name:"SearchField",description:"Search input field component",category:"Forms",repo_path:"src/components/forms/SearchField.tsx",example_path:"docs/static-docs/components/SearchField.md",visual_demo_url:"/components/forms/search-field"},{name:"SearchFieldDB",description:"Database search field component",category:"Forms",repo_path:"src/components/forms/SearchFieldDB.tsx",example_path:"docs/static-docs/components/SearchFieldDB.md"},{name:"SearchableDropdown",description:"API-powered searchable dropdown with debounced search, selection, and clear",category:"Forms",repo_path:"src/components/forms/SearchableDropdown.tsx",example_path:"docs/static-docs/components/SearchableDropdown.md",visual_demo_url:"/components/forms/searchable-dropdown"},{name:"StepProgressBar",description:"Step progress indicator component",category:"Forms",repo_path:"src/components/forms/StepProgressBar.tsx",example_path:"docs/static-docs/components/StepProgressBar.md"},{name:"SubmitButton",description:"Form submission button component",category:"Forms",repo_path:"src/components/forms/SubmitButton.tsx",example_path:"docs/static-docs/components/SubmitButton.md",visual_demo_url:"/components/forms/submit-button"},{name:"Tables",description:"Table display component",category:"Forms",repo_path:"src/components/forms/Tables.tsx",example_path:"docs/static-docs/components/Tables.md"},{name:"TextArea",description:"Multi-line text input component",category:"Forms",repo_path:"src/components/forms/TextArea.tsx",example_path:"docs/static-docs/components/TextArea.md"},{name:"TextField",description:"Text input field component",category:"Forms",repo_path:"src/components/forms/TextField.tsx",example_path:"docs/static-docs/components/TextField.md"},{name:"Tooltip",description:"Tooltip display component",category:"Forms",repo_path:"src/components/forms/Tooltip.tsx",example_path:"docs/static-docs/components/Tooltip.md"},{name:"UnsplashRandomImage",description:"Random image from Unsplash component",category:"Forms",repo_path:"src/components/forms/UnsplashRandomImage.tsx",example_path:"docs/static-docs/components/UnsplashRandomImage.md"},{name:"DownloadAsExcel",description:"Excel download functionality component",category:"Forms",repo_path:"src/components/forms/DownloadAsExcel.tsx",example_path:"docs/static-docs/components/DownloadAsExcel.md"},{name:"THeadSortBtn",description:"Table header sort button component",category:"Forms",repo_path:"src/components/forms/THeadSortBtn.tsx",example_path:"docs/static-docs/components/THeadSortBtn.md"},{name:"THeadSortList",description:"Table header sort list component",category:"Forms",repo_path:"src/components/forms/THeadSortList.tsx",example_path:"docs/static-docs/components/THeadSortList.md"},{name:"TBodyNoData",description:"Table body empty state component",category:"Forms",repo_path:"src/components/forms/TBodyNoData.tsx",example_path:"docs/static-docs/components/TBodyNoData.md"},{name:"FileUploader",description:"File upload component",category:"Forms",repo_path:"src/components/forms/uploads/FileUploader.tsx",example_path:"docs/static-docs/components/FileUploader.md",visual_demo_url:"/components/forms/file-uploader"},{name:"IhubFileUploader",description:"InstinctHub file upload component",category:"Forms",repo_path:"src/components/forms/uploads/IhubFileUploader.tsx",example_path:"docs/static-docs/components/IhubFileUploader.md"},{name:"S3MultiUploader",description:"Multi-file queue uploader with per-file progress bars and direct S3 multipart upload via @aws-sdk/lib-storage",category:"Forms",repo_path:"src/components/forms/uploads/S3MultiUploader.tsx",example_path:"docs/static-docs/components/S3MultiUploader.md",visual_demo_url:"/components/ui/s3-multi-uploader"},{name:"ActionCallbackDropdown",description:"Action callback dropdown component",category:"Forms",repo_path:"src/components/forms/ActionCallbackDropdown.tsx",example_path:"docs/static-docs/components/ActionCallbackDropdown.md"},{name:"InputNumber",description:"InputNumber component for numerical input",category:"Form",repo_path:"src/components/forms/InputNumber.tsx",example_path:"docs/static-docs/components/InputNumber.md",visual_demo_url:"/components/forms/input-number"},{name:"InputText",description:"InputText component for text input",category:"Form",repo_path:"src/components/forms/InputText.tsx",example_path:"docs/static-docs/components/InputText.md",visual_demo_url:"/components/forms/input-text"},{name:"InputTextarea",description:"InputTextarea component for text input",category:"Form",repo_path:"src/components/forms/InputTextarea.tsx",example_path:"docs/static-docs/components/InputTextarea.md",visual_demo_url:"/components/forms/input-textarea"},{name:"SearchObjectsFromDB",description:"SearchObjectsFromDB component for searching objects from database",category:"Form",repo_path:"src/components/forms/SearchObjectsFromDB.tsx",example_path:"docs/static-docs/components/SearchObjectsFromDB.md"},{name:"ToggleButton",description:"ToggleButton component for changing state.",category:"Form",repo_path:"src/components/forms/ToggleButton.tsx",example_path:"docs/static-docs/components/ToggleButton.md"},{name:"DateInputPicker",description:"DateInputPicker component for picking date and time.",category:"Form",repo_path:"src/components/forms/DateInputPicker.tsx",example_path:"docs/static-docs/components/DateInputPicker.md"},{name:"TimePicker",description:"TimePicker component for selecting time with 12/24-hour format support.",category:"Form",repo_path:"src/components/forms/TimePicker.tsx",example_path:"docs/static-docs/components/TimePicker.md"},{name:"ChipsInput",description:"ChipsInput is used to enter multiple values on an input field.",category:"Form",repo_path:"src/components/forms/ChipsInput.tsx",example_path:"docs/static-docs/components/ChipsInput.md"},{name:"RadioButton",description:"RadioButton is used to enter single value on an input field.",category:"Form",repo_path:"src/components/forms/radio-btn/RadioButton.tsx",example_path:"docs/static-docs/components/RadioButton.md"},{name:"RadioGroup",description:"RadioGroup is used to select each from group value on an input field.",category:"Form",repo_path:"src/components/forms/radio-btn/RadioGroup.tsx",example_path:"docs/static-docs/components/RadioGroup.md"},{name:"InputAmount",description:"InputAmount is used to enter amount on an input field.",category:"Form",repo_path:"src/components/forms/InputAmount.tsx",example_path:"docs/static-docs/components/InputAmount.md"},{name:"CheckBoxes",description:"CheckBoxes is used to enter multiple values on an input field.",category:"Form",repo_path:"src/components/forms/CheckBoxes.tsx",example_path:"docs/static-docs/components/CheckBoxes.md"},{name:"CheckBoxesField",description:"CheckBoxesField is used to enter multiple values on an input field.",category:"Form",repo_path:"src/components/forms/CheckboxesField.tsx",example_path:"docs/static-docs/components/CheckBoxesField.md"},{name:"CountryInput",description:"Searchable country selector input field",category:"Form",repo_path:"src/components/forms/CountryInput.tsx",example_path:"docs/static-docs/components/CountryInput.md"},{name:"CountryStateInput",description:"Searchable state/province selector based on selected country",category:"Form",repo_path:"src/components/forms/CountryStateInput.tsx",example_path:"docs/static-docs/components/CountryStateInput.md"},{name:"InputSearchDropdown",description:"Generic searchable dropdown component for organizations",category:"Form",repo_path:"src/components/forms/InputSearchDropdown.tsx",example_path:"docs/static-docs/components/InputSearchDropdown.md"},{name:"RangeRadio",description:"Range radio button component for selecting values within a range",category:"Form",repo_path:"src/components/forms/RangeRadio.tsx",example_path:"docs/static-docs/components/RangeRadio.md"},{name:"IsUsernameEmailTaken",description:"Username/email availability checker",category:"Auth",repo_path:"src/components/auth/IsUsernameEmailTaken.tsx",example_path:"docs/static-docs/components/IsUsernameEmailTaken.md",visual_demo_url:"/components/auth/username-email-checker"},{name:"ClientDetector",description:"Client device detection component",category:"Auth",repo_path:"src/components/auth/ClientDetector.tsx",example_path:"docs/static-docs/components/ClientDetector.md",visual_demo_url:"/components/auth/client-detector"},{name:"PasswordsMatch",description:"Password matching validation component",category:"Auth",repo_path:"src/components/auth/PasswordsMatch.tsx",example_path:"docs/static-docs/components/PasswordsMatch.md"},{name:"FromInstinctHub",description:"From InstinctHub component",category:"Auth",repo_path:"src/components/auth/FromInstinctHub.tsx",example_path:"docs/static-docs/components/FromInstinctHub.md"},{name:"LoginForm",description:"Login form component",category:"Auth",repo_path:"src/components/auth/LoginForm.tsx",example_path:"docs/static-docs/components/LoginForm.md",visual_demo_url:"/components/auth/login-form"},{name:"SignUpForm",description:"Sign up form component",category:"Auth",repo_path:"src/__examples__/src/components/forms/SignUpFormExample.tsx",example_path:"docs/static-docs/components/SignUpForm.md",visual_demo_url:"/components/auth/signup-form"},{name:"ReactClientProviders",description:"Comprehensive wrapper providing all essential React providers",category:"Auth",repo_path:"src/components/auth/ReactClientProviders.tsx",example_path:"docs/static-docs/components/ReactClientProviders.md"},{name:"ClientOnly",description:"Wrapper component that only renders children on client side",category:"Auth",repo_path:"src/components/auth/ClientOnly.tsx",example_path:"docs/static-docs/components/ClientOnly.md"},{name:"useClientSide",description:"Hook for safely handling client-side initialization",category:"Auth",repo_path:"src/components/auth/useClientSide.ts",example_path:"docs/static-docs/components/useClientSide.md"},{name:"useFormattedDate",description:"Hook for consistent date formatting between server and client",category:"Auth",repo_path:"src/components/auth/useFormattedDate.ts",example_path:"docs/static-docs/components/useFormattedDate.md"},{name:"useStableRandom",description:"Hook for generating stable random values",category:"Auth",repo_path:"src/components/auth/useStableRandom.ts",example_path:"docs/static-docs/components/useStableRandom.md"},{name:"useExternalData",description:"Hook for safely handling external data to prevent hydration mismatches",category:"Auth",repo_path:"src/components/auth/useExternalData.ts",example_path:"docs/static-docs/components/useExternalData.md"},{name:"PermissionWrapper",description:"Component that conditionally renders children based on user permissions using role-based access control",category:"Auth",repo_path:"src/components/auth/PermissionWrapper.tsx",example_path:"docs/static-docs/components/PermissionWrapper.md"},{name:"ChannelListAvatar",description:"Channel list avatar component",category:"Navbar",repo_path:"src/components/navbar/ChannelListAvatar.tsx",example_path:"docs/static-docs/components/ChannelListAvatar.md"},{name:"MenuDropdown",description:"Menu dropdown component",category:"Navbar",repo_path:"src/components/navbar/MenuDropdown.tsx",example_path:"docs/static-docs/components/MenuDropdown.md"},{name:"Breadcrumb",description:"Breadcrumb component",category:"Navbar",repo_path:"src/components/navbar/Breadcrumb.tsx",example_path:"docs/static-docs/components/Breadcrumb.md"},{name:"ResponsiveNavbar",description:"Responsive navbar component",category:"Navbar",repo_path:"src/components/navbar/ResponsiveNavbar.tsx",example_path:"docs/static-docs/components/ResponsiveNavbar.md"},{name:"SideNavbar",description:"Side navbar component",category:"Navbar",repo_path:"src/components/navbar/SideNavbar.tsx",example_path:"docs/static-docs/components/SideNavbar.md",visual_demo_url:"/components/navbars/sidenav"},{name:"SideNavbarContext",description:"Context provider for side navigation state management",category:"Navbar",repo_path:"src/components/navbar/SideNavbarContext.tsx",example_path:"docs/static-docs/components/SideNavbarContext.md"},{name:"CustomTextEditor",description:"Custom text editor component",category:"UI",repo_path:"src/components/ui/editor/CustomTextEditor.tsx",example_path:"docs/static-docs/components/CustomTextEditor.md"},{name:"IHubTextEditor",description:"Notion-style rich text editor: slash commands, flexible tables (row/column handles, add, move, duplicate, colour), image/video/audio/PDF/file uploads, embeds, section banners, callouts, toggles, CTA buttons, and rich HTML that keeps its inline styles",category:"UI",repo_path:"src/components/ui/editor/ihub-editor/IHubTextEditor.tsx",example_path:"docs/static-docs/components/IHubTextEditor.md",visual_demo_url:"/components/ui/ihub-text-editor"},{name:"ContentViewer",description:"Content viewer component",category:"UI",repo_path:"src/components/ui/viewer/ContentViewer.tsx",example_path:"docs/static-docs/components/ContentViewer.md",visual_demo_url:"/components/ui/content-viewer"},{name:"ContentViewOrEdit",description:"Content view or edit component",category:"UI",repo_path:"src/components/ui/viewer/ContentViewOrEdit.tsx",example_path:"docs/static-docs/components/ContentViewOrEdit.md",visual_demo_url:"/components/ui/content-view-or-edit"},{name:"CodeDisplay",description:"Code display component",category:"UI",repo_path:"src/components/ui/viewer/CodeDisplay.tsx",example_path:"docs/static-docs/components/CodeDisplay.md"},{name:"DangerousRenderer",description:"Safe-by-default renderer for untrusted HTML/Markdown — DOMPurify sanitization, link hardening, DoS guards, and optional custom wrapper via children.",category:"UI",repo_path:"src/components/ui/viewer/DangerousRenderer.tsx",example_path:"docs/static-docs/components/DangerousRenderer.md",visual_demo_url:"/components/ui/dangerous-renderer"},{name:"IHubTable",description:"InstinctHub client-side table with search, sort, filter, pagination and CSV/Excel/PDF export",category:"UI",repo_path:"src/components/ui/tables/IHubTable.tsx",example_path:"docs/static-docs/components/IHubTable.md"},{name:"IHubTableServer",description:"InstinctHub server-side table with API pagination, search, sorting and full-dataset CSV/Excel/PDF export",category:"UI",repo_path:"src/components/ui/tables/IHubTableServer.tsx",example_path:"docs/static-docs/components/IHubTableServer.md",visual_demo_url:"/components/ui/table-server-examples"},{name:"OrDivider",description:"Or divider component",category:"UI",repo_path:"src/components/ui/OrDivider.tsx",example_path:"docs/static-docs/components/OrDivider.md",visual_demo_url:"/components/ui/or-divider"},{name:"Card",description:"Card component",category:"UI",repo_path:"src/components/ui/cards/Card.tsx",example_path:"docs/static-docs/components/Card.md"},{name:"CardList",description:"Card list component",category:"UI",repo_path:"src/components/ui/cards/CardList.tsx",example_path:"docs/static-docs/components/CardList.md",visual_demo_url:"/components/ui/card-list"},{name:"CardGrid",description:"Card grid component",category:"UI",repo_path:"src/components/ui/cards/CardGrid.tsx",example_path:"docs/static-docs/components/CardGrid.md",visual_demo_url:"/components/ui/card-grid"},{name:"HorizontalCard",description:"Horizontal card component",category:"UI",repo_path:"src/components/ui/cards/HorizontalCard.tsx",example_path:"docs/static-docs/components/HorizontalCard.md"},{name:"FeatureCard",description:"Feature card component",category:"UI",repo_path:"src/components/ui/cards/FeatureCard.tsx",example_path:"docs/static-docs/components/FeatureCard.md"},{name:"MediaCard",description:"Media card component",category:"UI",repo_path:"src/components/ui/cards/MediaCard.tsx",example_path:"docs/static-docs/components/MediaCard.md"},{name:"PricingCard",description:"Pricing card component",category:"UI",repo_path:"src/components/ui/cards/PricingCard.tsx",example_path:"docs/static-docs/components/PricingCard.md"},{name:"ProfileCard",description:"Profile card component",category:"UI",repo_path:"src/components/ui/cards/ProfileCard.tsx",example_path:"docs/static-docs/components/ProfileCard.md"},{name:"RandomGradientImage",description:"Random gradient image component",category:"UI",repo_path:"src/components/ui/images/RandomGradientImage.tsx",example_path:"docs/static-docs/components/RandomGradientImage.md",visual_demo_url:"/components/ui/random-gradient-image"},{name:"Dialog",description:"A reusable dialog component",category:"UI",repo_path:"src/components/ui/dialogs/Dialog.tsx",example_path:"docs/static-docs/components/Dialog.md"},{name:"Badge",description:"A reusable Badge component",category:"UI",repo_path:"src/components/ui/Badge.tsx",example_path:"docs/static-docs/components/Badge.md"},{name:"Action",description:"A reusable Action component",category:"UI",repo_path:"src/components/ui/Action.tsx",example_path:"docs/static-docs/components/Action.md"},{name:"Dropdown",description:"A reusable Dropdown component",category:"UI",repo_path:"src/components/ui/Dropdown.tsx",example_path:"docs/static-docs/components/Dropdown.md"},{name:"ColorPicker",description:"A reusable ColorPicker component",category:"UI",repo_path:"src/components/ui/ColorPicker.tsx",example_path:"docs/static-docs/components/ColorPicker.md"},{name:"Pagination",description:"A reusable Pagination component",category:"UI",repo_path:"src/components/ui/pagination/Pagination.tsx",example_path:"docs/static-docs/components/Pagination.md",visual_demo_url:"/components/ui/pagination"},{name:"PaginationDemo",description:"A demo for the Pagination component",category:"UI",repo_path:"src/components/ui/pagination/PaginationDemo.tsx",example_path:"docs/static-docs/components/PaginationDemo.md"},{name:"CreateButton",description:"A reusable CreateButton component",category:"UI",repo_path:"src/components/ui/create-button/CreateButton.tsx",example_path:"docs/static-docs/components/CreateButton.md"},{name:"CreateButtonExample",description:"An example of the CreateButton component",category:"UI",repo_path:"src/components/ui/create-button/CreateButtonExample.tsx",example_path:"docs/static-docs/components/CreateButtonExample.md"},{name:"MenuBar",description:"Toolbar component for the TipTap rich text editor",category:"UI",repo_path:"src/components/ui/editor/MenuBar.tsx",example_path:"docs/static-docs/components/MenuBar.md"},{name:"InstinctHubChart",description:"Versatile chart component supporting multiple chart types",category:"UI",repo_path:"src/components/ui/charts/InstinctHubChart.tsx",example_path:"docs/static-docs/components/InstinctHubChart.md"},{name:"InstinctHubChartDashboard",description:"Dashboard component showcasing multiple charts",category:"UI",repo_path:"src/components/ui/charts/InstinctHubChartDashboard.tsx",example_path:"docs/static-docs/components/InstinctHubChartDashboard.md"},{name:"ChartConfigurator",description:"Interactive chart configuration interface",category:"UI",repo_path:"src/components/ui/charts/ChartConfigurator.tsx",example_path:"docs/static-docs/components/ChartConfigurator.md"},{name:"ChangeStyleVariable",description:"Style variable changer component",category:"Theme",repo_path:"src/components/theme/ChangeStyleVariable.tsx",example_path:"docs/static-docs/components/ChangeStyleVariable.md"},{name:"DarkModeProvider",description:"Dark mode provider component",category:"Theme",repo_path:"src/components/theme/DarkModeProvider.tsx",example_path:"docs/static-docs/components/DarkModeProvider.md"},{name:"LoadingAnimate",description:"Loading animation component",category:"Theme",repo_path:"src/components/theme/LoadingAnimate.tsx",example_path:"docs/static-docs/components/LoadingAnimate.md"},{name:"SessionProviders",description:"Session providers component",category:"Theme",repo_path:"src/components/theme/SessionProviders.tsx",example_path:"docs/static-docs/components/SessionProviders.md"},{name:"SessionExpiresLogout",description:"Session expiration logout component",category:"Theme",repo_path:"src/components/theme/signout/SessionExpiresLogout.tsx",example_path:"docs/static-docs/components/SessionExpiresLogout.md"},{name:"SignOutSession",description:"Sign out session component",category:"Theme",repo_path:"src/components/theme/signout/SignOutSession.tsx",example_path:"docs/static-docs/components/SignOutSession.md"},{name:"TimeTracker",description:"Time tracking component",category:"Status",repo_path:"src/components/status/ReactTimeTracker.tsx",example_path:"docs/static-docs/components/TimeTracker.md"},{name:"SessionHandleProvider",description:"Session handling provider component",category:"Status",repo_path:"src/components/status/SessionHandleProvider.tsx",example_path:"docs/static-docs/components/SessionHandleProvider.md"},{name:"Error500",description:"500 error display component",category:"Status",repo_path:"src/components/status/Error500.tsx",example_path:"docs/static-docs/components/Error500.md"},{name:"ErrorState",description:"Error state display component",category:"Status",repo_path:"src/components/status/ErrorState.tsx",example_path:"docs/static-docs/components/ErrorState.md"},{name:"ReactTimeTracker",description:"React time tracking component",category:"Status",repo_path:"src/components/status/ReactTimeTracker.tsx",example_path:"docs/static-docs/components/ReactTimeTracker.md"},{name:"DeleteConfirmationModal",description:"Delete confirmation modal component",category:"Status",repo_path:"src/components/status/DeleteConfirmationModal.tsx",example_path:"docs/static-docs/components/DeleteConfirmationModal.md"},{name:"CopyToClipboard",description:"Copy to clipboard functionality component",category:"Status",repo_path:"src/components/status/CopyToClipBoard.tsx",example_path:"docs/static-docs/components/CopyToClipboard.md"},{name:"MultiPurposeModal",description:"Multi-purpose modal component",category:"Status",repo_path:"src/components/status/MultiPurposeModal.tsx",example_path:"docs/static-docs/components/MultiPurposeModal.md"},{name:"ModalExamples",description:"Modal examples component",category:"Status",repo_path:"src/components/status/ModalExamples.tsx",example_path:"docs/static-docs/components/ModalExamples.md"},{name:"NotFound",description:"Not found component",category:"Status",repo_path:"src/components/status/NotFound.tsx",example_path:"docs/static-docs/components/NotFound.md"},{name:"Unauthorized",description:"Unauthorized component",category:"Status",repo_path:"src/components/status/Unauthorized.tsx",example_path:"docs/static-docs/components/Unauthorized.md"},{name:"ModalWrapper",description:"ModalWrapper component",category:"Status",repo_path:"src/components/status/ModalWrapper.tsx",example_path:"docs/static-docs/components/ModalWrapper.md"},{name:"Tabs",description:"Tab navigation component",category:"Tabs",repo_path:"src/components/tabs/Tabs.tsx",example_path:"docs/static-docs/components/Tabs.md"},{name:"VerticalTabs",description:"Vertical tab navigation component",category:"Tabs",repo_path:"src/components/tabs/VerticalTabs.tsx",example_path:"docs/static-docs/components/VerticalTabs.md"},{name:"TabContent",description:"Tab content display component",category:"Tabs",repo_path:"src/components/tabs/TabContent.tsx",example_path:"docs/static-docs/components/TabContent.md"},{name:"Cursor",description:"Custom cursor component with trailing effects and animations",category:"Cursors",repo_path:"src/components/cursors/Cursor.tsx",example_path:"docs/static-docs/components/Cursor.md"},{name:"MagneticButton",description:"Button component with magnetic cursor attraction effect",category:"Cursors",repo_path:"src/components/cursors/MagneticButton.tsx",example_path:"docs/static-docs/components/MagneticButton.md"},{name:"CursorContext",description:"Context provider for cursor state management across the application",category:"Cursors",repo_path:"src/components/cursors/CursorContext.tsx",example_path:"docs/static-docs/components/CursorContext.md"},{name:"useCursorInteraction",description:"Hook for adding interactive cursor effects to elements",category:"Cursors",repo_path:"src/components/cursors/useCursorInteraction.tsx",example_path:"docs/static-docs/components/useCursorInteraction.md"},{name:"CursorControlDemo",description:"Comprehensive demo component for the cursor system",category:"Cursors",repo_path:"src/components/cursors/CursorControlDemo.tsx",example_path:"docs/static-docs/components/CursorControlDemo.md"},{name:"Paystack",description:"Paystack payment integration component",category:"Library",repo_path:"src/components/lib/readme/paystack.md",example_path:"docs/static-docs/components/Paystack.md"}],f=s.useMemo(function(){var o=Array.from(new Set(y.map(function(e){return e.category}))).sort();return[{id:"",title:"All Categories"}].concat(e.toConsumableArray(o.map(function(e){return{id:e,title:e}})))},[y]),C=s.useMemo(function(){var e=y;if(u&&(e=e.filter(function(e){return e.category===u})),i.trim()){var o=i.toLowerCase();e=e.filter(function(e){return e.name.toLowerCase().includes(o)||e.description.toLowerCase().includes(o)||e.category.toLowerCase().includes(o)})}return e},[y,i,u]),v=s.useMemo(function(){return C.reduce(function(e,o){return e[o.category]||(e[o.category]=[]),e[o.category].push(o),e},{})},[C]),F="https://github.com/instincthub/instincthub-react-ui/blob/main/",T=s.useState(""),I=e.slicedToArray(T,2),S=I[0],D=I[1];s.useEffect(function(){D(window.location.origin)},[]);var k=function(){var o=e.asyncToGenerator(e.regenerator().m(function o(t,n){var s;return e.regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,navigator.clipboard.writeText(t);case 1:b("".concat(n,"-").concat(t)),setTimeout(function(){return b(null)},2e3),e.n=3;break;case 2:e.p=2,s=e.v,console.error("Failed to copy: ",s);case 3:return e.a(2)}},o,null,[[0,2]])}));return function(e,t){return o.apply(this,arguments)}}();return o.jsxs("div",{className:"ihub-component-lists",children:[o.jsx("h1",{className:"ihub-component-lists-title",children:"InstinctHub React UI Components"}),o.jsx("p",{className:"ihub-component-lists-description",children:"A comprehensive list of all available components in the InstinctHub React UI library."}),o.jsxs("div",{className:"ihub-search-container",children:[o.jsxs("div",{className:"ihub-flex ihub-gap-3 ihub-mb-3",children:[o.jsx("div",{style:{flex:1},children:o.jsx(r.default,{label:"Search",name:"search",placeholder:"Search components by name, description, or category...",value:i,onChange:function(e){return m(e.target.value)},activeLabel:!0})}),o.jsx("div",{className:"ihub-mt-1 ihub-pl-3",children:o.jsx(a.default,{options:f,defaultValue:u||"",name:"category",setValue:function(e){return h(String(e.id))},defaultWidth:"200px"})})]}),(i||u)&&o.jsxs("div",{className:"ihub-search-results-info",children:["Found ",C.length," component",1!==C.length?"s":"",i&&' matching "'.concat(i,'"'),u&&' in category "'.concat(u,'"'),(i||u)&&o.jsx("button",{onClick:function(){m(""),h("")},style:{marginLeft:"10px",padding:"4px 8px",backgroundColor:"#f5f5f5",border:"1px solid #ddd",borderRadius:"4px",fontSize:"12px",cursor:"pointer"},children:"Clear Filters"})]})]}),Object.entries(v).map(function(s){var a=e.slicedToArray(s,2),r=a[0],c=a[1];return o.jsxs("div",{className:"ihub-component-category",children:[o.jsx("h2",{className:"ihub-component-category-title",children:r}),o.jsx("div",{className:"ihub-component-grid",children:c.map(function(e){return o.jsxs("div",{className:"ihub-component-card",children:[o.jsx("h3",{className:"ihub-component-name",children:e.name}),o.jsx("p",{className:"ihub-component-description",children:e.description}),o.jsxs("div",{className:"ihub-component-links",children:[o.jsxs("div",{className:"ihub-link-group ihub-flex",children:[o.jsx("a",{href:"".concat(F).concat(e.repo_path),target:"_blank",rel:"noopener noreferrer",className:"ihub-component-link",children:"Repository"}),o.jsx("button",{onClick:function(){return k("".concat(F).concat(e.repo_path),"repo")},className:"ihub-copy-btn",title:"Copy ".concat(e.name," repository link"),children:g==="repo-".concat(F).concat(e.repo_path)?o.jsx(t.default,{}):o.jsx(n.default,{})})]}),o.jsxs("div",{className:"ihub-link-group ihub-flex ihub-mt-2",children:[o.jsx("a",{href:"".concat(F).concat(e.example_path),target:"_blank",rel:"noopener noreferrer",className:"ihub-component-link",children:"Example"}),o.jsx("button",{onClick:function(){return k("".concat(F).concat(e.example_path),"example")},className:"ihub-copy-btn",title:"Copy ".concat(e.name," example link"),children:g==="example-".concat(F).concat(e.example_path)?o.jsx(t.default,{}):o.jsx(n.default,{})})]}),e.visual_demo_url&&o.jsxs("div",{className:"ihub-link-group ihub-flex ihub-mt-2",children:[o.jsx("a",{href:e.visual_demo_url,target:"_blank",rel:"noopener noreferrer",className:"ihub-component-link ihub-demo-link",children:"Live Demo"}),o.jsx("button",{onClick:function(){return k(S+e.visual_demo_url,"demo")},className:"ihub-copy-btn",title:"Copy ".concat(e.name,"live demo link"),children:g==="demo-".concat(S).concat(e.visual_demo_url)?o.jsx(t.default,{}):o.jsx(n.default,{})})]})]})]},e.name)})})]},r)}),0===Object.keys(v).length&&(i||u)&&o.jsxs("div",{className:"ihub-no-results",children:[o.jsxs("p",{children:["No components found",i&&' matching "'.concat(i,'"'),u&&' in category "'.concat(u,'"')]}),o.jsx("button",{onClick:function(){m(""),h("")},className:"ihub-clear-search-btn",children:"Clear Filters"})]})]})};
|
|
2
2
|
//# sourceMappingURL=ComponentLists.cjs.map
|