mywhy-ui 0.1.1 → 0.2.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
@@ -338,6 +338,98 @@ interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
338
338
  }
339
339
  declare function Sidebar({ sections, activeItem, onItemClick, collapsible, isCollapsed, onCollapsedChange, width, className, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
340
340
 
341
+ interface TableColumn {
342
+ key: string;
343
+ label: string;
344
+ width?: string;
345
+ render?: (value: any, row: any) => React.ReactNode;
346
+ align?: 'left' | 'center' | 'right';
347
+ }
348
+ interface TableProps {
349
+ columns: TableColumn[];
350
+ data: any[];
351
+ striped?: boolean;
352
+ hoverable?: boolean;
353
+ compact?: boolean;
354
+ className?: string;
355
+ emptyMessage?: string;
356
+ }
357
+ declare function Table({ columns, data, striped, hoverable, compact, className, emptyMessage, }: TableProps): react_jsx_runtime.JSX.Element;
358
+
359
+ interface PaginationProps {
360
+ current: number;
361
+ total: number;
362
+ onChange: (page: number) => void;
363
+ size?: 'sm' | 'md';
364
+ showInfo?: boolean;
365
+ maxVisible?: number;
366
+ className?: string;
367
+ }
368
+ declare function Pagination({ current, total, onChange, size, showInfo, maxVisible, className, }: PaginationProps): react_jsx_runtime.JSX.Element;
369
+
370
+ interface EmptyStateProps {
371
+ icon?: React.ReactNode;
372
+ title: string;
373
+ description?: string;
374
+ action?: {
375
+ label: string;
376
+ onClick: () => void;
377
+ };
378
+ className?: string;
379
+ }
380
+ declare function EmptyState({ icon, title, description, action, className, }: EmptyStateProps): react_jsx_runtime.JSX.Element;
381
+
382
+ type NumberInputSize = 'sm' | 'md' | 'lg';
383
+ interface NumberInputProps {
384
+ value: number;
385
+ onChange: (value: number) => void;
386
+ step?: number;
387
+ min?: number;
388
+ max?: number;
389
+ size?: NumberInputSize;
390
+ disabled?: boolean;
391
+ placeholder?: string;
392
+ className?: string;
393
+ }
394
+ declare function NumberInput({ value, onChange, step, min, max, size, disabled, placeholder, className, }: NumberInputProps): react_jsx_runtime.JSX.Element;
395
+
396
+ type CodeBlockLanguage = 'json' | 'javascript' | 'typescript' | 'python' | 'bash' | 'text';
397
+ interface CodeBlockProps {
398
+ code: string;
399
+ language?: CodeBlockLanguage;
400
+ copyable?: boolean;
401
+ numbered?: boolean;
402
+ maxHeight?: string;
403
+ className?: string;
404
+ }
405
+ declare function CodeBlock({ code, language, copyable, numbered, maxHeight, className, }: CodeBlockProps): react_jsx_runtime.JSX.Element;
406
+
407
+ type TimelineStatus = 'completed' | 'pending' | 'error' | 'in-progress';
408
+ interface TimelineItem {
409
+ id: string | number;
410
+ label: string;
411
+ description?: string;
412
+ status: TimelineStatus;
413
+ timestamp?: string | Date;
414
+ icon?: React.ReactNode;
415
+ }
416
+ interface TimelineProps {
417
+ items: TimelineItem[];
418
+ orientation?: 'vertical' | 'horizontal';
419
+ className?: string;
420
+ }
421
+ declare function Timeline({ items, orientation, className, }: TimelineProps): react_jsx_runtime.JSX.Element;
422
+
423
+ type KbdSize = 'xs' | 'sm' | 'md';
424
+ type KbdTheme = 'gray' | 'dark' | 'brand';
425
+ interface KbdProps {
426
+ keys: string | string[];
427
+ size?: KbdSize;
428
+ theme?: KbdTheme;
429
+ className?: string;
430
+ }
431
+ declare function Kbd({ keys, size, theme, className, }: KbdProps): react_jsx_runtime.JSX.Element;
432
+
341
433
  type RobotStatus = 'online' | 'offline' | 'error' | 'warning' | 'connecting' | 'unknown';
342
434
  interface StatusBadgeProps {
343
435
  status: RobotStatus;
@@ -381,4 +473,4 @@ declare function useToast(): {
381
473
  removeToast: (id: string) => void;
382
474
  };
383
475
 
384
- export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Progress, type ProgressProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
476
+ export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockLanguage, type CodeBlockProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, EmptyState, type EmptyStateProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, type KbdSize, type KbdTheme, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NumberInput, type NumberInputProps, type NumberInputSize, Pagination, type PaginationProps, Progress, type ProgressProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
package/dist/index.d.ts CHANGED
@@ -338,6 +338,98 @@ interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
338
338
  }
339
339
  declare function Sidebar({ sections, activeItem, onItemClick, collapsible, isCollapsed, onCollapsedChange, width, className, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
340
340
 
341
+ interface TableColumn {
342
+ key: string;
343
+ label: string;
344
+ width?: string;
345
+ render?: (value: any, row: any) => React.ReactNode;
346
+ align?: 'left' | 'center' | 'right';
347
+ }
348
+ interface TableProps {
349
+ columns: TableColumn[];
350
+ data: any[];
351
+ striped?: boolean;
352
+ hoverable?: boolean;
353
+ compact?: boolean;
354
+ className?: string;
355
+ emptyMessage?: string;
356
+ }
357
+ declare function Table({ columns, data, striped, hoverable, compact, className, emptyMessage, }: TableProps): react_jsx_runtime.JSX.Element;
358
+
359
+ interface PaginationProps {
360
+ current: number;
361
+ total: number;
362
+ onChange: (page: number) => void;
363
+ size?: 'sm' | 'md';
364
+ showInfo?: boolean;
365
+ maxVisible?: number;
366
+ className?: string;
367
+ }
368
+ declare function Pagination({ current, total, onChange, size, showInfo, maxVisible, className, }: PaginationProps): react_jsx_runtime.JSX.Element;
369
+
370
+ interface EmptyStateProps {
371
+ icon?: React.ReactNode;
372
+ title: string;
373
+ description?: string;
374
+ action?: {
375
+ label: string;
376
+ onClick: () => void;
377
+ };
378
+ className?: string;
379
+ }
380
+ declare function EmptyState({ icon, title, description, action, className, }: EmptyStateProps): react_jsx_runtime.JSX.Element;
381
+
382
+ type NumberInputSize = 'sm' | 'md' | 'lg';
383
+ interface NumberInputProps {
384
+ value: number;
385
+ onChange: (value: number) => void;
386
+ step?: number;
387
+ min?: number;
388
+ max?: number;
389
+ size?: NumberInputSize;
390
+ disabled?: boolean;
391
+ placeholder?: string;
392
+ className?: string;
393
+ }
394
+ declare function NumberInput({ value, onChange, step, min, max, size, disabled, placeholder, className, }: NumberInputProps): react_jsx_runtime.JSX.Element;
395
+
396
+ type CodeBlockLanguage = 'json' | 'javascript' | 'typescript' | 'python' | 'bash' | 'text';
397
+ interface CodeBlockProps {
398
+ code: string;
399
+ language?: CodeBlockLanguage;
400
+ copyable?: boolean;
401
+ numbered?: boolean;
402
+ maxHeight?: string;
403
+ className?: string;
404
+ }
405
+ declare function CodeBlock({ code, language, copyable, numbered, maxHeight, className, }: CodeBlockProps): react_jsx_runtime.JSX.Element;
406
+
407
+ type TimelineStatus = 'completed' | 'pending' | 'error' | 'in-progress';
408
+ interface TimelineItem {
409
+ id: string | number;
410
+ label: string;
411
+ description?: string;
412
+ status: TimelineStatus;
413
+ timestamp?: string | Date;
414
+ icon?: React.ReactNode;
415
+ }
416
+ interface TimelineProps {
417
+ items: TimelineItem[];
418
+ orientation?: 'vertical' | 'horizontal';
419
+ className?: string;
420
+ }
421
+ declare function Timeline({ items, orientation, className, }: TimelineProps): react_jsx_runtime.JSX.Element;
422
+
423
+ type KbdSize = 'xs' | 'sm' | 'md';
424
+ type KbdTheme = 'gray' | 'dark' | 'brand';
425
+ interface KbdProps {
426
+ keys: string | string[];
427
+ size?: KbdSize;
428
+ theme?: KbdTheme;
429
+ className?: string;
430
+ }
431
+ declare function Kbd({ keys, size, theme, className, }: KbdProps): react_jsx_runtime.JSX.Element;
432
+
341
433
  type RobotStatus = 'online' | 'offline' | 'error' | 'warning' | 'connecting' | 'unknown';
342
434
  interface StatusBadgeProps {
343
435
  status: RobotStatus;
@@ -381,4 +473,4 @@ declare function useToast(): {
381
473
  removeToast: (id: string) => void;
382
474
  };
383
475
 
384
- export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Progress, type ProgressProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
476
+ export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockLanguage, type CodeBlockProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, EmptyState, type EmptyStateProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, type KbdSize, type KbdTheme, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NumberInput, type NumberInputProps, type NumberInputSize, Pagination, type PaginationProps, Progress, type ProgressProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
package/dist/index.js CHANGED
@@ -539,7 +539,7 @@ function MultiSelect({
539
539
  document.removeEventListener("mousedown", handleClickOutside);
540
540
  };
541
541
  }, [isOpen]);
542
- const sizeClasses11 = {
542
+ const sizeClasses13 = {
543
543
  sm: "h-7 px-2 text-sm",
544
544
  md: "h-8 px-3 text-base",
545
545
  lg: "h-9 px-4 text-base"
@@ -557,7 +557,7 @@ function MultiSelect({
557
557
  "focus-within:ring-2 focus-within:ring-brand focus-within:ring-offset-1",
558
558
  disabled ? "bg-surface-gray opacity-50 cursor-not-allowed" : "bg-white",
559
559
  error ? "border-danger-border" : "border-outline",
560
- sizeClasses11[size]
560
+ sizeClasses13[size]
561
561
  ].join(" "),
562
562
  onClick: () => !disabled && setIsOpen(!isOpen),
563
563
  children: [
@@ -1607,6 +1607,412 @@ function Sidebar({
1607
1607
  }
1608
1608
  );
1609
1609
  }
1610
+ function Table({
1611
+ columns,
1612
+ data,
1613
+ striped = true,
1614
+ hoverable = true,
1615
+ compact = false,
1616
+ className = "",
1617
+ emptyMessage = "No data"
1618
+ }) {
1619
+ if (data.length === 0) {
1620
+ return /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-ink-faint text-sm", children: emptyMessage });
1621
+ }
1622
+ return /* @__PURE__ */ jsx("div", { className: `overflow-x-auto border border-outline rounded-lg ${className}`, children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
1623
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: "bg-surface-gray border-b border-outline", children: columns.map((col) => /* @__PURE__ */ jsx(
1624
+ "th",
1625
+ {
1626
+ style: { width: col.width },
1627
+ className: `
1628
+ ${compact ? "px-3 py-2" : "px-4 py-3"}
1629
+ text-left text-xs font-semibold text-ink-faint uppercase tracking-wide
1630
+ ${col.align === "center" ? "text-center" : col.align === "right" ? "text-right" : "text-left"}
1631
+ `,
1632
+ children: col.label
1633
+ },
1634
+ col.key
1635
+ )) }) }),
1636
+ /* @__PURE__ */ jsx("tbody", { children: data.map((row, rowIdx) => /* @__PURE__ */ jsx(
1637
+ "tr",
1638
+ {
1639
+ className: `
1640
+ border-b border-outline last:border-b-0
1641
+ ${striped && rowIdx % 2 === 1 ? "bg-surface-gray/50" : ""}
1642
+ ${hoverable ? "hover:bg-surface-overlay transition-colors" : ""}
1643
+ `,
1644
+ children: columns.map((col) => /* @__PURE__ */ jsx(
1645
+ "td",
1646
+ {
1647
+ style: { width: col.width },
1648
+ className: `
1649
+ ${compact ? "px-3 py-2" : "px-4 py-3"}
1650
+ text-sm text-ink
1651
+ ${col.align === "center" ? "text-center" : col.align === "right" ? "text-right" : "text-left"}
1652
+ `,
1653
+ children: col.render ? col.render(row[col.key], row) : row[col.key]
1654
+ },
1655
+ `${rowIdx}-${col.key}`
1656
+ ))
1657
+ },
1658
+ rowIdx
1659
+ )) })
1660
+ ] }) });
1661
+ }
1662
+ var ChevronLeftIcon = ({ size }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" }) });
1663
+ var ChevronRightIcon = ({ size }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) });
1664
+ function Pagination({
1665
+ current,
1666
+ total,
1667
+ onChange,
1668
+ size = "md",
1669
+ showInfo = true,
1670
+ maxVisible = 5,
1671
+ className = ""
1672
+ }) {
1673
+ const sizeClass = size === "sm" ? "text-xs px-2 py-1" : "text-sm px-3 py-2";
1674
+ const getPages = () => {
1675
+ const pages2 = [];
1676
+ const halfVisible = Math.floor(maxVisible / 2);
1677
+ let start = Math.max(1, current - halfVisible);
1678
+ let end = Math.min(total, current + halfVisible);
1679
+ if (start === 1) {
1680
+ end = Math.min(total, maxVisible);
1681
+ } else if (end === total) {
1682
+ start = Math.max(1, total - maxVisible + 1);
1683
+ }
1684
+ if (start > 1) pages2.push(1);
1685
+ if (start > 2) pages2.push("...");
1686
+ for (let i = start; i <= end; i++) {
1687
+ pages2.push(i);
1688
+ }
1689
+ if (end < total - 1) pages2.push("...");
1690
+ if (end < total) pages2.push(total);
1691
+ return pages2;
1692
+ };
1693
+ const pages = getPages();
1694
+ return /* @__PURE__ */ jsxs("div", { className: `flex items-center gap-2 ${className}`, children: [
1695
+ showInfo && /* @__PURE__ */ jsxs("span", { className: "text-xs text-ink-faint", children: [
1696
+ "Page ",
1697
+ current,
1698
+ " of ",
1699
+ total
1700
+ ] }),
1701
+ /* @__PURE__ */ jsx(
1702
+ "button",
1703
+ {
1704
+ onClick: () => onChange(Math.max(1, current - 1)),
1705
+ disabled: current === 1,
1706
+ className: `
1707
+ flex items-center justify-center rounded border border-outline
1708
+ hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed disabled:hover:bg-transparent
1709
+ transition-colors ${sizeClass}
1710
+ `,
1711
+ title: "Previous page",
1712
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: size === "sm" ? 12 : 16 })
1713
+ }
1714
+ ),
1715
+ /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: pages.map(
1716
+ (page, i) => page === "..." ? /* @__PURE__ */ jsx("span", { className: "px-2 text-ink-faint", children: "..." }, `ellipsis-${i}`) : /* @__PURE__ */ jsx(
1717
+ "button",
1718
+ {
1719
+ onClick: () => onChange(page),
1720
+ className: `
1721
+ flex items-center justify-center rounded border
1722
+ transition-colors ${sizeClass}
1723
+ ${current === page ? "bg-brand text-white border-brand" : "border-outline hover:bg-surface-overlay"}
1724
+ `,
1725
+ children: page
1726
+ },
1727
+ page
1728
+ )
1729
+ ) }),
1730
+ /* @__PURE__ */ jsx(
1731
+ "button",
1732
+ {
1733
+ onClick: () => onChange(Math.min(total, current + 1)),
1734
+ disabled: current === total,
1735
+ className: `
1736
+ flex items-center justify-center rounded border border-outline
1737
+ hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed disabled:hover:bg-transparent
1738
+ transition-colors ${sizeClass}
1739
+ `,
1740
+ title: "Next page",
1741
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: size === "sm" ? 12 : 16 })
1742
+ }
1743
+ )
1744
+ ] });
1745
+ }
1746
+ function EmptyState({
1747
+ icon,
1748
+ title,
1749
+ description,
1750
+ action,
1751
+ className = ""
1752
+ }) {
1753
+ return /* @__PURE__ */ jsxs("div", { className: `flex flex-col items-center justify-center py-12 px-4 ${className}`, children: [
1754
+ icon && /* @__PURE__ */ jsx("div", { className: "text-4xl mb-4", children: icon }),
1755
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-ink mb-2", children: title }),
1756
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-ink-faint mb-6 text-center max-w-sm", children: description }),
1757
+ action && /* @__PURE__ */ jsx(
1758
+ "button",
1759
+ {
1760
+ onClick: action.onClick,
1761
+ className: "px-4 py-2 bg-brand text-white rounded-md hover:bg-brand-600 transition-colors text-sm font-medium",
1762
+ children: action.label
1763
+ }
1764
+ )
1765
+ ] });
1766
+ }
1767
+ var ChevronUpIcon = ({ size }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "18 15 12 9 6 15" }) });
1768
+ var ChevronDownIcon = ({ size }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) });
1769
+ var sizeClasses10 = {
1770
+ sm: "text-xs px-2 py-1 h-8",
1771
+ md: "text-sm px-3 py-2 h-10",
1772
+ lg: "text-base px-4 py-2.5 h-12"
1773
+ };
1774
+ function NumberInput({
1775
+ value,
1776
+ onChange,
1777
+ step = 1,
1778
+ min,
1779
+ max,
1780
+ size = "md",
1781
+ disabled = false,
1782
+ placeholder,
1783
+ className = ""
1784
+ }) {
1785
+ const [isEditing, setIsEditing] = useState(false);
1786
+ const handleIncrement = () => {
1787
+ const newValue = value + step;
1788
+ if (max === void 0 || newValue <= max) {
1789
+ onChange(newValue);
1790
+ }
1791
+ };
1792
+ const handleDecrement = () => {
1793
+ const newValue = value - step;
1794
+ if (min === void 0 || newValue >= min) {
1795
+ onChange(newValue);
1796
+ }
1797
+ };
1798
+ const handleInputChange = (e) => {
1799
+ const newValue = parseFloat(e.target.value);
1800
+ if (!isNaN(newValue)) {
1801
+ let val = newValue;
1802
+ if (min !== void 0 && val < min) val = min;
1803
+ if (max !== void 0 && val > max) val = max;
1804
+ onChange(val);
1805
+ }
1806
+ };
1807
+ return /* @__PURE__ */ jsxs("div", { className: `relative inline-flex items-center border border-outline rounded-md bg-surface ${className}`, children: [
1808
+ /* @__PURE__ */ jsx(
1809
+ "input",
1810
+ {
1811
+ type: "number",
1812
+ value,
1813
+ onChange: handleInputChange,
1814
+ onFocus: () => setIsEditing(true),
1815
+ onBlur: () => setIsEditing(false),
1816
+ disabled,
1817
+ placeholder,
1818
+ step,
1819
+ min,
1820
+ max,
1821
+ className: `
1822
+ flex-1 bg-transparent outline-none text-ink disabled:text-ink-faint disabled:cursor-not-allowed
1823
+ ${sizeClasses10[size]}
1824
+ `
1825
+ }
1826
+ ),
1827
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col border-l border-outline", children: [
1828
+ /* @__PURE__ */ jsx(
1829
+ "button",
1830
+ {
1831
+ onClick: handleIncrement,
1832
+ disabled: disabled || max !== void 0 && value >= max,
1833
+ className: "flex-1 px-1 hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed transition-colors",
1834
+ title: "Increment",
1835
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { size: size === "sm" ? 12 : size === "md" ? 14 : 16 })
1836
+ }
1837
+ ),
1838
+ /* @__PURE__ */ jsx(
1839
+ "button",
1840
+ {
1841
+ onClick: handleDecrement,
1842
+ disabled: disabled || min !== void 0 && value <= min,
1843
+ className: "flex-1 px-1 hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed transition-colors border-t border-outline",
1844
+ title: "Decrement",
1845
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: size === "sm" ? 12 : size === "md" ? 14 : 16 })
1846
+ }
1847
+ )
1848
+ ] })
1849
+ ] });
1850
+ }
1851
+ var CopyIcon = ({ size }) => /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1852
+ /* @__PURE__ */ jsx("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }),
1853
+ /* @__PURE__ */ jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" })
1854
+ ] });
1855
+ var CheckIcon = ({ size, className }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className, children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" }) });
1856
+ function CodeBlock({
1857
+ code,
1858
+ language = "text",
1859
+ copyable = true,
1860
+ numbered = false,
1861
+ maxHeight = "max-h-96",
1862
+ className = ""
1863
+ }) {
1864
+ const [copied, setCopied] = useState(false);
1865
+ const handleCopy = async () => {
1866
+ try {
1867
+ await navigator.clipboard.writeText(code);
1868
+ setCopied(true);
1869
+ setTimeout(() => setCopied(false), 2e3);
1870
+ } catch (err) {
1871
+ console.error("Failed to copy:", err);
1872
+ }
1873
+ };
1874
+ const lines = code.split("\n");
1875
+ return /* @__PURE__ */ jsxs("div", { className: `relative bg-ink rounded-lg overflow-hidden border border-outline ${className}`, children: [
1876
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between bg-surface-gray px-4 py-2 border-b border-outline", children: [
1877
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-ink-faint font-mono uppercase", children: language }),
1878
+ copyable && /* @__PURE__ */ jsx(
1879
+ "button",
1880
+ {
1881
+ onClick: handleCopy,
1882
+ className: "p-1 rounded hover:bg-surface-overlay transition-colors text-ink-faint hover:text-ink",
1883
+ title: "Copy to clipboard",
1884
+ children: copied ? /* @__PURE__ */ jsx("span", { style: { color: "currentColor" }, className: "text-status-online", children: /* @__PURE__ */ jsx(CheckIcon, { size: 14 }) }) : /* @__PURE__ */ jsx(CopyIcon, { size: 14 })
1885
+ }
1886
+ )
1887
+ ] }),
1888
+ /* @__PURE__ */ jsx("div", { className: `overflow-auto ${maxHeight}`, children: /* @__PURE__ */ jsx("pre", { className: "p-4 text-sm font-mono text-sky-100", children: numbered ? /* @__PURE__ */ jsx(Fragment, { children: lines.map((line, i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
1889
+ /* @__PURE__ */ jsx("span", { className: "text-ink-faint select-none", children: String(i + 1).padStart(3, " ") }),
1890
+ /* @__PURE__ */ jsx("span", { children: line })
1891
+ ] }, i)) }) : code }) })
1892
+ ] });
1893
+ }
1894
+ var statusColors = {
1895
+ completed: {
1896
+ dot: "bg-status-online border-status-online",
1897
+ line: "bg-status-online",
1898
+ text: "text-status-online"
1899
+ },
1900
+ pending: {
1901
+ dot: "bg-ink-light border-ink-light",
1902
+ line: "bg-ink-faint",
1903
+ text: "text-ink-faint"
1904
+ },
1905
+ error: {
1906
+ dot: "bg-danger-icon border-danger-icon",
1907
+ line: "bg-danger-icon",
1908
+ text: "text-danger-text"
1909
+ },
1910
+ "in-progress": {
1911
+ dot: "bg-brand border-brand",
1912
+ line: "bg-brand",
1913
+ text: "text-brand"
1914
+ }
1915
+ };
1916
+ function Timeline({
1917
+ items,
1918
+ orientation = "vertical",
1919
+ className = ""
1920
+ }) {
1921
+ if (orientation === "vertical") {
1922
+ return /* @__PURE__ */ jsx("div", { className: `space-y-4 ${className}`, children: items.map((item, index) => {
1923
+ const colors = statusColors[item.status];
1924
+ const isLast = index === items.length - 1;
1925
+ return /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
1926
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
1927
+ /* @__PURE__ */ jsx(
1928
+ "div",
1929
+ {
1930
+ className: `
1931
+ w-4 h-4 rounded-full border-2 flex-shrink-0
1932
+ flex items-center justify-center bg-white
1933
+ ${colors.dot}
1934
+ `,
1935
+ children: item.icon && /* @__PURE__ */ jsx("span", { className: "text-white text-2xs", children: item.icon })
1936
+ }
1937
+ ),
1938
+ !isLast && /* @__PURE__ */ jsx("div", { className: `w-0.5 h-12 ${colors.line}` })
1939
+ ] }),
1940
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 py-1", children: [
1941
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1942
+ /* @__PURE__ */ jsx("h4", { className: `font-semibold text-sm ${colors.text}`, children: item.label }),
1943
+ item.timestamp && /* @__PURE__ */ jsx("span", { className: "text-xs text-ink-faint", children: typeof item.timestamp === "string" ? item.timestamp : new Date(item.timestamp).toLocaleTimeString("en-GB", {
1944
+ hour12: false,
1945
+ hour: "2-digit",
1946
+ minute: "2-digit",
1947
+ second: "2-digit"
1948
+ }) })
1949
+ ] }),
1950
+ item.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-ink-faint mt-1", children: item.description })
1951
+ ] })
1952
+ ] }, item.id);
1953
+ }) });
1954
+ }
1955
+ return /* @__PURE__ */ jsx("div", { className: `flex gap-4 overflow-x-auto pb-2 ${className}`, children: items.map((item, index) => {
1956
+ const colors = statusColors[item.status];
1957
+ index === items.length - 1;
1958
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center flex-shrink-0 gap-2 min-w-fit", children: [
1959
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1960
+ index > 0 && /* @__PURE__ */ jsx("div", { className: `h-0.5 w-6 ${statusColors[items[index - 1].status].line}` }),
1961
+ /* @__PURE__ */ jsx(
1962
+ "div",
1963
+ {
1964
+ className: `
1965
+ w-5 h-5 rounded-full border-2 flex items-center justify-center bg-white
1966
+ ${colors.dot}
1967
+ `,
1968
+ children: item.icon && /* @__PURE__ */ jsx("span", { className: "text-white text-2xs", children: item.icon })
1969
+ }
1970
+ )
1971
+ ] }),
1972
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
1973
+ /* @__PURE__ */ jsx("p", { className: `text-xs font-semibold ${colors.text}`, children: item.label }),
1974
+ item.timestamp && /* @__PURE__ */ jsx("p", { className: "text-2xs text-ink-faint", children: typeof item.timestamp === "string" ? item.timestamp : new Date(item.timestamp).toLocaleTimeString("en-GB", {
1975
+ hour12: false,
1976
+ hour: "2-digit",
1977
+ minute: "2-digit"
1978
+ }) })
1979
+ ] })
1980
+ ] }, item.id);
1981
+ }) });
1982
+ }
1983
+ var sizeClasses11 = {
1984
+ xs: "text-xs px-1.5 py-0.5 min-w-5 h-5",
1985
+ sm: "text-xs px-2 py-1 min-w-6 h-6",
1986
+ md: "text-sm px-2.5 py-1.5 min-w-8 h-8"
1987
+ };
1988
+ var themeClasses5 = {
1989
+ gray: "bg-surface-gray border-outline text-ink",
1990
+ dark: "bg-ink text-white border-ink-faint",
1991
+ brand: "bg-brand border-brand text-white"
1992
+ };
1993
+ function Kbd({
1994
+ keys,
1995
+ size = "sm",
1996
+ theme = "gray",
1997
+ className = ""
1998
+ }) {
1999
+ const keyArray = Array.isArray(keys) ? keys : [keys];
2000
+ return /* @__PURE__ */ jsx("span", { className: `inline-flex items-center gap-1 ${className}`, children: keyArray.map((key, i) => /* @__PURE__ */ jsxs(React9.Fragment, { children: [
2001
+ /* @__PURE__ */ jsx(
2002
+ "kbd",
2003
+ {
2004
+ className: `
2005
+ inline-flex items-center justify-center rounded font-mono font-medium
2006
+ border border-b-2 shadow-sm
2007
+ ${sizeClasses11[size]}
2008
+ ${themeClasses5[theme]}
2009
+ `,
2010
+ children: key
2011
+ }
2012
+ ),
2013
+ i < keyArray.length - 1 && /* @__PURE__ */ jsx("span", { className: "text-ink-faint text-xs", children: "+" })
2014
+ ] }, key)) });
2015
+ }
1610
2016
  var statusConfig = {
1611
2017
  online: {
1612
2018
  label: "Online",
@@ -1681,7 +2087,7 @@ function StatusBadge({
1681
2087
  }
1682
2088
  );
1683
2089
  }
1684
- var sizeClasses10 = {
2090
+ var sizeClasses12 = {
1685
2091
  sm: "text-xs gap-1.5",
1686
2092
  md: "text-sm gap-2",
1687
2093
  lg: "text-base gap-2"
@@ -1700,7 +2106,7 @@ function ConnectionIndicator({
1700
2106
  className = ""
1701
2107
  }) {
1702
2108
  const status = connected ? "online" : "offline";
1703
- return /* @__PURE__ */ jsxs("div", { className: `inline-flex items-center ${sizeClasses10[size]} ${className}`, children: [
2109
+ return /* @__PURE__ */ jsxs("div", { className: `inline-flex items-center ${sizeClasses12[size]} ${className}`, children: [
1704
2110
  /* @__PURE__ */ jsx(
1705
2111
  StatusBadge,
1706
2112
  {
@@ -1747,6 +2153,6 @@ function useToast() {
1747
2153
  return { toasts, addToast, removeToast };
1748
2154
  }
1749
2155
 
1750
- export { Alert, Avatar, Badge, Breadcrumbs, Button, Card, Checkbox, ConnectionIcon, ConnectionIndicator, DatePicker, Dialog, Dropdown, FileUploader, FormControl, Input, Link, MultiSelect, Progress, Rating, Select, Sidebar, Slider, Spinner, StatusBadge, Switch, Tabs, Textarea, TimePicker, Toast, ToastContainer, Tooltip, useDisclosure, useToast };
2156
+ export { Alert, Avatar, Badge, Breadcrumbs, Button, Card, Checkbox, CodeBlock, ConnectionIcon, ConnectionIndicator, DatePicker, Dialog, Dropdown, EmptyState, FileUploader, FormControl, Input, Kbd, Link, MultiSelect, NumberInput, Pagination, Progress, Rating, Select, Sidebar, Slider, Spinner, StatusBadge, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toast, ToastContainer, Tooltip, useDisclosure, useToast };
1751
2157
  //# sourceMappingURL=index.js.map
1752
2158
  //# sourceMappingURL=index.js.map