@olwiba/ui 0.1.13 → 0.1.15

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/index.d.ts CHANGED
@@ -3,8 +3,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactNode } from 'react';
5
5
  import { ButtonProps as ButtonProps$1, CardProps as CardProps$1, BadgeProps as BadgeProps$1, InputProps as InputProps$1, TextareaProps as TextareaProps$1, CheckboxProps as CheckboxProps$1, SwitchProps as SwitchProps$1 } from '@olwiba/cn';
6
- export { CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@olwiba/cn';
6
+ export { CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Enchanted, EnchantedProps } from '@olwiba/cn';
7
7
  import { LucideIcon } from 'lucide-react';
8
+ import { ColumnDef } from '@tanstack/react-table';
9
+ export { ColumnDef as DataTableColumn } from '@tanstack/react-table';
8
10
  export { MdxContent, MdxContentProps } from './mdx/index.js';
9
11
 
10
12
  declare function cn(...inputs: ClassValue[]): string;
@@ -260,19 +262,34 @@ interface AppShellProps {
260
262
  declare function AppShell({ brand, navItems, action, user, pageTitle, headerStart, headerEnd, renderLink, collapsible, sidebarPosition, side, children, }?: AppShellProps): react_jsx_runtime.JSX.Element;
261
263
 
262
264
  interface AuthFormProps {
263
- /** Controls form title, fields, and footer text. @default 'signin' */
264
- mode?: 'signin' | 'signup';
265
+ /**
266
+ * Controls form title, fields, and footer text.
267
+ * - `'signin'` / `'signup'` — email + password
268
+ * - `'forgot-password'` — email only, sends a reset link
269
+ * - `'reset-password'` — new password + confirmation
270
+ * - `'verify'` — one-time code entry (email verification or 2FA)
271
+ * @default 'signin'
272
+ */
273
+ mode?: 'signin' | 'signup' | 'forgot-password' | 'reset-password' | 'verify';
265
274
  onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
266
275
  onSso?: () => void;
267
276
  /** (signin) Link to the sign-up page */
268
277
  signUpHref?: string;
269
- /** (signup) Link back to the sign-in page */
278
+ /** (signup / forgot-password / reset-password / verify) Link back to the sign-in page */
270
279
  signInHref?: string;
271
280
  forgotPasswordHref?: string;
281
+ /** (verify) Re-sends the one-time code */
282
+ onResend?: () => void;
283
+ /** (verify) Address the code was sent to, shown in the description */
284
+ destination?: string;
285
+ /** (verify) Number of digits in the code. @default 6 */
286
+ codeLength?: number;
272
287
  /** Brand node — in centered layout renders above the card; in split layout renders inside the card */
273
288
  brand?: React.ReactNode;
274
289
  /** Error message displayed below the form fields */
275
290
  error?: string;
291
+ /** Positive confirmation message displayed below the form fields (e.g. "Reset link sent") */
292
+ success?: string;
276
293
  /** Disables the submit button and shows a loading label */
277
294
  loading?: boolean;
278
295
  /** Render prop for links — use to inject framework-native link components (e.g. TanStack Router Link) */
@@ -295,6 +312,108 @@ interface AuthSectionProps extends AuthFormProps {
295
312
  }
296
313
  declare function AuthSection({ layout, children, panel, className, ...formProps }: AuthSectionProps): react_jsx_runtime.JSX.Element;
297
314
 
315
+ interface SettingsSectionProps {
316
+ title: string;
317
+ description?: string;
318
+ /** Form fields, buttons, or any content for the right-hand column — e.g. a `<form>`. */
319
+ children: React.ReactNode;
320
+ /** Styles the content column for a destructive action (e.g. "Delete account"). @default false */
321
+ danger?: boolean;
322
+ className?: string;
323
+ }
324
+ /**
325
+ * One title+description+content row for a settings page. Stack a few inside
326
+ * a `<div className="divide-y divide-border">` to build a full settings
327
+ * page — one block reused per row, rather than a bespoke layout each time.
328
+ */
329
+ declare function SettingsSection({ title, description, children, danger, className }: SettingsSectionProps): react_jsx_runtime.JSX.Element;
330
+
331
+ interface TeamMemberRecord {
332
+ id: string;
333
+ name: string;
334
+ email: string;
335
+ avatar?: string;
336
+ role: string;
337
+ }
338
+ interface TeamMembersPanelProps {
339
+ members: TeamMemberRecord[];
340
+ /** Roles offered in the invite dialog and the per-row role menu. @default ['Owner', 'Admin', 'Member'] */
341
+ roles?: string[];
342
+ onInvite?: (email: string, role: string) => void;
343
+ onRoleChange?: (memberId: string, role: string) => void;
344
+ onRemove?: (memberId: string) => void;
345
+ title?: string;
346
+ description?: string;
347
+ }
348
+ /**
349
+ * Member list with role management and an invite dialog. One block for
350
+ * team/org administration — built on `DataTable` rather than a bespoke list.
351
+ */
352
+ declare function TeamMembersPanel({ members, roles, onInvite, onRoleChange, onRemove, title, description, }: TeamMembersPanelProps): react_jsx_runtime.JSX.Element;
353
+
354
+ interface BillingUsageMetric {
355
+ label: string;
356
+ used: number;
357
+ limit: number;
358
+ unit?: string;
359
+ }
360
+ interface BillingInvoice {
361
+ id: string;
362
+ date: string;
363
+ amount: string;
364
+ status: 'paid' | 'open' | 'void';
365
+ downloadUrl?: string;
366
+ }
367
+ interface BillingPaymentMethod {
368
+ brand: string;
369
+ last4: string;
370
+ expiry: string;
371
+ }
372
+ interface BillingPanelProps {
373
+ planName: string;
374
+ planPrice?: string;
375
+ renewalDate?: string;
376
+ usage?: BillingUsageMetric[];
377
+ paymentMethod?: BillingPaymentMethod;
378
+ invoices?: BillingInvoice[];
379
+ onManagePlan?: () => void;
380
+ onUpdatePaymentMethod?: () => void;
381
+ className?: string;
382
+ }
383
+ /**
384
+ * In-app billing summary — current plan + usage, payment method, invoice
385
+ * history. Built from `SettingsSection` rows and `DataTable`, rather than a
386
+ * one-off billing page each time. Marketing plan comparisons stay in
387
+ * `PricingSection`/`UpgradePrompt` — this is the account-side view.
388
+ */
389
+ declare function BillingPanel({ planName, planPrice, renewalDate, usage, paymentMethod, invoices, onManagePlan, onUpdatePaymentMethod, className, }: BillingPanelProps): react_jsx_runtime.JSX.Element;
390
+
391
+ interface OnboardingStep {
392
+ id: string;
393
+ title: string;
394
+ description?: string;
395
+ content: React.ReactNode;
396
+ /** Runs before advancing past this step. Return `false`/an error string to block. */
397
+ onNext?: () => boolean | string | Promise<boolean | string>;
398
+ }
399
+ interface OnboardingWizardProps {
400
+ steps: OnboardingStep[];
401
+ /** Called after the last step's `onNext` succeeds. */
402
+ onComplete?: () => void;
403
+ onStepChange?: (index: number) => void;
404
+ /** Controlled current step index — omit to let the component manage it internally. */
405
+ step?: number;
406
+ onStepIndexChange?: (index: number) => void;
407
+ completeLabel?: string;
408
+ className?: string;
409
+ }
410
+ /**
411
+ * Stateful multi-step onboarding flow. One component driven by a `steps`
412
+ * prop — swap the array to reshape the flow rather than hand-building a
413
+ * new wizard per feature.
414
+ */
415
+ declare function OnboardingWizard({ steps, onComplete, onStepChange, step: stepProp, onStepIndexChange, completeLabel, className, }: OnboardingWizardProps): react_jsx_runtime.JSX.Element;
416
+
298
417
  interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
299
418
  icon?: LucideIcon;
300
419
  title: string;
@@ -956,6 +1075,121 @@ interface ConfirmDialogProps extends Pick<UseConfirmReturn, 'isOpen' | 'options'
956
1075
  }
957
1076
  declare function ConfirmDialog({ isOpen, options, handleConfirm, handleCancel, destructive }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
958
1077
 
1078
+ interface CommandMenuItem {
1079
+ id: string;
1080
+ label: string;
1081
+ icon?: LucideIcon;
1082
+ shortcut?: string;
1083
+ keywords?: string[];
1084
+ onSelect: () => void;
1085
+ }
1086
+ interface CommandMenuGroup {
1087
+ heading: string;
1088
+ items: CommandMenuItem[];
1089
+ }
1090
+ interface CommandMenuProps {
1091
+ groups: CommandMenuGroup[];
1092
+ placeholder?: string;
1093
+ emptyMessage?: string;
1094
+ /** Controlled open state — omit to let the component manage it internally. */
1095
+ open?: boolean;
1096
+ onOpenChange?: (open: boolean) => void;
1097
+ /** Registers Cmd+K (mac) / Ctrl+K (win) to toggle the palette. @default true */
1098
+ hotkey?: boolean;
1099
+ }
1100
+ /**
1101
+ * Global search / Cmd+K command palette. One component — pass different
1102
+ * `groups` per surface rather than building a bespoke dialog each time.
1103
+ */
1104
+ declare function CommandMenu({ groups, placeholder, emptyMessage, open: openProp, onOpenChange, hotkey, }: CommandMenuProps): react_jsx_runtime.JSX.Element;
1105
+
1106
+ interface DataTableProps<TData> {
1107
+ columns: ColumnDef<TData>[];
1108
+ data: TData[];
1109
+ /** Shows a quick-filter input above the table, matching against `searchKey`. */
1110
+ searchKey?: string;
1111
+ searchPlaceholder?: string;
1112
+ /** Adds a checkbox column and reports the selected rows. */
1113
+ selectable?: boolean;
1114
+ onSelectionChange?: (rows: TData[]) => void;
1115
+ /** Rows per page. Set to `0` to disable pagination entirely. @default 10 */
1116
+ pageSize?: number;
1117
+ /** Slot rendered top-right of the toolbar — e.g. an "Add" button. */
1118
+ toolbar?: React.ReactNode;
1119
+ onRowClick?: (row: TData) => void;
1120
+ emptyMessage?: string;
1121
+ className?: string;
1122
+ }
1123
+ /**
1124
+ * Sortable, paginated, optionally-selectable data table. One component —
1125
+ * toggle `searchKey`/`selectable`/`pageSize` rather than reaching for a
1126
+ * different table component per use case.
1127
+ */
1128
+ declare function DataTable<TData>({ columns, data, searchKey, searchPlaceholder, selectable, onSelectionChange, pageSize, toolbar, onRowClick, emptyMessage, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
1129
+
1130
+ interface FileUploadEntry {
1131
+ id: string;
1132
+ file: File;
1133
+ /** 0–100. Omit while pending, or when not tracking progress. */
1134
+ progress?: number;
1135
+ status?: 'pending' | 'uploading' | 'done' | 'error';
1136
+ error?: string;
1137
+ }
1138
+ interface FileUploadProps {
1139
+ /** Comma-separated MIME types / extensions, e.g. `"image/png,image/jpeg"`. */
1140
+ accept?: string;
1141
+ multiple?: boolean;
1142
+ maxSizeMb?: number;
1143
+ maxFiles?: number;
1144
+ /** Controlled file list — pass this (with `onFilesChange`) to drive upload progress from your own network layer. */
1145
+ files?: FileUploadEntry[];
1146
+ /** Uncontrolled default list. */
1147
+ defaultFiles?: FileUploadEntry[];
1148
+ onFilesChange?: (files: FileUploadEntry[]) => void;
1149
+ /** Fired with the raw, already-validated `File` objects a user just added. */
1150
+ onFilesAdded?: (files: File[]) => void;
1151
+ disabled?: boolean;
1152
+ /** Helper text under the drop zone, e.g. "PNG or JPG, up to 5MB". */
1153
+ hint?: string;
1154
+ className?: string;
1155
+ }
1156
+ /**
1157
+ * Drag-and-drop file picker with a validated queue list. One component —
1158
+ * toggle `multiple`/`accept`/`maxSizeMb`/`maxFiles` rather than reaching for
1159
+ * a separate dropzone per use case. Progress/status is presentation-only;
1160
+ * wire `files`/`onFilesChange` to your own upload layer to drive it.
1161
+ */
1162
+ declare function FileUpload({ accept, multiple, maxSizeMb, maxFiles, files: filesProp, defaultFiles, onFilesChange, onFilesAdded, disabled, hint, className, }: FileUploadProps): react_jsx_runtime.JSX.Element;
1163
+
1164
+ interface NotifyAction {
1165
+ label: string;
1166
+ onClick: () => void;
1167
+ }
1168
+ interface NotificationToastProps {
1169
+ variant?: 'success' | 'info' | 'message';
1170
+ title: string;
1171
+ description?: string;
1172
+ /** Avatar image — overrides the variant icon (e.g. for a message-from-a-person toast). */
1173
+ avatar?: string;
1174
+ /** Primary action, right-aligned next to the description (e.g. "Undo"). */
1175
+ action?: NotifyAction;
1176
+ /** Secondary action, rendered after the primary one (e.g. "Decline"). */
1177
+ secondaryAction?: NotifyAction;
1178
+ onDismiss?: () => void;
1179
+ }
1180
+ /**
1181
+ * Rich toast content — rendered via `notify()` inside sonner's `toast.custom`.
1182
+ * One component: `variant` swaps the default icon, `avatar`/`action`/
1183
+ * `secondaryAction` add the pieces a given toast needs, rather than a
1184
+ * separate toast component per shape.
1185
+ */
1186
+ declare function NotificationToast({ variant, title, description, avatar, action, secondaryAction, onDismiss, }: NotificationToastProps): react_jsx_runtime.JSX.Element;
1187
+ interface NotifyOptions extends Omit<NotificationToastProps, 'onDismiss'> {
1188
+ duration?: number;
1189
+ }
1190
+ /** Fires a `NotificationToast` through sonner. Requires `<Toaster />` from `@olwiba/cn` mounted once in your app. */
1191
+ declare function notify(options: NotifyOptions): string | number;
1192
+
959
1193
  declare const sizes: {
960
1194
  readonly sm: {
961
1195
  readonly outer: "w-44";
@@ -1322,4 +1556,4 @@ interface UsePaginationReturn {
1322
1556
  }
1323
1557
  declare function usePagination(total: number, pageSize: number): UsePaginationReturn;
1324
1558
 
1325
- export { AnimatedPill, type AnimatedPillProps, AppContent, type AppContentProps, AppGrid, AppGridCell, type AppGridCellProps, type AppGridProps, type AppNavItem, AppScreen, AppShell, type AppShellAction, type AppShellBrand, type AppShellProps, type AppShellRenderLink, type AppShellUser, type AuthFormProps, AuthSection, type AuthSectionProps, Badge, type BadgeProps, BrandColorSwitchMinimal, Button, type ButtonProps, Card, type CardProps, CarouselSection, type CarouselSectionProps, ChangelogCard, type ChangelogCardProps, type ChangelogHighlight, ChangelogList, type ChangelogListProps, type ChangelogReleaseType, Checkbox, type CheckboxProps, type ComparisonColumn, ComparisonSection, type ComparisonSectionProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, type ContactInfoItem, ContactSection, type ContactSectionProps, ContextMenu, type ContextMenuDef, type ContextMenuProps, CountUp, type CountUpProps, CountdownTimer, type CountdownTimerProps, CtaCardSection, type CtaCardSectionProps, CtaSection, type CtaSectionProps, DevBanner, type DevBannerProps, Dock, type DockItem, type DockProps, EmptyState, type EmptyStateProps, ErrorPage, type ErrorPageProps, FadeIn, type FadeInProps, FaqSection, type FaqSectionProps, FeatureCard, type FeatureCardProps, type FeatureMarqueeItem, type FeatureMarqueeRow, FeatureMarqueeSection, type FeatureMarqueeSectionProps, FeaturesSection, type FeaturesSectionProps, FlowBracket, type FlowBracketProps, FlowConnector, type FlowConnectorProps, Footer, type FooterProps, FullPageSpinner, GlassCard, type GlassCardProps, Grid, GridItem, type GridItemProps, type GridProps, type GroupedFeatureGroup, GroupedFeaturesSection, type GroupedFeaturesSectionProps, HeroSection, type HeroSectionProps, type Hotkey, ImageCard, type ImageCardProps, Input, type InputProps, LogoStrip, type LogoStripProps, type MarketingSectionSpacing, ModeSwitchMinimal, Navbar, type NavbarProps, NewsletterSection, type NewsletterSectionProps, OlwibaUIProvider, type OlwibaUIProviderProps, Overlay, type OverlayProps, type OverlayVariant, PageHeader, type PageHeaderBackButton, type PageHeaderBreadcrumb, type PageHeaderProps, PageTransition, type PageTransitionProps, PhoneFrame, type PhoneFrameProps, type PostAuthor, PostCard, type PostCardProps, PostList, type PostListProps, PricingCard, type PricingCardProps, type PricingFeature, type PricingPlan, PricingSection, type PricingSectionProps, PublicPageFrame, type PublicPageFrameProps, type QualificationColumn, QualificationSection, type QualificationSectionProps, RegisterHotkeys, RootErrorFallback, Section, type SectionProps, SectionTitle, type SectionTitleProps, Spotlight, type SpotlightGroup, type SpotlightItem, type SpotlightProps, Stack, type StackProps, StaggerChildren, type StaggerChildrenProps, StatCard, type StatCardProps, StatsSection, type StatsSectionProps, type StepItem, StepsSection, type StepsSectionProps, Suspensed, Switch, type SwitchProps, type TeamMember, TeamSection, type TeamSectionProps, type TechStackItem, TechStackSection, type TechStackSectionProps, TestimonialCard, type TestimonialCardProps, TestimonialsSection, type TestimonialsSectionProps, Textarea, type TextareaProps, ThemeColorUpdater, ThemeSwitchMinimal, type UIMode, Underlay, type UnderlayProps, type UnderlayVariant, type UpgradeComparisonRow, UpgradePrompt, type UpgradePromptProps, type UseConfirmReturn, type UseControlledOpenReturn, type UsePaginationReturn, VersionBanner, cn, marketingSectionSpacing, useConfirm, useControlledOpen, useCopyToClipboard, useDebounce, useIntersectionObserver, useLocalStorage, useMediaQuery, useMounted, useOlwibaUI, usePagination, useScrolledPast, useUIMode };
1559
+ export { AnimatedPill, type AnimatedPillProps, AppContent, type AppContentProps, AppGrid, AppGridCell, type AppGridCellProps, type AppGridProps, type AppNavItem, AppScreen, AppShell, type AppShellAction, type AppShellBrand, type AppShellProps, type AppShellRenderLink, type AppShellUser, type AuthFormProps, AuthSection, type AuthSectionProps, Badge, type BadgeProps, type BillingInvoice, BillingPanel, type BillingPanelProps, type BillingPaymentMethod, type BillingUsageMetric, BrandColorSwitchMinimal, Button, type ButtonProps, Card, type CardProps, CarouselSection, type CarouselSectionProps, ChangelogCard, type ChangelogCardProps, type ChangelogHighlight, ChangelogList, type ChangelogListProps, type ChangelogReleaseType, Checkbox, type CheckboxProps, CommandMenu, type CommandMenuGroup, type CommandMenuItem, type CommandMenuProps, type ComparisonColumn, ComparisonSection, type ComparisonSectionProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, type ContactInfoItem, ContactSection, type ContactSectionProps, ContextMenu, type ContextMenuDef, type ContextMenuProps, CountUp, type CountUpProps, CountdownTimer, type CountdownTimerProps, CtaCardSection, type CtaCardSectionProps, CtaSection, type CtaSectionProps, DataTable, type DataTableProps, DevBanner, type DevBannerProps, Dock, type DockItem, type DockProps, EmptyState, type EmptyStateProps, ErrorPage, type ErrorPageProps, FadeIn, type FadeInProps, FaqSection, type FaqSectionProps, FeatureCard, type FeatureCardProps, type FeatureMarqueeItem, type FeatureMarqueeRow, FeatureMarqueeSection, type FeatureMarqueeSectionProps, FeaturesSection, type FeaturesSectionProps, FileUpload, type FileUploadEntry, type FileUploadProps, FlowBracket, type FlowBracketProps, FlowConnector, type FlowConnectorProps, Footer, type FooterProps, FullPageSpinner, GlassCard, type GlassCardProps, Grid, GridItem, type GridItemProps, type GridProps, type GroupedFeatureGroup, GroupedFeaturesSection, type GroupedFeaturesSectionProps, HeroSection, type HeroSectionProps, type Hotkey, ImageCard, type ImageCardProps, Input, type InputProps, LogoStrip, type LogoStripProps, type MarketingSectionSpacing, ModeSwitchMinimal, Navbar, type NavbarProps, NewsletterSection, type NewsletterSectionProps, NotificationToast, type NotificationToastProps, type NotifyAction, type NotifyOptions, OlwibaUIProvider, type OlwibaUIProviderProps, type OnboardingStep, OnboardingWizard, type OnboardingWizardProps, Overlay, type OverlayProps, type OverlayVariant, PageHeader, type PageHeaderBackButton, type PageHeaderBreadcrumb, type PageHeaderProps, PageTransition, type PageTransitionProps, PhoneFrame, type PhoneFrameProps, type PostAuthor, PostCard, type PostCardProps, PostList, type PostListProps, PricingCard, type PricingCardProps, type PricingFeature, type PricingPlan, PricingSection, type PricingSectionProps, PublicPageFrame, type PublicPageFrameProps, type QualificationColumn, QualificationSection, type QualificationSectionProps, RegisterHotkeys, RootErrorFallback, Section, type SectionProps, SectionTitle, type SectionTitleProps, SettingsSection, type SettingsSectionProps, Spotlight, type SpotlightGroup, type SpotlightItem, type SpotlightProps, Stack, type StackProps, StaggerChildren, type StaggerChildrenProps, StatCard, type StatCardProps, StatsSection, type StatsSectionProps, type StepItem, StepsSection, type StepsSectionProps, Suspensed, Switch, type SwitchProps, type TeamMember, type TeamMemberRecord, TeamMembersPanel, type TeamMembersPanelProps, TeamSection, type TeamSectionProps, type TechStackItem, TechStackSection, type TechStackSectionProps, TestimonialCard, type TestimonialCardProps, TestimonialsSection, type TestimonialsSectionProps, Textarea, type TextareaProps, ThemeColorUpdater, ThemeSwitchMinimal, type UIMode, Underlay, type UnderlayProps, type UnderlayVariant, type UpgradeComparisonRow, UpgradePrompt, type UpgradePromptProps, type UseConfirmReturn, type UseControlledOpenReturn, type UsePaginationReturn, VersionBanner, cn, marketingSectionSpacing, notify, useConfirm, useControlledOpen, useCopyToClipboard, useDebounce, useIntersectionObserver, useLocalStorage, useMediaQuery, useMounted, useOlwibaUI, usePagination, useScrolledPast, useUIMode };