@instincthub/react-ui 0.1.50 → 0.1.51
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/node_modules/.pnpm/xlsx@https___cdn.sheetjs.com_xlsx-0.20.3_xlsx-0.20.3.tgz/node_modules/xlsx/xlsx.mjs.js +2 -2
- package/dist/node_modules/.pnpm/xlsx@https___cdn.sheetjs.com_xlsx-0.20.3_xlsx-0.20.3.tgz/node_modules/xlsx/xlsx.mjs.js.map +1 -1
- package/dist/src/assets/css/forms/input-fields.css +163 -11
- package/dist/src/components/auth/LoginForm.js +1 -1
- package/dist/src/components/auth/ReactClientProviders.js +1 -1
- package/dist/src/components/forms/ChipsInput.js +1 -1
- package/dist/src/components/forms/PhoneNumberInput.js +1 -1
- package/dist/src/components/forms/SearchFieldDB.js +1 -1
- package/dist/src/components/forms/SearchObjectsFromDB.js +1 -1
- package/dist/src/components/forms/SearchableDropdown.js +1 -1
- package/dist/src/components/forms/uploads/S3MultiUploader.js +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/phoneUtils.js +2 -0
- package/dist/src/components/lib/phoneUtils.js.map +1 -0
- package/dist/src/components/navbar/ChannelListAvatar.js +1 -1
- package/dist/src/components/navbar/SideNavbar.js +1 -1
- package/dist/src/components/status/ModalExamples.js +1 -1
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/components/ui/pagination/Pagination.js +1 -1
- package/dist/src/components/ui/pagination/PaginationDemo.js +1 -1
- package/dist/src/components/ui/tables/IHubTable.js +1 -1
- package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
- package/dist/src/components/ui/tables/utils/exportValues.js +2 -0
- package/dist/src/components/ui/tables/utils/exportValues.js.map +1 -0
- package/dist/src/components/ui/tables/utils/exportWriters.js +2 -0
- package/dist/src/components/ui/tables/utils/exportWriters.js.map +1 -0
- package/dist/src/components/ui/tables/utils/tableExport.js +2 -0
- package/dist/src/components/ui/tables/utils/tableExport.js.map +1 -0
- package/dist/src/types/__examples__/.next/types/app/components/forms/layout.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/forms/phone-number-input/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/layout.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/ui/s3-multi-uploader/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/layout.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/validator.d.ts +1 -0
- package/dist/src/types/__examples__/next.config.d.ts +3 -0
- package/dist/src/types/__examples__/src/app/api/auth/[...nextauth]/route.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/api/auth/login/route.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/api/components/docs/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/components/recommend/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/components/search/route.d.ts +50 -0
- package/dist/src/types/__examples__/src/app/api/fallback/route.d.ts +34 -0
- package/dist/src/types/__examples__/src/app/api/generate/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/help/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/mcp/route.d.ts +10 -0
- package/dist/src/types/__examples__/src/app/auth/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/auth/login/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/auth/password-match/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/code-display/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/code-display/page.d.ts +3 -0
- package/dist/src/types/__examples__/src/app/components/auth/client-detector/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/auth/login-form/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/components/auth/signup-form/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/auth/username-email-checker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/charts/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/action-dropdown/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/animated-box/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/checkboxes/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/chips-input/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/date-input/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/date-input-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/date-range-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/drop-file/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/email-list/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/file-uploader/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/filter-array/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/filter-objects/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/form-error/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-amount/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-number/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-text/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-textarea/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/components/forms/message-display/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/multiple-email/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/password-field/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/phone-number-input/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/radio-button/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/search-field/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/search-objects-from-db/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/searchable-dropdown/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/time-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/toggle-button/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/uploads/ihub-file-uploader/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/components/navbars/breadcrumb/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/navbars/responsive-navbar/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/components/navbars/sidenav/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/components/navbars/tabs/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/actions/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/badges/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/card-grid/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/card-list/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/cards/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/color-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/content-view-or-edit/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/content-viewer/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/create-button/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/dangerous-renderer/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/dialogs/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/dropdowns/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/ihub-text-editor/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/modals/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/or-divider/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/pagination/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/random-gradient-image/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/s3-multi-uploader/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/table-examples/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/table-server-examples/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/text-editor/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/cursors/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/examples/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/layout.d.ts +11 -0
- package/dist/src/types/__examples__/src/app/libs/examples/loadscript/page.d.ts +8 -0
- package/dist/src/types/__examples__/src/app/libs/examples/modals/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/libs/examples/paystacks/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/libs/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ComponentListing.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/Forms.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/Modals.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/TestComponent.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/TestPage.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/auth/ClientDetectorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/auth/IsUsernameEmailTakenExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/auth/LoginFormExample.d.ts +4 -0
- package/dist/src/types/__examples__/src/components/auth/SignUpFormExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/auths/LoginExample.d.ts +4 -0
- package/dist/src/types/__examples__/src/components/auths/PasswordsMatchExample.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/forms/ActionDropdownExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/AnimatedBoxExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/CheckboxesFieldExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/ChipsInputExample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/forms/DateInputExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DateInputPickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DateInputPickerTimeExample.d.ts +10 -0
- package/dist/src/types/__examples__/src/components/forms/DateRangePickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DateTimePickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DropFileExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/EmailListExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FileUploaderExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FilterArrayExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FilterObjectsExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FormErrorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputAmountExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputNumberExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputTextExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputTextareaExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/MessageDisplayExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/MultipleEmailExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/PasswordFieldExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/PhoneNumberInputExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/RadioButtonExample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/forms/SearchFieldExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/SearchObjectsFromDBExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/forms/SearchableDropdownExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/SignUpFormExample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/forms/SubmitBtnExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/TextFieldExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/TimePickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/ToggleButtonExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderDocs.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderSample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/navbars/BreadcrumbExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/navbars/CursorProviders.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/navbars/MainFooter.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/MainNavigation.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/PageNavigation.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarControlledExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarExample.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/SideNavbarExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/navbars/TabsExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/tabs/TabsDemo.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/tabs/TabsExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/tabs/VerticalTabsExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ActionExamples.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/ui/BadgeExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CardExamples.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/CardGridExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CardListExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ChartExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CodebaseLink.d.ts +4 -0
- package/dist/src/types/__examples__/src/components/ui/ColorPickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ContentFormTextEditor.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditSample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/ContentViewerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CreateButtonExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CustomTextEditorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/DangerousRendererExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/DialogExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/DropdownExamples.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/ui/IHubTextEditorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ListStylesDemo.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/ListStylesDemoTwo.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/OrDividerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/PaginationExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/RandomGradientImageExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/S3MultiUploaderExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/StatusIconExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/TableExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/TableServerExamples.d.ts +1 -0
- package/dist/src/types/__examples__/src/lib/api.d.ts +29 -0
- package/dist/src/types/__examples__/src/lib/hooks.d.ts +76 -0
- package/dist/src/types/__examples__/src/types/components.d.ts +144 -0
- package/dist/src/types/assets/svgs/SVGs.d.ts +36 -0
- package/dist/src/types/components/forms/PhoneNumberInput.d.ts +56 -13
- package/dist/src/types/components/forms/uploads/S3MultiUploader.d.ts +12 -6
- package/dist/src/types/components/lib/index.d.ts +1 -0
- package/dist/src/types/components/lib/phoneUtils.d.ts +99 -0
- package/dist/src/types/components/lib/redux/slices/channelSlice/channelDetails.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/channelSlice/instructorChannelList.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseDetails.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterDuration.d.ts +2 -2
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterLevel.d.ts +2 -2
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterSubject.d.ts +2 -2
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseModules.d.ts +3 -3
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseOverview.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseSearch.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/stepContent.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/stepQuestions.d.ts +6 -6
- package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestamp.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestampObject.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/navigationSlice/IPAdress.d.ts +1 -1
- package/dist/src/types/components/ui/tables/IHubTable.d.ts +5 -8
- package/dist/src/types/components/ui/tables/IHubTableServer.d.ts +5 -8
- package/dist/src/types/components/ui/tables/utils/exportValues.d.ts +32 -0
- package/dist/src/types/components/ui/tables/utils/exportWriters.d.ts +17 -0
- package/dist/src/types/components/ui/tables/utils/tableExport.d.ts +42 -0
- package/dist/src/types/index.d.ts +3 -1
- package/dist/src/types/types/index.d.ts +80 -15
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CardExamples(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ContentFormTextEditor(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ContentViewOrEditSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function DangerousRendererExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ListStylesDemo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ListStylesDemoTwo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ProgramCoursesPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentInfo, SearchResult, RecommendationResponse, CodeGenerationResponse, IntegrationHelpResponse, DocsResponse } from '../types/components';
|
|
2
|
+
export declare class ComponentAPI {
|
|
3
|
+
private baseURL;
|
|
4
|
+
constructor(baseURL?: string);
|
|
5
|
+
searchComponents(query: string, category?: string, limit?: number): Promise<SearchResult[]>;
|
|
6
|
+
getComponentDocs(componentName: string, includeExamples?: boolean, includeProps?: boolean): Promise<DocsResponse>;
|
|
7
|
+
getRecommendations(description: string, context?: string, complexity?: 'simple' | 'medium' | 'complex', framework?: string): Promise<RecommendationResponse>;
|
|
8
|
+
generateCode(components: string[], pattern?: string, framework?: string, typescript?: boolean, styling?: 'css' | 'tailwind' | 'styled-components'): Promise<CodeGenerationResponse>;
|
|
9
|
+
getIntegrationHelp(topic: string, framework?: string, version?: string): Promise<IntegrationHelpResponse>;
|
|
10
|
+
getAllComponents(): Promise<ComponentInfo[]>;
|
|
11
|
+
getComponentsByCategory(category: string): Promise<ComponentInfo[]>;
|
|
12
|
+
getCategories(): Promise<string[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare function debounce<T extends (...args: any[]) => void>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
15
|
+
export declare function highlightText(text: string, query: string): string;
|
|
16
|
+
export declare function formatComponentName(name: string): string;
|
|
17
|
+
export declare function getComponentIcon(component: ComponentInfo): string;
|
|
18
|
+
export declare function getCategoryColor(category: string): string;
|
|
19
|
+
export declare function generateComponentImport(component: ComponentInfo): string;
|
|
20
|
+
export declare function getImportPath(component: ComponentInfo): string;
|
|
21
|
+
export declare function copyToClipboard(text: string): Promise<void>;
|
|
22
|
+
export declare function downloadAsFile(content: string, filename: string, contentType?: string): void;
|
|
23
|
+
export declare function formatFileSize(bytes: number): string;
|
|
24
|
+
export declare function truncateText(text: string, maxLength: number): string;
|
|
25
|
+
export declare function slugify(text: string): string;
|
|
26
|
+
export declare function isValidEmail(email: string): boolean;
|
|
27
|
+
export declare function isValidUrl(url: string): boolean;
|
|
28
|
+
export declare const componentAPI: ComponentAPI;
|
|
29
|
+
export default componentAPI;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInfo, SearchResult, RecommendationResponse, CodeGenerationResponse, IntegrationHelpResponse, DocsResponse } from '../types/components';
|
|
3
|
+
export declare function useComponentSearch(initialQuery?: string, initialCategory?: string): {
|
|
4
|
+
query: string;
|
|
5
|
+
category: string | undefined;
|
|
6
|
+
results: SearchResult[];
|
|
7
|
+
loading: boolean;
|
|
8
|
+
error: string | null;
|
|
9
|
+
search: (newQuery: string, newCategory?: string) => void;
|
|
10
|
+
setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
11
|
+
setCategory: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
12
|
+
};
|
|
13
|
+
export declare function useComponentDocs(componentName: string, includeExamples?: boolean, includeProps?: boolean): {
|
|
14
|
+
docs: DocsResponse | null;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
error: string | null;
|
|
17
|
+
refetch: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function useComponentRecommendations(description: string, context?: string, complexity?: 'simple' | 'medium' | 'complex', framework?: string): {
|
|
20
|
+
recommendations: RecommendationResponse | null;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: string | null;
|
|
23
|
+
refetch: () => void;
|
|
24
|
+
};
|
|
25
|
+
export declare function useCodeGeneration(): {
|
|
26
|
+
generatedCode: CodeGenerationResponse | null;
|
|
27
|
+
loading: boolean;
|
|
28
|
+
error: string | null;
|
|
29
|
+
generateCode: (components: string[], pattern?: string, framework?: string, typescript?: boolean, styling?: 'css' | 'tailwind' | 'styled-components') => Promise<void>;
|
|
30
|
+
clear: () => void;
|
|
31
|
+
};
|
|
32
|
+
export declare function useIntegrationHelp(topic: string, framework?: string): {
|
|
33
|
+
help: IntegrationHelpResponse | null;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
error: string | null;
|
|
36
|
+
refetch: () => void;
|
|
37
|
+
};
|
|
38
|
+
export declare function useComponents(): {
|
|
39
|
+
components: ComponentInfo[];
|
|
40
|
+
categories: string[];
|
|
41
|
+
loading: boolean;
|
|
42
|
+
error: string | null;
|
|
43
|
+
getComponentsByCategory: (category: string) => ComponentInfo[];
|
|
44
|
+
getComponentByName: (name: string) => ComponentInfo | undefined;
|
|
45
|
+
refetch: () => void;
|
|
46
|
+
};
|
|
47
|
+
export declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void, () => void];
|
|
48
|
+
export declare function useFavorites(): {
|
|
49
|
+
favorites: string[];
|
|
50
|
+
addToFavorites: (componentName: string) => void;
|
|
51
|
+
removeFromFavorites: (componentName: string) => void;
|
|
52
|
+
toggleFavorite: (componentName: string) => void;
|
|
53
|
+
isFavorite: (componentName: string) => boolean;
|
|
54
|
+
};
|
|
55
|
+
export declare function useSearchHistory(): {
|
|
56
|
+
searchHistory: string[];
|
|
57
|
+
addToHistory: (query: string) => void;
|
|
58
|
+
removeFromHistory: (query: string) => void;
|
|
59
|
+
clearHistory: () => void;
|
|
60
|
+
};
|
|
61
|
+
export declare function useCopyToClipboard(): {
|
|
62
|
+
copied: boolean;
|
|
63
|
+
copy: (text: string) => Promise<void>;
|
|
64
|
+
};
|
|
65
|
+
export declare function useTheme(): {
|
|
66
|
+
theme: "dark" | "light" | "system";
|
|
67
|
+
toggleTheme: () => void;
|
|
68
|
+
setLightTheme: () => void;
|
|
69
|
+
setDarkTheme: () => void;
|
|
70
|
+
setSystemTheme: () => void;
|
|
71
|
+
};
|
|
72
|
+
export declare function useWindowSize(): {
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
};
|
|
76
|
+
export declare function useKeyboardShortcuts(shortcuts: Record<string, () => void>): void;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export interface ComponentInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
category: string;
|
|
5
|
+
repo_path: string;
|
|
6
|
+
type: 'component' | 'hook' | 'context' | 'utility';
|
|
7
|
+
tags?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface SearchResult {
|
|
10
|
+
component: ComponentInfo;
|
|
11
|
+
score: number;
|
|
12
|
+
matchReason: string;
|
|
13
|
+
relevantContext: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentSearchFilter {
|
|
16
|
+
category?: string;
|
|
17
|
+
type?: 'component' | 'hook' | 'context' | 'utility';
|
|
18
|
+
tags?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ComponentCategory {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
components: ComponentInfo[];
|
|
24
|
+
}
|
|
25
|
+
export interface ComponentSummary {
|
|
26
|
+
totalComponents: number;
|
|
27
|
+
categories: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
count: number;
|
|
30
|
+
description: string;
|
|
31
|
+
}>;
|
|
32
|
+
componentTypes: {
|
|
33
|
+
component: number;
|
|
34
|
+
hook: number;
|
|
35
|
+
context: number;
|
|
36
|
+
utility: number;
|
|
37
|
+
};
|
|
38
|
+
generatedAt: string;
|
|
39
|
+
}
|
|
40
|
+
export interface APIResponse<T> {
|
|
41
|
+
success: boolean;
|
|
42
|
+
data?: T;
|
|
43
|
+
error?: string;
|
|
44
|
+
suggestions?: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface SearchResponse {
|
|
47
|
+
query: string;
|
|
48
|
+
total: number;
|
|
49
|
+
results: Array<{
|
|
50
|
+
component: ComponentInfo;
|
|
51
|
+
relevance: number;
|
|
52
|
+
matchReason: string;
|
|
53
|
+
importPath: string;
|
|
54
|
+
repositoryUrl: string;
|
|
55
|
+
}>;
|
|
56
|
+
categories: string[];
|
|
57
|
+
}
|
|
58
|
+
export interface RecommendationRequest {
|
|
59
|
+
description: string;
|
|
60
|
+
context?: string;
|
|
61
|
+
complexity?: 'simple' | 'medium' | 'complex';
|
|
62
|
+
framework?: string;
|
|
63
|
+
existingComponents?: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface RecommendationResponse {
|
|
66
|
+
recommendations: Array<{
|
|
67
|
+
component: ComponentInfo;
|
|
68
|
+
relevance: number;
|
|
69
|
+
reasoning: string;
|
|
70
|
+
codeExample: string;
|
|
71
|
+
importPath: string;
|
|
72
|
+
repositoryUrl: string;
|
|
73
|
+
}>;
|
|
74
|
+
alternatives: ComponentInfo[];
|
|
75
|
+
implementation: {
|
|
76
|
+
steps: string[];
|
|
77
|
+
codeSnippet: string;
|
|
78
|
+
dependencies: string[];
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export interface CodeGenerationRequest {
|
|
82
|
+
components: string[];
|
|
83
|
+
pattern?: string;
|
|
84
|
+
framework?: string;
|
|
85
|
+
typescript?: boolean;
|
|
86
|
+
styling?: 'css' | 'tailwind' | 'styled-components';
|
|
87
|
+
}
|
|
88
|
+
export interface CodeGenerationResponse {
|
|
89
|
+
imports: string;
|
|
90
|
+
component: string;
|
|
91
|
+
styling: string;
|
|
92
|
+
usage: string;
|
|
93
|
+
explanation: string;
|
|
94
|
+
}
|
|
95
|
+
export interface IntegrationHelpRequest {
|
|
96
|
+
topic: string;
|
|
97
|
+
framework?: string;
|
|
98
|
+
version?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface IntegrationHelpResponse {
|
|
101
|
+
title: string;
|
|
102
|
+
description: string;
|
|
103
|
+
steps: Array<{
|
|
104
|
+
step: number;
|
|
105
|
+
title: string;
|
|
106
|
+
description: string;
|
|
107
|
+
code?: string;
|
|
108
|
+
}>;
|
|
109
|
+
troubleshooting: Array<{
|
|
110
|
+
issue: string;
|
|
111
|
+
solution: string;
|
|
112
|
+
}>;
|
|
113
|
+
relatedComponents: ComponentInfo[];
|
|
114
|
+
}
|
|
115
|
+
export interface DocsRequest {
|
|
116
|
+
component_name: string;
|
|
117
|
+
include_examples?: boolean;
|
|
118
|
+
include_props?: boolean;
|
|
119
|
+
include_styling?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export interface DocsResponse {
|
|
122
|
+
component: ComponentInfo;
|
|
123
|
+
documentation: {
|
|
124
|
+
overview: string;
|
|
125
|
+
usage: string;
|
|
126
|
+
props?: Array<{
|
|
127
|
+
name: string;
|
|
128
|
+
type: string;
|
|
129
|
+
required: boolean;
|
|
130
|
+
description: string;
|
|
131
|
+
default?: string;
|
|
132
|
+
}>;
|
|
133
|
+
examples?: Array<{
|
|
134
|
+
title: string;
|
|
135
|
+
code: string;
|
|
136
|
+
description: string;
|
|
137
|
+
}>;
|
|
138
|
+
styling?: {
|
|
139
|
+
classes: string[];
|
|
140
|
+
customization: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
relatedComponents: ComponentInfo[];
|
|
144
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export namespace SVGs {
|
|
2
|
+
const next: any;
|
|
3
|
+
const previous: any;
|
|
4
|
+
const cloud: any;
|
|
5
|
+
const play: any;
|
|
6
|
+
const email: any;
|
|
7
|
+
const location: any;
|
|
8
|
+
const phone: any;
|
|
9
|
+
const facebook: any;
|
|
10
|
+
const youtube: any;
|
|
11
|
+
const instagram: any;
|
|
12
|
+
const gobackward: any;
|
|
13
|
+
const goforward: any;
|
|
14
|
+
const playF: any;
|
|
15
|
+
const pauseF: any;
|
|
16
|
+
const w_youtube: any;
|
|
17
|
+
const linkedin: any;
|
|
18
|
+
const NotFound: any;
|
|
19
|
+
const visibility: any;
|
|
20
|
+
const visibility_off: any;
|
|
21
|
+
const Trophy: any;
|
|
22
|
+
const chevronUp: any;
|
|
23
|
+
const TrophyCircle: any;
|
|
24
|
+
const climb: any;
|
|
25
|
+
const Vector: any;
|
|
26
|
+
const twitter: any;
|
|
27
|
+
const medal: any;
|
|
28
|
+
const plane: any;
|
|
29
|
+
const squareAndArrow: any;
|
|
30
|
+
const uploads: any;
|
|
31
|
+
const settings: any;
|
|
32
|
+
const highVolume: any;
|
|
33
|
+
const halfVolume: any;
|
|
34
|
+
const muteVolume: any;
|
|
35
|
+
const fullScreen: any;
|
|
36
|
+
}
|
|
@@ -1,34 +1,77 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { PhoneNumberValueType } from "../lib/phoneUtils";
|
|
3
|
+
export interface PhoneNumberInputPropsType {
|
|
4
|
+
/** Initial dial code. Accepts "234", "+234", "+1-242" or an ISO code. */
|
|
3
5
|
phoneCode?: string;
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Initial values. `mobile` may already contain a dial code
|
|
8
|
+
* ("+2348031234567") — it is split automatically.
|
|
9
|
+
*/
|
|
10
|
+
defaultValues?: {
|
|
5
11
|
mobile?: string;
|
|
12
|
+
phone_code?: string;
|
|
6
13
|
[key: string]: any;
|
|
7
14
|
};
|
|
15
|
+
/** Name of the national number field. Defaults to "mobile". */
|
|
8
16
|
names?: string;
|
|
17
|
+
/** Name of the dial code field. Defaults to "phone_code". */
|
|
18
|
+
phoneCodeName?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
noOptionsMessage?: string;
|
|
23
|
+
note?: string;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
id?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Show the "+234 803 123 4567" preview line. Defaults to true. */
|
|
29
|
+
showPreview?: boolean;
|
|
30
|
+
/** ISO codes pinned to the top of the country list, e.g. ["NG", "GB"]. */
|
|
31
|
+
preferredCountries?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Emit the current value once on mount so the dial code reaches form state
|
|
34
|
+
* even when the user never opens the picker. Defaults to true.
|
|
35
|
+
*/
|
|
36
|
+
emitOnMount?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Legacy callback. Fired with `{ target: { name, value } }` for both the
|
|
39
|
+
* dial code field and the number field.
|
|
40
|
+
*/
|
|
9
41
|
inputEvent?: (event: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
|
|
42
|
+
/** Preferred callback — receives the fully parsed value. */
|
|
43
|
+
onChange?: (value: PhoneNumberValueType) => void;
|
|
44
|
+
/** Convenience setter that writes both fields into a form state object. */
|
|
45
|
+
setFormData?: React.Dispatch<React.SetStateAction<any>>;
|
|
10
46
|
}
|
|
11
47
|
/**
|
|
48
|
+
* Phone number input with a searchable country picker and paste parsing.
|
|
12
49
|
*
|
|
13
50
|
* @component
|
|
14
51
|
* @example
|
|
15
52
|
* ```jsx
|
|
16
53
|
* import { PhoneNumberInput } from "@instincthub/react-ui";
|
|
17
54
|
*
|
|
55
|
+
* const [formData, setFormData] = useState({ mobile: "", phone_code: "" });
|
|
56
|
+
*
|
|
18
57
|
* <PhoneNumberInput
|
|
19
|
-
* phoneCode="234"
|
|
20
|
-
* defaultValues={
|
|
21
|
-
* names="
|
|
22
|
-
*
|
|
23
|
-
*
|
|
58
|
+
* phoneCode="+234"
|
|
59
|
+
* defaultValues={formData}
|
|
60
|
+
* names="mobile"
|
|
61
|
+
* preferredCountries={["NG", "GB", "US"]}
|
|
62
|
+
* onChange={(value) => {
|
|
63
|
+
* // value.phoneCode -> "+234"
|
|
64
|
+
* // value.nationalNumber -> "8031234567"
|
|
65
|
+
* // value.e164 -> "+2348031234567" <- store this
|
|
66
|
+
* setFormData((prev) => ({ ...prev, ...value }));
|
|
24
67
|
* }}
|
|
25
68
|
* />
|
|
26
69
|
* ```
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
70
|
+
*
|
|
71
|
+
* Search the country list by name ("nigeria"), ISO code ("ng") or dial code
|
|
72
|
+
* ("234" / "+234"). Pasting a full international number
|
|
73
|
+
* ("+234 803 123 4567", "00234...", "2348031234567") selects the country and
|
|
74
|
+
* fills in the remaining digits without truncation.
|
|
32
75
|
*/
|
|
33
|
-
declare const PhoneNumberInput: React.FC<
|
|
76
|
+
declare const PhoneNumberInput: React.FC<PhoneNumberInputPropsType>;
|
|
34
77
|
export default PhoneNumberInput;
|
|
@@ -2,12 +2,18 @@ import { S3MultiUploaderProps } from "@/types";
|
|
|
2
2
|
/**
|
|
3
3
|
* S3MultiUploader — multi-file queue uploader with per-file progress.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Security model: this component never touches AWS credentials. It calls
|
|
6
|
+
* `getPresignedUrl(file)` — a consumer-supplied async function that must
|
|
7
|
+
* hit a server endpoint. The server validates the request (auth, MIME,
|
|
8
|
+
* size, location) and returns a short-lived presigned PUT URL together
|
|
9
|
+
* with the resolved object key and CDN URL.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
* AWS_REGION, AWS_S3_ENDPOINT_URL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME
|
|
11
|
+
* Example server route (Next.js API):
|
|
10
12
|
*
|
|
11
|
-
*
|
|
13
|
+
* POST /api/upload/presign
|
|
14
|
+
* Body: { name, type, size }
|
|
15
|
+
* → { url, key, cdnUrl } (url = S3 presigned PUT, expires in 60s)
|
|
16
|
+
*
|
|
17
|
+
* CSS: import "@instincthub/react-ui/assets/css/forms/s3-multi-uploader.css"
|
|
12
18
|
*/
|
|
13
|
-
export default function S3MultiUploader({ accepts, maxFileSizeBytes, maxFiles, concurrency,
|
|
19
|
+
export default function S3MultiUploader({ accepts, maxFileSizeBytes, maxFiles, concurrency, getPresignedUrl, label, hint, onFileComplete, onQueueComplete, onError, disabled, className, }: S3MultiUploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,6 +13,7 @@ export { default as getPriceObjects } from "./getPriceObjects";
|
|
|
13
13
|
export { default as convertArrayToObject } from "./convertArrayToObject";
|
|
14
14
|
export { default as loadScript } from "./loadScript";
|
|
15
15
|
export * from "./format";
|
|
16
|
+
export * from "./phoneUtils";
|
|
16
17
|
export * from "./helpFunction";
|
|
17
18
|
export * from "./oauth_json";
|
|
18
19
|
export * from "./paystack";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A country entry augmented with a normalised, digits-only dial code.
|
|
3
|
+
* The raw dataset stores `phonecode` inconsistently ("234", "+1-242",
|
|
4
|
+
* "0055", "+1-787 and 1-939"), so `dialCode` is the value to rely on.
|
|
5
|
+
*/
|
|
6
|
+
export interface PhoneCountryType {
|
|
7
|
+
name: string;
|
|
8
|
+
isoCode: string;
|
|
9
|
+
flag: string;
|
|
10
|
+
phonecode: string;
|
|
11
|
+
dialCode: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface ParsedPhoneNumberType {
|
|
15
|
+
/** Country detected from an explicit dial code, if any. */
|
|
16
|
+
country?: PhoneCountryType;
|
|
17
|
+
/** Digits-only dial code that was stripped off, if any. */
|
|
18
|
+
dialCode?: string;
|
|
19
|
+
/** Subscriber number with the dial code and trunk prefix removed. */
|
|
20
|
+
nationalNumber: string;
|
|
21
|
+
/** True when a dial code was found and removed from the input. */
|
|
22
|
+
matchedCountryCode: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PhoneNumberValueType {
|
|
25
|
+
/** Display form of the dial code, e.g. "+234". */
|
|
26
|
+
phoneCode: string;
|
|
27
|
+
/** Digits-only dial code, e.g. "234". */
|
|
28
|
+
dialCode: string;
|
|
29
|
+
/** Subscriber number without dial code or trunk prefix, e.g. "8031234567". */
|
|
30
|
+
nationalNumber: string;
|
|
31
|
+
/** Storage form, e.g. "+2348031234567". Empty when there is no number. */
|
|
32
|
+
e164: string;
|
|
33
|
+
/** Human readable form, e.g. "+234 803 123 4567". */
|
|
34
|
+
formatted: string;
|
|
35
|
+
isoCode: string;
|
|
36
|
+
countryName: string;
|
|
37
|
+
flag: string;
|
|
38
|
+
isValid: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** E.164 caps dial code + national number at 15 digits. */
|
|
41
|
+
export declare const E164_MAX_DIGITS = 15;
|
|
42
|
+
/** Shortest national number we treat as plausible when splitting a paste. */
|
|
43
|
+
export declare const MIN_NATIONAL_DIGITS = 4;
|
|
44
|
+
/**
|
|
45
|
+
* A national number (no dial code) never exceeds this in practice. Anything
|
|
46
|
+
* longer that was pasted without a "+" almost certainly embeds a dial code.
|
|
47
|
+
*/
|
|
48
|
+
export declare const MAX_NATIONAL_DIGITS = 11;
|
|
49
|
+
/**
|
|
50
|
+
* Reduce a raw `phonecode` to digits only.
|
|
51
|
+
* "+1-242" -> "1242", "0055" -> "55", "+1-787 and 1-939" -> "1787".
|
|
52
|
+
*/
|
|
53
|
+
export declare const normalizeDialCode: (phonecode?: string | null) => string;
|
|
54
|
+
/** Every country, with a usable `dialCode`, sorted alphabetically by name. */
|
|
55
|
+
export declare const PHONE_COUNTRIES: PhoneCountryType[];
|
|
56
|
+
/** Strip everything except digits. */
|
|
57
|
+
export declare const digitsOnly: (value?: string | null) => string;
|
|
58
|
+
/** Longest national number allowed for a dial code, per E.164. */
|
|
59
|
+
export declare const maxNationalDigits: (dialCode?: string | null) => number;
|
|
60
|
+
export declare const findCountryByIso: (isoCode?: string | null) => PhoneCountryType | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the country that owns a dial code. `preferIso` wins when it is one
|
|
63
|
+
* of the holders, which keeps the current selection stable while typing.
|
|
64
|
+
*/
|
|
65
|
+
export declare const findCountryByDialCode: (dialCode: string, preferIso?: string | null) => PhoneCountryType | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Accepts anything a caller might pass as a country: "234", "+234", "+1-242",
|
|
68
|
+
* "NG", "ng" or "Nigeria".
|
|
69
|
+
*/
|
|
70
|
+
export declare const resolveCountry: (value?: string | null, preferIso?: string | null) => PhoneCountryType | undefined;
|
|
71
|
+
/** Greedy longest-prefix dial code match against a digits-only string. */
|
|
72
|
+
export declare const matchDialCode: (digits: string, preferIso?: string | null) => ParsedPhoneNumberType | null;
|
|
73
|
+
/**
|
|
74
|
+
* Split a phone number into a country and a national number.
|
|
75
|
+
*
|
|
76
|
+
* Explicit international input ("+234…" or "00234…") always attempts a dial
|
|
77
|
+
* code match. Input without that prefix is treated as national — a leading
|
|
78
|
+
* trunk "0" is dropped and the current country is kept — unless `aggressive`
|
|
79
|
+
* is set, which is what paste and blur use to also recognise a bare
|
|
80
|
+
* "2348031234567".
|
|
81
|
+
*/
|
|
82
|
+
export declare const parsePhoneNumber: (raw: string, options?: {
|
|
83
|
+
currentCountry?: PhoneCountryType | null;
|
|
84
|
+
aggressive?: boolean;
|
|
85
|
+
}) => ParsedPhoneNumberType;
|
|
86
|
+
/** Group a national number for display: "8031234567" -> "803 123 4567". */
|
|
87
|
+
export declare const formatNationalNumber: (nationalNumber?: string | null) => string;
|
|
88
|
+
/** Build the full value object a consumer stores or submits. */
|
|
89
|
+
export declare const buildPhoneValue: (country: PhoneCountryType, nationalNumber?: string | null) => PhoneNumberValueType;
|
|
90
|
+
/**
|
|
91
|
+
* Filter countries by name, ISO code or dial code, ranked so the most likely
|
|
92
|
+
* match sorts first. "ng", "nigeria", "234" and "+234" all find Nigeria.
|
|
93
|
+
*/
|
|
94
|
+
export declare const searchCountries: (query?: string | null, countries?: PhoneCountryType[]) => PhoneCountryType[];
|
|
95
|
+
/**
|
|
96
|
+
* Move a set of ISO codes to the top of the list, preserving their given
|
|
97
|
+
* order. Used for the `preferredCountries` prop.
|
|
98
|
+
*/
|
|
99
|
+
export declare const withPreferredCountries: (preferredIsoCodes?: string[] | null, countries?: PhoneCountryType[]) => PhoneCountryType[];
|