@dybo-ai/design 1.3.0 → 2.0.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/index.d.cts CHANGED
@@ -22,7 +22,7 @@ interface IInputProps extends InputHTMLAttributes<HTMLInputElement> {
22
22
  }
23
23
  declare function Input({ label, error, className, id, ...props }: IInputProps): react.JSX.Element;
24
24
 
25
- type BadgeStatus = "brand" | "resolved" | "high" | "medium" | "success" | "warning" | "danger";
25
+ type BadgeStatus = "brand" | "resolved" | "high" | "medium" | "success" | "warning" | "danger" | "soon";
26
26
  interface IBadgeProps extends HTMLAttributes<HTMLSpanElement> {
27
27
  status?: BadgeStatus;
28
28
  }
@@ -125,12 +125,15 @@ declare function NavItem({ label, href, active, icon, onClick, className, }: INa
125
125
  declare function NavSection({ label }: INavSectionProps): react.JSX.Element;
126
126
 
127
127
  type ColumnAlign = "left" | "right" | "center";
128
+ type SortDirection = "asc" | "desc";
128
129
  interface IColumn<TRow = Record<string, unknown>> {
129
130
  key: string;
130
131
  label: string;
131
132
  align?: ColumnAlign;
132
133
  format?: (value: unknown, row: TRow) => ReactNode;
133
134
  className?: string;
135
+ /** Renders the arrows-up-down affordance and calls `onSort` on click. */
136
+ sortable?: boolean;
134
137
  }
135
138
  interface IDataTableProps<TRow extends Record<string, unknown> = Record<string, unknown>> {
136
139
  columns: IColumn<TRow>[];
@@ -139,8 +142,14 @@ interface IDataTableProps<TRow extends Record<string, unknown> = Record<string,
139
142
  onRowClick?: (row: TRow) => void;
140
143
  emptyMessage?: string;
141
144
  className?: string;
145
+ /** Search/filter/CTA row rendered above the table, inside the same wrapper. */
146
+ toolbar?: ReactNode;
147
+ /** Controlled sort state — the table has no sort logic of its own. */
148
+ sortColumn?: string;
149
+ sortDirection?: SortDirection;
150
+ onSort?: (key: string) => void;
142
151
  }
143
- declare function DataTable<TRow extends Record<string, unknown>>({ columns, rows, rowKey, onRowClick, emptyMessage, className, }: IDataTableProps<TRow>): react.JSX.Element;
152
+ declare function DataTable<TRow extends Record<string, unknown>>({ columns, rows, rowKey, onRowClick, emptyMessage, className, toolbar, sortColumn, sortDirection, onSort, }: IDataTableProps<TRow>): react.JSX.Element;
144
153
 
145
154
  interface ITab {
146
155
  key: string;
@@ -224,4 +233,375 @@ interface ILoginCardProps {
224
233
  }
225
234
  declare function LoginCard({ logo, subtitle, children, className, }: ILoginCardProps): react.JSX.Element;
226
235
 
227
- export { Alert, type AlertVariant, AppShell, Badge, type BadgeStatus, Button, type ButtonSize, type ButtonVariant, Card, type ColumnAlign, DataTable, Drawer, type IAlertProps, type IAppShellProps, type IBadgeProps, type IButtonProps, type ICardProps, type IColumn, type IDataTableProps, type IDrawerProps, type IIconRailItemProps, type IIconRailProps, type IInputProps, type ILoginCardProps, type IModalProps, type INavItemProps, type INavSectionProps, type INavTab, type INavTabsProps, type IOverviewField, type IOverviewFieldProps, type IOverviewGridProps, type IPriorityBadgeProps, type IScopeTab, type IScopeTabsProps, type ISelectOption, type ISelectProps, type ISidebarProps, type ISidebarUser, type ITab, type ITabsProps, type ITicketStatusBadgeProps, type ITopBarProps, IconRail, IconRailItem, Input, LoginCard, Modal, NavItem, NavSection, NavTabs, OverviewField, OverviewGrid, PriorityBadge, type PriorityLevel, ScopeTabs, Select, Sidebar, Tabs, type TicketStatus, TicketStatusBadge, TopBar };
236
+ interface IOrgEntitySelectorProps extends ButtonHTMLAttributes<HTMLButtonElement> {
237
+ label: string;
238
+ }
239
+ declare function OrgEntitySelector({ label, className, ...props }: IOrgEntitySelectorProps): react.JSX.Element;
240
+
241
+ type ThemeMode = "light" | "dark";
242
+ interface IThemeToggleProps {
243
+ theme: ThemeMode;
244
+ onChange: (theme: ThemeMode) => void;
245
+ className?: string;
246
+ }
247
+ declare function ThemeToggle({ theme, onChange, className }: IThemeToggleProps): react.JSX.Element;
248
+
249
+ type AvatarSize = "sm" | "md";
250
+ type AvatarShape = "circle" | "square";
251
+ interface IAvatarProps {
252
+ initials: string;
253
+ size?: AvatarSize;
254
+ shape?: AvatarShape;
255
+ onClick?: () => void;
256
+ className?: string;
257
+ }
258
+ declare function Avatar({ initials, size, shape, onClick, className, }: IAvatarProps): react.JSX.Element;
259
+
260
+ interface INotificationsButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
261
+ unread?: boolean;
262
+ }
263
+ declare function NotificationsButton({ unread, className, ...props }: INotificationsButtonProps): react.JSX.Element;
264
+
265
+ interface IPlatformSwitcherApp {
266
+ icon: ReactNode;
267
+ title: string;
268
+ description: string;
269
+ href: string;
270
+ }
271
+ interface IPlatformSwitcherProps {
272
+ apps: IPlatformSwitcherApp[];
273
+ open: boolean;
274
+ onToggle: () => void;
275
+ className?: string;
276
+ }
277
+ declare function PlatformSwitcher({ apps, open, onToggle, className }: IPlatformSwitcherProps): react.JSX.Element;
278
+
279
+ interface IUnderlineTab {
280
+ key: string;
281
+ label: string;
282
+ disabled?: boolean;
283
+ }
284
+ interface IUnderlineTabsProps {
285
+ tabs: IUnderlineTab[];
286
+ active: string;
287
+ onChange: (key: string) => void;
288
+ className?: string;
289
+ }
290
+ /** Secondary page-wide nav for when the page already has an H1 and doesn't need pill weight. */
291
+ declare function UnderlineTabs({ tabs, active, onChange, className }: IUnderlineTabsProps): react.JSX.Element;
292
+
293
+ interface IFilterPillOption {
294
+ value: string;
295
+ label: string;
296
+ }
297
+ interface IFilterPillsProps {
298
+ options: IFilterPillOption[];
299
+ active: string;
300
+ onChange: (value: string) => void;
301
+ className?: string;
302
+ }
303
+ /** Nested sub-filter inside an already-active tab (e.g. underline tab -> pill sub-filter). */
304
+ declare function FilterPills({ options, active, onChange, className }: IFilterPillsProps): react.JSX.Element;
305
+
306
+ interface IPaginationProps {
307
+ page: number;
308
+ pageCount: number;
309
+ pageSize: number;
310
+ total: number;
311
+ pageSizeOptions?: number[];
312
+ onPageChange: (page: number) => void;
313
+ onPageSizeChange?: (size: number) => void;
314
+ className?: string;
315
+ }
316
+ declare function Pagination({ page, pageCount, pageSize, total, pageSizeOptions, onPageChange, onPageSizeChange, className, }: IPaginationProps): react.JSX.Element;
317
+
318
+ type EmptyStateVariant = "simple" | "rich" | "table-row";
319
+ interface IEmptyStateProps {
320
+ variant?: EmptyStateVariant;
321
+ icon?: ReactNode;
322
+ title?: string;
323
+ description?: string;
324
+ className?: string;
325
+ }
326
+ declare function EmptyState({ variant, icon, title, description, className, }: IEmptyStateProps): react.JSX.Element;
327
+
328
+ type KpiCardVariant = "ghost" | "tile";
329
+ interface IKpiCardProps {
330
+ label: string;
331
+ value: ReactNode;
332
+ icon?: ReactNode;
333
+ variant?: KpiCardVariant;
334
+ className?: string;
335
+ }
336
+ declare function KpiCard({ label, value, icon, variant, className, }: IKpiCardProps): react.JSX.Element;
337
+
338
+ interface IKpiGridCell {
339
+ label: string;
340
+ value: ReactNode;
341
+ sublabel?: string;
342
+ }
343
+ interface IKpiGridProps {
344
+ cells: IKpiGridCell[];
345
+ className?: string;
346
+ }
347
+ declare function KpiGrid({ cells, className }: IKpiGridProps): react.JSX.Element;
348
+
349
+ interface IKpiStripItem {
350
+ icon: ReactNode;
351
+ label: string;
352
+ value: ReactNode;
353
+ delta?: string;
354
+ }
355
+ interface IKpiStripProps {
356
+ items: IKpiStripItem[];
357
+ className?: string;
358
+ }
359
+ declare function KpiStrip({ items, className }: IKpiStripProps): react.JSX.Element;
360
+
361
+ interface IViewToggleOption {
362
+ value: string;
363
+ icon: ReactNode;
364
+ label: string;
365
+ }
366
+ interface IViewToggleProps {
367
+ value: string;
368
+ options: IViewToggleOption[];
369
+ onChange: (value: string) => void;
370
+ className?: string;
371
+ }
372
+ declare function ViewToggle({ value, options, onChange, className }: IViewToggleProps): react.JSX.Element;
373
+
374
+ interface IMetadataBadgeProps {
375
+ label: string;
376
+ value: string;
377
+ className?: string;
378
+ }
379
+ declare function MetadataBadge({ label, value, className }: IMetadataBadgeProps): react.JSX.Element;
380
+
381
+ interface IToastProps {
382
+ open: boolean;
383
+ message: ReactNode;
384
+ icon?: ReactNode;
385
+ className?: string;
386
+ }
387
+ declare function Toast({ open, message, icon, className }: IToastProps): react.JSX.Element | null;
388
+
389
+ type BannerVariant = "warning" | "blocking-error";
390
+ interface IBannerProps {
391
+ variant: BannerVariant;
392
+ title: ReactNode;
393
+ description?: ReactNode;
394
+ items?: ReactNode[];
395
+ className?: string;
396
+ }
397
+ /**
398
+ * Persistent, page-level surface — distinct from `Alert` (transient, inline).
399
+ * `warning` is amber and non-blocking; `blocking-error` is red and reserved for a
400
+ * state that actually blocks the action (see the house rule: two feedback colors,
401
+ * never mixed — the title/body text stays `foreground`, red lives only in the icon
402
+ * and border, since `--destructive` in small text fails AA contrast).
403
+ */
404
+ declare function Banner({ variant, title, description, items, className }: IBannerProps): react.JSX.Element;
405
+
406
+ type AccordionVariant = "plain" | "panel";
407
+ interface IAccordionProps {
408
+ question: ReactNode;
409
+ children: ReactNode;
410
+ defaultOpen?: boolean;
411
+ variant?: AccordionVariant;
412
+ className?: string;
413
+ }
414
+ declare function Accordion({ question, children, defaultOpen, variant, className, }: IAccordionProps): react.JSX.Element;
415
+
416
+ interface IReadOnlyFieldProps {
417
+ label: string;
418
+ value: string;
419
+ className?: string;
420
+ }
421
+ declare function ReadOnlyField({ label, value, className }: IReadOnlyFieldProps): react.JSX.Element;
422
+
423
+ type SearchIconPosition = "left" | "right";
424
+ interface ISearchFieldProps extends InputHTMLAttributes<HTMLInputElement> {
425
+ iconPosition?: SearchIconPosition;
426
+ }
427
+ declare function SearchField({ iconPosition, className, ...props }: ISearchFieldProps): react.JSX.Element;
428
+
429
+ interface IDateRangeTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
430
+ label: string;
431
+ }
432
+ declare function DateRangeTrigger({ label, className, ...props }: IDateRangeTriggerProps): react.JSX.Element;
433
+
434
+ interface IUploadDropzoneProps extends ButtonHTMLAttributes<HTMLButtonElement> {
435
+ label?: string;
436
+ error?: boolean;
437
+ }
438
+ declare function UploadDropzone({ label, error, className, ...props }: IUploadDropzoneProps): react.JSX.Element;
439
+
440
+ type StepStatus = "empty" | "partial" | "extracting" | "filled";
441
+ interface IStep {
442
+ key: string;
443
+ label: string;
444
+ sublabel?: string;
445
+ icon?: ReactNode;
446
+ status?: StepStatus;
447
+ }
448
+ interface IStepNavigatorProps {
449
+ title: string;
450
+ steps: IStep[];
451
+ activeKey: string;
452
+ onStepClick?: (key: string) => void;
453
+ progressPercent: number;
454
+ progressLabel?: string;
455
+ onSaveExit?: () => void;
456
+ onContinue?: () => void;
457
+ continueLabel?: string;
458
+ className?: string;
459
+ }
460
+ declare function StepNavigator({ title, steps, activeKey, onStepClick, progressPercent, progressLabel, onSaveExit, onContinue, continueLabel, className, }: IStepNavigatorProps): react.JSX.Element;
461
+
462
+ interface IDocumentTypeOption {
463
+ key: string;
464
+ label: string;
465
+ icon: ReactNode;
466
+ disabled?: boolean;
467
+ }
468
+ interface IDocumentTypeGridProps {
469
+ options: IDocumentTypeOption[];
470
+ value: string;
471
+ onChange: (key: string) => void;
472
+ className?: string;
473
+ }
474
+ declare function DocumentTypeGrid({ options, value, onChange, className }: IDocumentTypeGridProps): react.JSX.Element;
475
+
476
+ interface IFilePreviewCardProps {
477
+ fileName: string;
478
+ uploadedBy: string;
479
+ uploadedAt: string;
480
+ imageSrc?: string;
481
+ onPrev?: () => void;
482
+ onNext?: () => void;
483
+ hasPrev?: boolean;
484
+ hasNext?: boolean;
485
+ className?: string;
486
+ }
487
+ declare function FilePreviewCard({ fileName, uploadedBy, uploadedAt, imageSrc, onPrev, onNext, hasPrev, hasNext, className, }: IFilePreviewCardProps): react.JSX.Element;
488
+
489
+ interface IFileReviewRowProps {
490
+ fileName: string;
491
+ fileSize: string;
492
+ fileType: string;
493
+ classification: string;
494
+ location: string;
495
+ status: ReactNode;
496
+ onView?: () => void;
497
+ onChangeLocation?: () => void;
498
+ onApprove?: () => void;
499
+ onReject?: () => void;
500
+ className?: string;
501
+ }
502
+ declare function FileReviewRow({ fileName, fileSize, fileType, classification, location, status, onView, onChangeLocation, onApprove, onReject, className, }: IFileReviewRowProps): react.JSX.Element;
503
+
504
+ interface IRejectionReason {
505
+ key: string;
506
+ label: string;
507
+ }
508
+ interface IRejectionReasonPanelProps {
509
+ reasons: IRejectionReason[];
510
+ selectedReasons: string[];
511
+ onToggleReason: (key: string) => void;
512
+ note: string;
513
+ onNoteChange: (note: string) => void;
514
+ onCancel: () => void;
515
+ onConfirm: () => void;
516
+ className?: string;
517
+ }
518
+ declare function RejectionReasonPanel({ reasons, selectedReasons, onToggleReason, note, onNoteChange, onCancel, onConfirm, className, }: IRejectionReasonPanelProps): react.JSX.Element;
519
+
520
+ type QueueStatus = "processing" | "pending" | "editing" | "failed";
521
+ interface IQueueStatusBadgeProps extends HTMLAttributes<HTMLSpanElement> {
522
+ status: QueueStatus;
523
+ }
524
+ /** Entity/document processing state — its own family, never mixed with priority or ticket status. */
525
+ declare function QueueStatusBadge({ status, className, children, ...props }: IQueueStatusBadgeProps): react.JSX.Element;
526
+
527
+ interface ITicketCardField {
528
+ label: string;
529
+ value: string;
530
+ }
531
+ interface ITicketCardProps {
532
+ id: string;
533
+ signals?: ReactNode;
534
+ priority?: ReactNode;
535
+ status?: ReactNode;
536
+ fields: ITicketCardField[];
537
+ selected?: boolean;
538
+ closed?: boolean;
539
+ href?: string;
540
+ onClick?: () => void;
541
+ className?: string;
542
+ }
543
+ /** Canonical badge order: #id [channel] … [unread] [SLA] [priority] [status] — pass
544
+ * transient signals via `signals`, permanent state via `priority`/`status`. */
545
+ declare function TicketCard({ id, signals, priority, status, fields, selected, closed, href, onClick, className, }: ITicketCardProps): react.JSX.Element;
546
+
547
+ interface IChatMessage {
548
+ id: string | number;
549
+ author: string;
550
+ initials: string;
551
+ timestamp: string;
552
+ body: string;
553
+ mine: boolean;
554
+ }
555
+ interface IChatThreadProps {
556
+ messages: IChatMessage[];
557
+ className?: string;
558
+ }
559
+ /** Whoever is viewing the screen appears on the right (`--mine`); the other party
560
+ * on the left — so in the client's own view the client is on the right, and in the
561
+ * operator's view the operator is on the right. */
562
+ declare function ChatMessage({ author, initials, timestamp, body, mine }: IChatMessage): react.JSX.Element;
563
+ declare function ChatThread({ messages, className }: IChatThreadProps): react.JSX.Element;
564
+
565
+ interface IInternalNoteCardProps {
566
+ author: string;
567
+ timestamp: string;
568
+ children: ReactNode;
569
+ className?: string;
570
+ }
571
+ /** Visible operator-only, amber tint to differentiate from client-facing chat. */
572
+ declare function InternalNoteCard({ author, timestamp, children, className, }: IInternalNoteCardProps): react.JSX.Element;
573
+
574
+ interface IChannelBadgeProps {
575
+ icon: ReactNode;
576
+ label: string;
577
+ className?: string;
578
+ }
579
+ declare function ChannelBadge({ icon, label, className }: IChannelBadgeProps): react.JSX.Element;
580
+
581
+ type SignalVariant = "message" | "sla";
582
+ interface ISignalBadgeProps {
583
+ variant: SignalVariant;
584
+ children: ReactNode;
585
+ className?: string;
586
+ }
587
+ /** Transient auxiliary signal (unread count, SLA countdown) — never mixed with
588
+ * priority or ticket status on the same pill. */
589
+ declare function SignalBadge({ variant, children, className }: ISignalBadgeProps): react.JSX.Element;
590
+
591
+ interface ICategoryLabelProps {
592
+ label: string;
593
+ /** Any CSS color — sets the leading dot via the `--lbl-c` custom property. */
594
+ color?: string;
595
+ className?: string;
596
+ }
597
+ declare function CategoryLabel({ label, color, className }: ICategoryLabelProps): react.JSX.Element;
598
+
599
+ interface ILinkedAppIndicatorProps {
600
+ icon?: ReactNode;
601
+ appName?: string;
602
+ className?: string;
603
+ }
604
+ /** Table-cell indicator for an item connected to an external integration. */
605
+ declare function LinkedAppIndicator({ icon, appName, className }: ILinkedAppIndicatorProps): react.JSX.Element;
606
+
607
+ export { Accordion, type AccordionVariant, Alert, type AlertVariant, AppShell, Avatar, type AvatarShape, type AvatarSize, Badge, type BadgeStatus, Banner, type BannerVariant, Button, type ButtonSize, type ButtonVariant, Card, CategoryLabel, ChannelBadge, ChatMessage, ChatThread, type ColumnAlign, DataTable, DateRangeTrigger, DocumentTypeGrid, Drawer, EmptyState, type EmptyStateVariant, FilePreviewCard, FileReviewRow, FilterPills, type IAccordionProps, type IAlertProps, type IAppShellProps, type IAvatarProps, type IBadgeProps, type IBannerProps, type IButtonProps, type ICardProps, type ICategoryLabelProps, type IChannelBadgeProps, type IChatMessage, type IChatThreadProps, type IColumn, type IDataTableProps, type IDateRangeTriggerProps, type IDocumentTypeGridProps, type IDocumentTypeOption, type IDrawerProps, type IEmptyStateProps, type IFilePreviewCardProps, type IFileReviewRowProps, type IFilterPillOption, type IFilterPillsProps, type IIconRailItemProps, type IIconRailProps, type IInputProps, type IInternalNoteCardProps, type IKpiCardProps, type IKpiGridCell, type IKpiGridProps, type IKpiStripItem, type IKpiStripProps, type ILinkedAppIndicatorProps, type ILoginCardProps, type IMetadataBadgeProps, type IModalProps, type INavItemProps, type INavSectionProps, type INavTab, type INavTabsProps, type INotificationsButtonProps, type IOrgEntitySelectorProps, type IOverviewField, type IOverviewFieldProps, type IOverviewGridProps, type IPaginationProps, type IPlatformSwitcherApp, type IPlatformSwitcherProps, type IPriorityBadgeProps, type IQueueStatusBadgeProps, type IReadOnlyFieldProps, type IRejectionReason, type IRejectionReasonPanelProps, type IScopeTab, type IScopeTabsProps, type ISearchFieldProps, type ISelectOption, type ISelectProps, type ISidebarProps, type ISidebarUser, type ISignalBadgeProps, type IStep, type IStepNavigatorProps, type ITab, type ITabsProps, type IThemeToggleProps, type ITicketCardField, type ITicketCardProps, type ITicketStatusBadgeProps, type IToastProps, type ITopBarProps, type IUnderlineTab, type IUnderlineTabsProps, type IUploadDropzoneProps, type IViewToggleOption, type IViewToggleProps, IconRail, IconRailItem, Input, InternalNoteCard, KpiCard, type KpiCardVariant, KpiGrid, KpiStrip, LinkedAppIndicator, LoginCard, MetadataBadge, Modal, NavItem, NavSection, NavTabs, NotificationsButton, OrgEntitySelector, OverviewField, OverviewGrid, Pagination, PlatformSwitcher, PriorityBadge, type PriorityLevel, type QueueStatus, QueueStatusBadge, ReadOnlyField, RejectionReasonPanel, ScopeTabs, SearchField, type SearchIconPosition, Select, Sidebar, SignalBadge, type SignalVariant, StepNavigator, type StepStatus, Tabs, type ThemeMode, ThemeToggle, TicketCard, type TicketStatus, TicketStatusBadge, Toast, TopBar, UnderlineTabs, UploadDropzone, ViewToggle };