tembro 4.0.0 → 4.1.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/charts/charts.d.ts +16 -5
  3. package/dist/components/display/chat.cjs +1 -0
  4. package/dist/components/display/chat.d.ts +94 -0
  5. package/dist/components/display/chat.js +1 -0
  6. package/dist/components/display/index.d.ts +1 -0
  7. package/dist/components/display/kanban.d.ts +33 -1
  8. package/dist/components/layout/sidebar.d.ts +24 -2
  9. package/dist/components/modern/rich-text-editor.d.ts +13 -1
  10. package/dist/components/theme-provider.d.ts +19 -6
  11. package/dist/components/ui/badge/index.d.ts +8 -2
  12. package/dist/src/components/charts/charts.cjs +1 -1
  13. package/dist/src/components/charts/charts.js +343 -252
  14. package/dist/src/components/display/activity-feed.cjs +1 -1
  15. package/dist/src/components/display/activity-feed.js +4 -1
  16. package/dist/src/components/display/chat.cjs +1 -0
  17. package/dist/src/components/display/chat.js +372 -0
  18. package/dist/src/components/display/index.cjs +1 -1
  19. package/dist/src/components/display/index.js +17 -16
  20. package/dist/src/components/display/kanban.cjs +1 -1
  21. package/dist/src/components/display/kanban.js +321 -176
  22. package/dist/src/components/display/timeline.cjs +1 -1
  23. package/dist/src/components/display/timeline.js +5 -5
  24. package/dist/src/components/inputs/tag-input.cjs +1 -1
  25. package/dist/src/components/inputs/tag-input.js +6 -2
  26. package/dist/src/components/layout/index.cjs +1 -1
  27. package/dist/src/components/layout/index.js +4 -4
  28. package/dist/src/components/layout/public.cjs +1 -1
  29. package/dist/src/components/layout/public.js +4 -4
  30. package/dist/src/components/layout/sidebar.cjs +1 -1
  31. package/dist/src/components/layout/sidebar.js +326 -228
  32. package/dist/src/components/layout/workspace-layout.cjs +1 -1
  33. package/dist/src/components/layout/workspace-layout.js +3 -3
  34. package/dist/src/components/modern/rich-text-editor.cjs +1 -1
  35. package/dist/src/components/modern/rich-text-editor.js +216 -89
  36. package/dist/src/components/theme-provider.cjs +1 -1
  37. package/dist/src/components/theme-provider.js +58 -36
  38. package/dist/src/components/ui/badge/index.cjs +1 -1
  39. package/dist/src/components/ui/badge/index.js +59 -47
  40. package/dist/src/components/ui/input/clearable.cjs +1 -1
  41. package/dist/src/components/ui/input/clearable.js +5 -2
  42. package/dist/src/components/ui/input/primitive.cjs +1 -1
  43. package/dist/src/components/ui/input/primitive.js +1 -1
  44. package/dist/src/index.cjs +1 -1
  45. package/dist/src/index.js +87 -86
  46. package/dist/src/public-component-surface.cjs +1 -1
  47. package/dist/src/public-component-surface.js +5 -0
  48. package/package.json +1 -1
  49. package/packages/cli/dist/index.cjs +3 -3
  50. package/packages/cli/vendor/src/components/charts/charts.tsx +55 -15
  51. package/packages/cli/vendor/src/components/display/activity-feed.tsx +1 -1
  52. package/packages/cli/vendor/src/components/display/chat.tsx +237 -0
  53. package/packages/cli/vendor/src/components/display/index.ts +1 -0
  54. package/packages/cli/vendor/src/components/display/kanban.tsx +219 -72
  55. package/packages/cli/vendor/src/components/display/timeline.tsx +10 -10
  56. package/packages/cli/vendor/src/components/inputs/tag-input.tsx +3 -2
  57. package/packages/cli/vendor/src/components/layout/sidebar.tsx +212 -51
  58. package/packages/cli/vendor/src/components/layout/workspace-layout.tsx +3 -3
  59. package/packages/cli/vendor/src/components/modern/rich-text-editor.tsx +115 -32
  60. package/packages/cli/vendor/src/components/theme-provider.tsx +82 -36
  61. package/packages/cli/vendor/src/components/ui/badge/index.tsx +29 -8
  62. package/packages/cli/vendor/src/components/ui/input/clearable.tsx +2 -2
  63. package/packages/cli/vendor/src/components/ui/input/primitive.tsx +1 -1
  64. package/packages/cli/vendor/src/public-component-surface.ts +1 -0
  65. package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
  66. package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
  67. package/packages/cli/vendor/templates/styles/globals.css +136 -33
  68. package/registry.json +3 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 4.1.0 - 2026-07-17
6
+
7
+ ### Added
8
+
9
+ - Added reusable chat workspace primitives for conversation lists, messages, replies, attachments, reactions, typing states, delivery status, and message composition.
10
+ - Added named theme support with `data-theme`, color-scheme mapping, system mode, theme cycling, and built-in light, dark, and dim presets.
11
+ - Added Kanban WIP limits, controlled selection, rich task metadata, add-card/add-column actions, density, column sizing, and move policies.
12
+
13
+ ### Changed
14
+
15
+ - Expanded Sidebar with inset/floating/offcanvas variants, search, persistence, keyboard collapse, item actions, accessible collapsed labels, and corrected mobile drawer geometry.
16
+ - Expanded RichTextEditor with grouped responsive controls, headings, block tools, link actions, format clearing, sticky/compact toolbar modes, and word/character counts.
17
+ - Improved Badge dot, pulse, avatar, icon, remove, focus, and interactive states; centered tag and clear icons and removed duplicate native search cancel controls.
18
+ - Corrected ActivityFeed and Timeline connector alignment and strengthened viewport-only sidebar/main scrolling behavior.
19
+
20
+ ## 4.0.1 - 2026-07-17
21
+
22
+ ### Changed
23
+
24
+ - Fixed viewport workspaces so the document never competes with `WorkspaceMain` for vertical scrolling.
25
+ - Rebalanced light and dark surface, border, elevation, hover, active, and keyboard-focus tokens.
26
+ - Added multi-series grouped and stacked bars, multi-series line and gradient area charts, legends, curves, dots, and accessible series tables.
27
+ - Improved responsive chart and dashboard composition while preserving the existing single-series API.
28
+
5
29
  ## 4.0.0 - 2026-07-17
6
30
 
7
31
  ### Added
@@ -12,6 +12,7 @@ export type ChartSeries = {
12
12
  data: number[];
13
13
  color?: string;
14
14
  };
15
+ export type ChartCurve = "linear" | "monotone" | "natural" | "step";
15
16
  export type ChartAxisLabel = string | number | React.ReactNode;
16
17
  export type ChartSize = "sm" | "md" | "lg";
17
18
  export type ChartState = "ready" | "loading" | "empty";
@@ -41,7 +42,8 @@ export type ChartFrameProps = React.ComponentProps<typeof Card> & {
41
42
  };
42
43
  declare function ChartFrame({ title, description, action, state, emptyLabel, className, children, ...props }: ChartFrameProps): React.JSX.Element;
43
44
  export type BarChartProps = React.ComponentProps<"div"> & {
44
- data: ChartDatum[];
45
+ data?: ChartDatum[];
46
+ series?: ChartSeries[];
45
47
  size?: ChartSize;
46
48
  max?: number;
47
49
  showLabels?: boolean;
@@ -54,10 +56,14 @@ export type BarChartProps = React.ComponentProps<"div"> & {
54
56
  barClassName?: string;
55
57
  domain?: ChartDomain;
56
58
  ariaLabel?: string;
59
+ stacked?: boolean;
60
+ showLegend?: boolean;
61
+ barRadius?: number;
57
62
  };
58
- declare function BarChart({ data, size, max, showLabels, showValues, showGrid, showTooltip, valueFormatter, state, emptyLabel, barClassName, domain, ariaLabel, className, ...props }: BarChartProps): React.JSX.Element;
63
+ declare function BarChart({ data, series, size, max, showLabels, showValues, showGrid, showTooltip, valueFormatter, state, emptyLabel, barClassName, domain, ariaLabel, stacked, showLegend, barRadius, className, ...props }: BarChartProps): React.JSX.Element;
59
64
  export type LineChartProps = Omit<React.ComponentProps<"div">, "children"> & {
60
- values: number[];
65
+ values?: number[];
66
+ series?: ChartSeries[];
61
67
  size?: ChartSize;
62
68
  width?: number;
63
69
  height?: number;
@@ -72,10 +78,15 @@ export type LineChartProps = Omit<React.ComponentProps<"div">, "children"> & {
72
78
  emptyLabel?: React.ReactNode;
73
79
  domain?: ChartDomain;
74
80
  ariaLabel?: string;
81
+ curve?: ChartCurve;
82
+ showDots?: boolean;
83
+ showLegend?: boolean;
84
+ gradient?: boolean;
85
+ strokeWidth?: number;
75
86
  };
76
- declare function LineChart({ values, size, width, height: heightProp, showArea, showGrid, showAxis, showTooltip, labels, valueFormatter, stroke, state, emptyLabel, domain, ariaLabel, className, style, ...props }: LineChartProps): React.JSX.Element;
87
+ declare function LineChart({ values, series, size, width, height: heightProp, showArea, showGrid, showAxis, showTooltip, labels, valueFormatter, stroke, state, emptyLabel, domain, ariaLabel, curve, showDots, showLegend, gradient, strokeWidth, className, style, ...props }: LineChartProps): React.JSX.Element;
77
88
  declare function AreaChart(props: Omit<LineChartProps, "showArea">): React.JSX.Element;
78
- export type SparklineProps = Omit<LineChartProps, "size" | "showArea" | "showAxis"> & {
89
+ export type SparklineProps = Omit<LineChartProps, "size" | "showArea" | "showAxis" | "series" | "showLegend"> & {
79
90
  values: number[];
80
91
  positive?: boolean;
81
92
  };
@@ -0,0 +1 @@
1
+ module.exports = require("../../src/components/display/chat.cjs")
@@ -0,0 +1,94 @@
1
+ import * as React from "react";
2
+ export type ChatMessageStatus = "sending" | "sent" | "delivered" | "read" | "failed";
3
+ export type ChatAttachmentData = {
4
+ key: string;
5
+ name: string;
6
+ size?: React.ReactNode;
7
+ type?: React.ReactNode;
8
+ href?: string;
9
+ preview?: string;
10
+ };
11
+ export type ChatParticipant = {
12
+ name: string;
13
+ avatar?: string;
14
+ fallback?: React.ReactNode;
15
+ status?: "online" | "offline" | "busy" | "away";
16
+ };
17
+ export type ChatShellProps = React.ComponentProps<"section"> & {
18
+ sidebar?: React.ReactNode;
19
+ details?: React.ReactNode;
20
+ };
21
+ declare function ChatShell({ sidebar, details, children, className, ...props }: ChatShellProps): React.JSX.Element;
22
+ export type ChatHeaderProps = React.ComponentProps<"header"> & {
23
+ participant: ChatParticipant;
24
+ description?: React.ReactNode;
25
+ actions?: React.ReactNode;
26
+ };
27
+ declare function ChatHeader({ participant, description, actions, className, ...props }: ChatHeaderProps): React.JSX.Element;
28
+ export type ConversationItem = {
29
+ key: string;
30
+ participant: ChatParticipant;
31
+ preview?: React.ReactNode;
32
+ time?: React.ReactNode;
33
+ unread?: number;
34
+ muted?: boolean;
35
+ pinned?: boolean;
36
+ };
37
+ export type ConversationListProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
38
+ items: ConversationItem[];
39
+ selectedKey?: string;
40
+ defaultSelectedKey?: string;
41
+ onSelect?: (item: ConversationItem) => void;
42
+ searchable?: boolean;
43
+ searchPlaceholder?: string;
44
+ empty?: React.ReactNode;
45
+ };
46
+ declare function ConversationList({ items, selectedKey, defaultSelectedKey, onSelect, searchable, searchPlaceholder, empty, className, ...props }: ConversationListProps): React.JSX.Element;
47
+ export type ChatMessageListProps = React.ComponentProps<"div"> & {
48
+ autoScroll?: boolean;
49
+ empty?: React.ReactNode;
50
+ };
51
+ declare function ChatMessageList({ autoScroll, empty, children, className, ...props }: ChatMessageListProps): React.JSX.Element;
52
+ export type ChatAttachmentProps = React.ComponentProps<"div"> & Omit<ChatAttachmentData, "key"> & {
53
+ attachmentKey?: string;
54
+ onRemove?: () => void;
55
+ };
56
+ declare function ChatAttachment({ name, size, type, href, preview, onRemove, attachmentKey: _attachmentKey, className, ...props }: ChatAttachmentProps): React.JSX.Element;
57
+ export type ChatMessageProps = React.ComponentProps<"article"> & {
58
+ participant?: ChatParticipant;
59
+ outgoing?: boolean;
60
+ time?: React.ReactNode;
61
+ status?: ChatMessageStatus;
62
+ replyTo?: React.ReactNode;
63
+ attachments?: ChatAttachmentData[];
64
+ reactions?: Array<{
65
+ key: string;
66
+ label: React.ReactNode;
67
+ count?: number;
68
+ active?: boolean;
69
+ }>;
70
+ onReaction?: (key: string) => void;
71
+ actions?: React.ReactNode;
72
+ };
73
+ declare function ChatMessage({ participant, outgoing, time, status, replyTo, attachments, reactions, onReaction, actions, children, className, ...props }: ChatMessageProps): React.JSX.Element;
74
+ declare function ChatTypingIndicator({ participant, className, ...props }: React.ComponentProps<"div"> & {
75
+ participant?: ChatParticipant;
76
+ }): React.JSX.Element;
77
+ export type ChatComposerProps = Omit<React.ComponentProps<"form">, "onSubmit"> & {
78
+ value?: string;
79
+ defaultValue?: string;
80
+ onValueChange?: (value: string) => void;
81
+ onSend: (value: string) => void | Promise<void>;
82
+ placeholder?: string;
83
+ disabled?: boolean;
84
+ sending?: boolean;
85
+ attachments?: ChatAttachmentData[];
86
+ onRemoveAttachment?: (key: string) => void;
87
+ onAttachmentClick?: () => void;
88
+ onEmojiClick?: () => void;
89
+ maxLength?: number;
90
+ submitLabel?: string;
91
+ };
92
+ declare function ChatComposer({ value, defaultValue, onValueChange, onSend, placeholder, disabled, sending, attachments, onRemoveAttachment, onAttachmentClick, onEmojiClick, maxLength, submitLabel, className, ...props }: ChatComposerProps): React.JSX.Element;
93
+ declare function ChatHeaderActions(): React.JSX.Element;
94
+ export { ChatAttachment, ChatComposer, ChatHeader, ChatHeaderActions, ChatMessage, ChatMessageList, ChatShell, ChatTypingIndicator, ConversationList, };
@@ -0,0 +1 @@
1
+ export * from "../../src/components/display/chat.js"
@@ -15,5 +15,6 @@ export * from "./info-card";
15
15
  export * from "./virtual-list";
16
16
  export * from "./qr-code";
17
17
  export * from "./carousel";
18
+ export * from "./chat";
18
19
  export * from "./tag";
19
20
  export * from "./typography";
@@ -6,6 +6,19 @@ export type KanbanCard = {
6
6
  meta?: React.ReactNode;
7
7
  extra?: React.ReactNode;
8
8
  actions?: React.ReactNode;
9
+ labels?: Array<React.ReactNode | {
10
+ key: string;
11
+ label: React.ReactNode;
12
+ tone?: "neutral" | "info" | "success" | "warning" | "danger" | "muted";
13
+ }>;
14
+ priority?: "low" | "medium" | "high" | "urgent";
15
+ assignee?: {
16
+ name: string;
17
+ src?: string;
18
+ fallback?: React.ReactNode;
19
+ };
20
+ dueDate?: React.ReactNode;
21
+ selected?: boolean;
9
22
  disabled?: boolean;
10
23
  };
11
24
  export type KanbanColumn = {
@@ -14,12 +27,18 @@ export type KanbanColumn = {
14
27
  description?: React.ReactNode;
15
28
  cards: KanbanCard[];
16
29
  count?: React.ReactNode;
30
+ limit?: number;
31
+ color?: string;
32
+ actions?: React.ReactNode;
33
+ footer?: React.ReactNode;
17
34
  disabled?: boolean;
18
35
  };
19
36
  export type KanbanCardRenderContext = {
20
37
  index: number;
21
38
  isDragging: boolean;
22
39
  isDropTarget: boolean;
40
+ selected: boolean;
41
+ selectControl: React.ReactNode;
23
42
  handle: React.ReactNode;
24
43
  };
25
44
  export type KanbanCardMove = {
@@ -34,8 +53,21 @@ export type KanbanBoardProps = Omit<React.ComponentProps<"div">, "defaultValue">
34
53
  defaultColumns?: KanbanColumn[];
35
54
  onColumnsChange?: (columns: KanbanColumn[], change: KanbanCardMove) => void;
36
55
  onCardMove?: (change: KanbanCardMove) => void;
56
+ canMoveCard?: (change: KanbanCardMove) => boolean;
37
57
  renderCard?: (card: KanbanCard, column: KanbanColumn, context: KanbanCardRenderContext) => React.ReactNode;
38
58
  onCardClick?: (card: KanbanCard, column: KanbanColumn) => void;
59
+ onAddCard?: (column: KanbanColumn) => void;
60
+ onAddColumn?: () => void;
61
+ renderColumnHeader?: (column: KanbanColumn) => React.ReactNode;
62
+ renderColumnFooter?: (column: KanbanColumn) => React.ReactNode;
63
+ selectionMode?: "none" | "single" | "multiple";
64
+ selectedCardKeys?: string[];
65
+ defaultSelectedCardKeys?: string[];
66
+ onSelectionChange?: (keys: string[], cards: KanbanCard[]) => void;
67
+ allowCrossColumn?: boolean;
68
+ allowReorder?: boolean;
69
+ density?: "compact" | "comfortable";
70
+ columnWidth?: number | string;
39
71
  disabled?: boolean;
40
72
  emptyColumn?: React.ReactNode;
41
73
  dragHandleLabel?: (card: KanbanCard, column: KanbanColumn) => string;
@@ -43,5 +75,5 @@ export type KanbanBoardProps = Omit<React.ComponentProps<"div">, "defaultValue">
43
75
  cardClassName?: string;
44
76
  overlayClassName?: string;
45
77
  };
46
- declare function KanbanBoard({ columns: columnsProp, defaultColumns, onColumnsChange, onCardMove, renderCard, onCardClick, disabled, emptyColumn, dragHandleLabel, columnClassName, cardClassName, overlayClassName, className, "aria-label": ariaLabel, ...props }: KanbanBoardProps): React.JSX.Element;
78
+ declare function KanbanBoard({ columns: columnsProp, defaultColumns, onColumnsChange, onCardMove, canMoveCard, renderCard, onCardClick, onAddCard, onAddColumn, renderColumnHeader, renderColumnFooter, selectionMode, selectedCardKeys, defaultSelectedCardKeys, onSelectionChange, allowCrossColumn, allowReorder, density, columnWidth, disabled, emptyColumn, dragHandleLabel, columnClassName, cardClassName, overlayClassName, className, "aria-label": ariaLabel, ...props }: KanbanBoardProps): React.JSX.Element;
47
79
  export { KanbanBoard };
@@ -16,6 +16,18 @@ export type SidebarItem = {
16
16
  current?: React.AriaAttributes["aria-current"];
17
17
  tooltip?: React.ReactNode;
18
18
  onSelect?: () => void;
19
+ keywords?: string[];
20
+ action?: React.ReactNode;
21
+ actionLabel?: string;
22
+ onAction?: () => void;
23
+ };
24
+ export type SidebarSearch = {
25
+ value?: string;
26
+ defaultValue?: string;
27
+ placeholder?: string;
28
+ label?: string;
29
+ onValueChange?: (value: string) => void;
30
+ empty?: React.ReactNode;
19
31
  };
20
32
  export type SidebarFooterAccount = {
21
33
  label: React.ReactNode;
@@ -30,6 +42,11 @@ export type SidebarProps = React.ComponentProps<"aside"> & {
30
42
  footer?: React.ReactNode;
31
43
  items?: SidebarItem[];
32
44
  collapsed?: boolean;
45
+ defaultCollapsed?: boolean;
46
+ onCollapsedChange?: (collapsed: boolean) => void;
47
+ variant?: "sidebar" | "floating" | "inset";
48
+ side?: "left" | "right";
49
+ collapsible?: "icon" | "offcanvas" | "none";
33
50
  width?: React.CSSProperties["width"];
34
51
  collapsedWidth?: React.CSSProperties["width"];
35
52
  mobileWidth?: React.CSSProperties["width"];
@@ -43,6 +60,10 @@ export type SidebarProps = React.ComponentProps<"aside"> & {
43
60
  itemSize?: "sm" | "md" | "lg";
44
61
  activeIndicator?: "none" | "bar" | "pill";
45
62
  navigationLabel?: string;
63
+ search?: SidebarSearch | React.ReactNode;
64
+ hideScrollbar?: boolean;
65
+ keyboardShortcut?: string | false;
66
+ persistKey?: string;
46
67
  responsive?: boolean;
47
68
  mobileBreakpoint?: number;
48
69
  mobileOpen?: boolean;
@@ -72,5 +93,6 @@ export type SidebarProps = React.ComponentProps<"aside"> & {
72
93
  [key: `data-${string}`]: string | boolean | undefined;
73
94
  }) => React.ReactNode;
74
95
  };
75
- declare function Sidebar({ className, header, footer, items, collapsed: collapsedProp, width, collapsedWidth, mobileWidth, collapsedRail, railItems, footerAccount, secondaryActions, footerSecondary, tooltipOnCollapsed, showSectionLabels, itemSize, activeIndicator, navigationLabel, responsive, mobileBreakpoint, mobileOpen: mobileOpenProp, defaultMobileOpen, onMobileOpenChange, mobileTitle, mobileDescription, mobileToggleLabel, mobileCloseLabel, mobileToggleIcon, showMobileToggle, closeOnSelect, mobileToggleClassName, mobilePanelClassName, mobileOverlayClassName, renderMobileToggle, onItemSelect, renderItem, renderLink, children, ...props }: SidebarProps): React.JSX.Element;
76
- export { Sidebar };
96
+ declare function Sidebar({ className, header, footer, items, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, variant, side, collapsible, width, collapsedWidth, mobileWidth, collapsedRail, railItems, footerAccount, secondaryActions, footerSecondary, tooltipOnCollapsed, showSectionLabels, itemSize, activeIndicator, navigationLabel, search, hideScrollbar, keyboardShortcut, persistKey, responsive, mobileBreakpoint, mobileOpen: mobileOpenProp, defaultMobileOpen, onMobileOpenChange, mobileTitle, mobileDescription, mobileToggleLabel, mobileCloseLabel, mobileToggleIcon, showMobileToggle, closeOnSelect, mobileToggleClassName, mobilePanelClassName, mobileOverlayClassName, renderMobileToggle, onItemSelect, renderItem, renderLink, children, ...props }: SidebarProps): React.JSX.Element;
97
+ declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
98
+ export { Sidebar, SidebarInset };
@@ -9,16 +9,28 @@ export type RichTextEditorProps = Omit<React.ComponentProps<"div">, "defaultValu
9
9
  editable?: boolean;
10
10
  autoFocus?: boolean;
11
11
  minHeight?: number;
12
+ maxHeight?: number;
13
+ maxLength?: number;
14
+ toolbar?: boolean;
15
+ stickyToolbar?: boolean;
16
+ toolbarSize?: "compact" | "default";
17
+ features?: RichTextFeature[];
18
+ showCharacterCount?: boolean;
19
+ showWordCount?: boolean;
12
20
  onLinkRequest?: (currentHref?: string) => string | null | undefined;
13
21
  labels?: {
14
22
  editor?: string;
15
23
  toolbar?: string;
16
24
  };
17
25
  };
18
- declare function EditorToolbar({ editor, onLinkRequest, label }: {
26
+ export type RichTextFeature = "history" | "bold" | "italic" | "strike" | "code" | "heading1" | "heading2" | "heading3" | "paragraph" | "bulletList" | "orderedList" | "blockquote" | "codeBlock" | "horizontalRule" | "link" | "clearFormatting";
27
+ declare function EditorToolbar({ editor, onLinkRequest, label, features, sticky, size }: {
19
28
  editor: Editor;
20
29
  onLinkRequest?: RichTextEditorProps["onLinkRequest"];
21
30
  label: string;
31
+ features?: RichTextFeature[];
32
+ sticky?: boolean;
33
+ size?: "compact" | "default";
22
34
  }): React.JSX.Element;
23
35
  declare function RichTextEditor(props: RichTextEditorProps): React.JSX.Element;
24
36
  export { EditorToolbar, RichTextEditor };
@@ -1,15 +1,28 @@
1
1
  import * as React from "react";
2
- type ThemeMode = "light" | "dark" | "system";
3
- type ResolvedThemeMode = "light" | "dark";
2
+ export type ThemeName = string;
3
+ export type ThemeMode = ThemeName | "system";
4
+ export type ThemeColorScheme = "light" | "dark";
5
+ export type ThemeProviderProps = {
6
+ children: React.ReactNode;
7
+ themes?: ThemeName[];
8
+ defaultTheme?: ThemeMode;
9
+ forcedTheme?: ThemeName;
10
+ storageKey?: string;
11
+ enableSystem?: boolean;
12
+ attribute?: "class" | "data-theme" | "both";
13
+ colorSchemes?: Record<ThemeName, ThemeColorScheme>;
14
+ disableTransitionOnChange?: boolean;
15
+ onThemeChange?: (theme: ThemeMode, resolvedTheme: ThemeName) => void;
16
+ };
4
17
  type ThemeContextValue = {
5
18
  theme: ThemeMode;
6
- resolvedTheme: ResolvedThemeMode;
19
+ resolvedTheme: ThemeName;
20
+ systemTheme: ThemeColorScheme;
21
+ themes: ThemeName[];
7
22
  mounted: boolean;
8
23
  setTheme: (theme: ThemeMode) => void;
9
24
  toggleTheme: () => void;
10
25
  };
11
- export declare function ThemeProvider({ children }: {
12
- children: React.ReactNode;
13
- }): React.JSX.Element;
26
+ export declare function ThemeProvider({ children, themes, defaultTheme, forcedTheme, storageKey, enableSystem, attribute, colorSchemes, disableTransitionOnChange, onThemeChange, }: ThemeProviderProps): React.JSX.Element;
14
27
  export declare function useTheme(): ThemeContextValue;
15
28
  export {};
@@ -7,7 +7,7 @@ declare const badgeVariants: (props?: ({
7
7
  size?: "default" | "sm" | "lg" | null | undefined;
8
8
  dot?: boolean | null | undefined;
9
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- type BadgeProps = useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
10
+ type BadgeProps = useRender.ComponentProps<"span"> & Omit<VariantProps<typeof badgeVariants>, "dot"> & {
11
11
  label?: React.ReactNode;
12
12
  count?: React.ReactNode;
13
13
  status?: "neutral" | "info" | "success" | "warning" | "danger" | "muted";
@@ -17,6 +17,12 @@ type BadgeProps = useRender.ComponentProps<"span"> & VariantProps<typeof badgeVa
17
17
  removeLabel?: string;
18
18
  leftIcon?: React.ReactNode;
19
19
  rightIcon?: React.ReactNode;
20
+ avatar?: React.ReactNode;
21
+ dot?: boolean | React.ReactNode;
22
+ showDot?: boolean;
23
+ dotPosition?: "start" | "end";
24
+ pulse?: boolean;
25
+ interactive?: boolean;
20
26
  };
21
- declare function Badge({ className, variant, tone, size, dot, label, count, status, removable, selected, onRemove, removeLabel, leftIcon, rightIcon, children, render, onKeyDown, ...props }: BadgeProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
27
+ declare function Badge({ className, variant, tone, size, dot, label, count, status, removable, selected, onRemove, removeLabel, leftIcon, rightIcon, avatar, showDot, dotPosition, pulse, interactive, children, render, onKeyDown, ...props }: BadgeProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
22
28
  export { Badge, badgeVariants, type BadgeProps };
@@ -1 +1 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../feedback/state-view.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s={sm:120,md:220,lg:320};function c(e,t){return t??`var(--color-chart-${e%5+1}, var(--primary))`}function l(e,t){return typeof e==`string`||typeof e==`number`?String(e):t}function u(e,t){return t?t(e):e.toLocaleString()}function d({state:e,emptyLabel:t,height:n}){return e===`loading`?(0,a.jsx)(r.StateView,{status:`loading`,loadingVariant:`skeleton`,variant:`plain`,size:`compact`,style:{minHeight:n}}):e===`empty`?(0,a.jsx)(r.StateView,{status:`empty`,title:t,description:null,variant:`plain`,size:`compact`,style:{minHeight:n}}):null}function f({data:e,valueFormatter:t,caption:n}){return(0,a.jsx)(`div`,{className:`sr-only`,children:(0,a.jsxs)(`table`,{children:[(0,a.jsx)(`caption`,{children:n}),(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{scope:`col`,children:`Label`}),(0,a.jsx)(`th`,{scope:`col`,children:`Value`}),(0,a.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,a.jsx)(`tbody`,{children:e.map((e,n)=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{scope:`row`,children:e.label}),(0,a.jsx)(`td`,{children:u(e.value,t)}),(0,a.jsx)(`td`,{children:e.description})]},n))})]})})}function p({active:e,label:t,payload:n,valueFormatter:r,labelFormatter:i}){return!e||!n?.length?null:(0,a.jsxs)(`div`,{"data-slot":`chart-tooltip`,className:`min-w-36 rounded-[var(--radius-md)] border border-border/75 bg-popover/98 p-3 text-popover-foreground shadow-lg backdrop-blur`,children:[t===void 0?null:(0,a.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:i?i(t):t}),(0,a.jsx)(`div`,{className:`grid gap-1.5`,children:n.map((e,t)=>{let n=typeof e.value==`number`?e.value:Number(e.value??0);return(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,a.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-sm`,style:{background:e.color}}),(0,a.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name??`Value`}),(0,a.jsx)(`span`,{className:`font-semibold tabular-nums`,children:u(n,r)})]},`${e.name??`value`}-${t}`)})})]})}function m({title:e,description:r,action:i,state:o=`ready`,emptyLabel:s=`No data available.`,className:c,children:l,...u}){return(0,a.jsxs)(n.Card,{"data-slot":`chart-frame`,"data-state":o,className:t.cn(`min-w-0`,c),...u,children:[e||r||i?(0,a.jsxs)(n.CardHeader,{className:`flex-row items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e?(0,a.jsx)(n.CardTitle,{children:e}):null,r?(0,a.jsx)(n.CardDescription,{children:r}):null]}),i?(0,a.jsx)(`div`,{className:`shrink-0`,children:i}):null]}):null,(0,a.jsx)(n.CardContent,{children:o===`ready`?l:(0,a.jsx)(d,{state:o,emptyLabel:s,height:180})})]})}function h({data:e,size:n=`md`,max:r,showLabels:i=!0,showValues:m=!1,showGrid:h=!0,showTooltip:g=!0,valueFormatter:_,state:v=`ready`,emptyLabel:y=`No chart data.`,barClassName:b,domain:x,ariaLabel:S=`Bar chart`,className:C,...w}){let T=s[n],E=v===`ready`&&e.length===0?`empty`:v;if(E!==`ready`)return(0,a.jsx)(d,{state:E,emptyLabel:y,height:T});let D=e.map((e,t)=>({name:l(e.label,`Item ${t+1}`),value:e.value,fill:c(t,e.color),originalLabel:e.label,description:e.description})),O=x??(r===void 0?[`auto`,`auto`]:[`auto`,r]);return(0,a.jsxs)(`div`,{"data-slot":`bar-chart`,role:`img`,"aria-label":S,className:t.cn(`min-w-0`,C),...w,children:[(0,a.jsx)(`div`,{style:{height:T},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,a.jsxs)(o.BarChart,{data:D,margin:{top:m?20:8,right:8,bottom:i?8:0,left:0},children:[h?(0,a.jsx)(o.CartesianGrid,{vertical:!1,stroke:`var(--border)`,strokeDasharray:`4 6`}):null,(0,a.jsx)(o.XAxis,{dataKey:`name`,hide:!i,axisLine:!1,tickLine:!1,tick:{fill:`var(--muted-foreground)`,fontSize:12},interval:`preserveStartEnd`}),(0,a.jsx)(o.YAxis,{hide:!0,domain:O}),g?(0,a.jsx)(o.Tooltip,{cursor:{fill:`var(--muted)`,opacity:.35},content:(0,a.jsx)(p,{valueFormatter:_})}):null,(0,a.jsx)(o.Bar,{dataKey:`value`,name:`Value`,radius:[6,6,2,2],className:b,isAnimationActive:!1,label:m?{position:`top`,fill:`var(--muted-foreground)`,fontSize:11,formatter:e=>String(u(Number(e),_))}:!1,children:D.map(e=>(0,a.jsx)(o.Cell,{fill:e.fill},e.name))})]})})}),(0,a.jsx)(f,{data:e,valueFormatter:_,caption:S})]})}function g({values:e,size:n=`md`,width:r=560,height:i,showArea:c=!1,showGrid:u=!0,showAxis:m=!1,showTooltip:h=!0,labels:g,valueFormatter:_,stroke:v=`var(--primary)`,state:y=`ready`,emptyLabel:b=`No line data.`,domain:x=[`auto`,`auto`],ariaLabel:S=c?`Area chart`:`Line chart`,className:C,style:w,...T}){let E=i??s[n],D=y===`ready`&&e.length===0?`empty`:y;if(D!==`ready`)return(0,a.jsx)(d,{state:D,emptyLabel:b,height:E});let O=e.map((e,t)=>({name:l(g?.[t],String(t+1)),value:e,originalLabel:g?.[t]??String(t+1)})),k=c?o.AreaChart:o.LineChart;return(0,a.jsxs)(`div`,{"data-slot":c?`area-chart`:`line-chart`,role:`img`,"aria-label":S,"data-chart-width":r,className:t.cn(`min-w-0`,C),style:w,...T,children:[(0,a.jsx)(`div`,{style:{height:E},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,a.jsxs)(k,{data:O,margin:{top:10,right:10,bottom:m?8:0,left:m?-12:0},children:[u?(0,a.jsx)(o.CartesianGrid,{vertical:!1,stroke:`var(--border)`,strokeDasharray:`4 6`}):null,(0,a.jsx)(o.XAxis,{dataKey:`name`,hide:!m,axisLine:!1,tickLine:!1,tick:{fill:`var(--muted-foreground)`,fontSize:12},interval:`preserveStartEnd`}),(0,a.jsx)(o.YAxis,{hide:!m,domain:x,axisLine:!1,tickLine:!1,width:44,tick:{fill:`var(--muted-foreground)`,fontSize:11}}),h?(0,a.jsx)(o.Tooltip,{content:(0,a.jsx)(p,{valueFormatter:_})}):null,c?(0,a.jsx)(o.Area,{type:`monotone`,dataKey:`value`,name:`Value`,stroke:v,strokeWidth:2.5,fill:v,fillOpacity:.14,activeDot:{r:5},isAnimationActive:!1}):(0,a.jsx)(o.Line,{type:`monotone`,dataKey:`value`,name:`Value`,stroke:v,strokeWidth:2.5,dot:{r:3.5,fill:v},activeDot:{r:5},isAnimationActive:!1})]})})}),(0,a.jsx)(f,{data:e.map((e,t)=>({label:g?.[t]??t+1,value:e})),valueFormatter:_,caption:S})]})}function _(e){return(0,a.jsx)(g,{showArea:!0,...e})}function v({values:e,positive:n=!0,stroke:r,className:i,showTooltip:o=!1,...s}){return(0,a.jsx)(g,{values:e,size:`sm`,stroke:r??(n?`var(--aui-success,var(--primary))`:`var(--destructive)`),showGrid:!1,showAxis:!1,showTooltip:o,className:t.cn(`max-w-44`,i),ariaLabel:`Sparkline`,...s})}function y({data:e,size:n=180,strokeWidth:r=18,centerLabel:i,centerValue:s,state:u=`ready`,emptyLabel:m=`No distribution data.`,showTooltip:h=!0,valueFormatter:g,ariaLabel:_=`Donut chart`,className:v,style:y,...b}){let x=u===`ready`&&e.length===0?`empty`:u;if(x!==`ready`)return(0,a.jsx)(d,{state:x,emptyLabel:m,height:n});let S=e.map((e,t)=>({name:l(e.label,`Item ${t+1}`),value:Math.max(0,e.value),fill:c(t,e.color),description:e.description})),C=Math.max(8,n/2-8);return(0,a.jsxs)(`div`,{"data-slot":`donut-chart`,role:`img`,"aria-label":_,className:t.cn(`relative inline-grid place-items-center`,v),style:{width:n,height:n,...y},...b,children:[(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,a.jsxs)(o.PieChart,{children:[h?(0,a.jsx)(o.Tooltip,{content:(0,a.jsx)(p,{valueFormatter:g})}):null,(0,a.jsx)(o.Pie,{data:S,dataKey:`value`,nameKey:`name`,cx:`50%`,cy:`50%`,innerRadius:Math.max(0,C-r),outerRadius:C,paddingAngle:2,stroke:`var(--background)`,strokeWidth:2,isAnimationActive:!1,children:S.map(e=>(0,a.jsx)(o.Cell,{fill:e.fill},e.name))})]})}),s||i?(0,a.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 grid place-content-center text-center`,children:[(0,a.jsx)(`div`,{className:`text-xl font-semibold tabular-nums`,children:s}),(0,a.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i})]}):null,(0,a.jsx)(f,{data:e,valueFormatter:g,caption:_})]})}function b({data:e,className:n,...r}){return(0,a.jsx)(`div`,{"data-slot":`chart-legend`,className:t.cn(`flex flex-wrap gap-x-4 gap-y-2 text-xs text-muted-foreground`,n),...r,children:e.map((e,t)=>(0,a.jsxs)(`div`,{className:`inline-flex min-w-0 items-center gap-2`,children:[(0,a.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-sm`,style:{background:c(t,e.color)}}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},t))})}function x({label:e,value:n,change:r,positive:i=!0,values:o,className:s,...c}){return(0,a.jsxs)(`div`,{"data-slot":`metric-trend`,className:t.cn(`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-end gap-4`,s),...c,children:[(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e}),(0,a.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tracking-tight tabular-nums`,children:n}),r?(0,a.jsx)(`div`,{className:t.cn(`mt-1 text-xs font-medium`,i?`text-[color:var(--aui-success,var(--primary))]`:`text-destructive`),children:r}):null]}),o?.length?(0,a.jsx)(v,{values:o,positive:i}):null]})}exports.AreaChart=_,exports.BarChart=h,exports.ChartFrame=m,exports.ChartLegend=b,exports.ChartTooltipContent=p,exports.DonutChart=y,exports.LineChart=g,exports.MetricTrend=x,exports.Sparkline=v;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../feedback/state-view.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s={sm:120,md:220,lg:320};function c(e,t){return t??`var(--color-chart-${e%5+1}, var(--primary))`}function l(e,t){return typeof e==`string`||typeof e==`number`?String(e):t}function u(e,t){return t?t(e):e.toLocaleString()}function d({state:e,emptyLabel:t,height:n}){return e===`loading`?(0,a.jsx)(r.StateView,{status:`loading`,loadingVariant:`skeleton`,variant:`plain`,size:`compact`,style:{minHeight:n}}):e===`empty`?(0,a.jsx)(r.StateView,{status:`empty`,title:t,description:null,variant:`plain`,size:`compact`,style:{minHeight:n}}):null}function f({data:e,valueFormatter:t,caption:n}){return(0,a.jsx)(`div`,{className:`sr-only`,children:(0,a.jsxs)(`table`,{children:[(0,a.jsx)(`caption`,{children:n}),(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{scope:`col`,children:`Label`}),(0,a.jsx)(`th`,{scope:`col`,children:`Value`}),(0,a.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,a.jsx)(`tbody`,{children:e.map((e,n)=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{scope:`row`,children:e.label}),(0,a.jsx)(`td`,{children:u(e.value,t)}),(0,a.jsx)(`td`,{children:e.description})]},n))})]})})}function p({labels:e,series:t,valueFormatter:n,caption:r}){return(0,a.jsx)(`div`,{className:`sr-only`,children:(0,a.jsxs)(`table`,{children:[(0,a.jsx)(`caption`,{children:r}),(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{scope:`col`,children:`Label`}),t.map(e=>(0,a.jsx)(`th`,{scope:`col`,children:e.label},e.key))]})}),(0,a.jsx)(`tbody`,{children:e.map((e,r)=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{scope:`row`,children:e}),t.map(e=>(0,a.jsx)(`td`,{children:u(e.data[r]??0,n)},e.key))]},r))})]})})}function m({active:e,label:t,payload:n,valueFormatter:r,labelFormatter:i}){return!e||!n?.length?null:(0,a.jsxs)(`div`,{"data-slot":`chart-tooltip`,className:`min-w-36 rounded-[var(--radius-md)] border border-border/75 bg-popover/98 p-3 text-popover-foreground shadow-lg backdrop-blur`,children:[t===void 0?null:(0,a.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:i?i(t):t}),(0,a.jsx)(`div`,{className:`grid gap-1.5`,children:n.map((e,t)=>{let n=typeof e.value==`number`?e.value:Number(e.value??0);return(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,a.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-sm`,style:{background:e.color}}),(0,a.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name??`Value`}),(0,a.jsx)(`span`,{className:`font-semibold tabular-nums`,children:u(n,r)})]},`${e.name??`value`}-${t}`)})})]})}function h({title:e,description:r,action:i,state:o=`ready`,emptyLabel:s=`No data available.`,className:c,children:l,...u}){return(0,a.jsxs)(n.Card,{"data-slot":`chart-frame`,"data-state":o,className:t.cn(`min-w-0`,c),...u,children:[e||r||i?(0,a.jsxs)(n.CardHeader,{className:`flex-row items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e?(0,a.jsx)(n.CardTitle,{children:e}):null,r?(0,a.jsx)(n.CardDescription,{children:r}):null]}),i?(0,a.jsx)(`div`,{className:`shrink-0`,children:i}):null]}):null,(0,a.jsx)(n.CardContent,{children:o===`ready`?l:(0,a.jsx)(d,{state:o,emptyLabel:s,height:180})})]})}function g({data:e=[],series:n,size:r=`md`,max:i,showLabels:h=!0,showValues:g=!1,showGrid:_=!0,showTooltip:v=!0,valueFormatter:y,state:b=`ready`,emptyLabel:S=`No chart data.`,barClassName:C,domain:w,ariaLabel:T=`Bar chart`,stacked:E=!1,showLegend:D=!!n?.length,barRadius:O=6,className:k,...A}){let j=s[r],M=n?.length?n:[{key:`value`,label:`Value`,data:e.map(e=>e.value)}],N=Math.max(e.length,...M.map(e=>e.data.length)),P=b===`ready`&&N===0?`empty`:b;if(P!==`ready`)return(0,a.jsx)(d,{state:P,emptyLabel:S,height:j});let F=Array.from({length:N},(t,n)=>e[n]?.label??`Item ${n+1}`),I=F.map((e,t)=>Object.fromEntries([[`name`,l(e,`Item ${t+1}`)],[`originalLabel`,e],...M.map(e=>[e.key,e.data[t]??0])])),L=w??(i===void 0?[`auto`,`auto`]:[`auto`,i]);return(0,a.jsxs)(`div`,{"data-slot":`bar-chart`,role:`img`,"aria-label":T,className:t.cn(`min-w-0`,k),...A,children:[(0,a.jsx)(`div`,{style:{height:j},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,a.jsxs)(o.BarChart,{data:I,margin:{top:g?20:8,right:8,bottom:h?8:0,left:0},children:[_?(0,a.jsx)(o.CartesianGrid,{vertical:!1,stroke:`var(--border)`,strokeDasharray:`4 6`}):null,(0,a.jsx)(o.XAxis,{dataKey:`name`,hide:!h,axisLine:!1,tickLine:!1,tick:{fill:`var(--muted-foreground)`,fontSize:12},interval:`preserveStartEnd`}),(0,a.jsx)(o.YAxis,{hide:!0,domain:L}),v?(0,a.jsx)(o.Tooltip,{cursor:{fill:`var(--muted)`,opacity:.35},content:(0,a.jsx)(m,{valueFormatter:y})}):null,M.map((t,r)=>(0,a.jsx)(o.Bar,{dataKey:t.key,name:l(t.label,t.key),fill:c(r,t.color),stackId:E?`total`:void 0,radius:[O,O,2,2],className:C,isAnimationActive:!1,label:g&&(!E||r===M.length-1)?{position:`top`,fill:`var(--muted-foreground)`,fontSize:11,formatter:e=>String(u(Number(e),y))}:!1,children:n?.length?null:e.map((e,t)=>(0,a.jsx)(o.Cell,{fill:c(t,e.color)},t))},t.key))]})})}),D&&M.length>1?(0,a.jsx)(x,{className:`mt-3`,data:M.map((e,t)=>({label:e.label,value:0,color:c(t,e.color)}))}):null,n?.length?(0,a.jsx)(p,{labels:F,series:M,valueFormatter:y,caption:T}):(0,a.jsx)(f,{data:e,valueFormatter:y,caption:T})]})}function _({values:e=[],series:n,size:r=`md`,width:u=560,height:f,showArea:h=!1,showGrid:g=!0,showAxis:_=!1,showTooltip:v=!0,labels:y,valueFormatter:b,stroke:S=`var(--primary)`,state:C=`ready`,emptyLabel:w=`No line data.`,domain:T=[`auto`,`auto`],ariaLabel:E=h?`Area chart`:`Line chart`,curve:D=`monotone`,showDots:O=!h,showLegend:k=!!n?.length,gradient:A=h,strokeWidth:j=2.5,className:M,style:N,...P}){let F=f??s[r],I=i.useId().replace(/:/g,``),L=n?.length?n:[{key:`value`,label:`Value`,data:e,color:S}],R=Math.max(...L.map(e=>e.data.length),0),z=C===`ready`&&R===0?`empty`:C;if(z!==`ready`)return(0,a.jsx)(d,{state:z,emptyLabel:w,height:F});let B=Array.from({length:R},(e,t)=>y?.[t]??String(t+1)),V=B.map((e,t)=>Object.fromEntries([[`name`,l(e,String(t+1))],[`originalLabel`,e],...L.map(e=>[e.key,e.data[t]??0])])),H=h?o.AreaChart:o.LineChart;return(0,a.jsxs)(`div`,{"data-slot":h?`area-chart`:`line-chart`,role:`img`,"aria-label":E,"data-chart-width":u,className:t.cn(`min-w-0`,M),style:N,...P,children:[(0,a.jsx)(`div`,{style:{height:F},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,a.jsxs)(H,{data:V,margin:{top:10,right:10,bottom:_?8:0,left:_?-12:0},children:[h&&A?(0,a.jsx)(`defs`,{children:L.map((e,t)=>{let n=c(t,e.color);return(0,a.jsxs)(`linearGradient`,{id:`${I}-${e.key}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,a.jsx)(`stop`,{offset:`0%`,stopColor:n,stopOpacity:.34}),(0,a.jsx)(`stop`,{offset:`92%`,stopColor:n,stopOpacity:.02})]},e.key)})}):null,g?(0,a.jsx)(o.CartesianGrid,{vertical:!1,stroke:`var(--border)`,strokeDasharray:`4 6`}):null,(0,a.jsx)(o.XAxis,{dataKey:`name`,hide:!_,axisLine:!1,tickLine:!1,tick:{fill:`var(--muted-foreground)`,fontSize:12},interval:`preserveStartEnd`}),(0,a.jsx)(o.YAxis,{hide:!_,domain:T,axisLine:!1,tickLine:!1,width:44,tick:{fill:`var(--muted-foreground)`,fontSize:11}}),v?(0,a.jsx)(o.Tooltip,{content:(0,a.jsx)(m,{valueFormatter:b})}):null,L.map((e,t)=>{let n=c(t,e.color);return h?(0,a.jsx)(o.Area,{type:D,dataKey:e.key,name:l(e.label,e.key),stroke:n,strokeWidth:j,fill:A?`url(#${I}-${e.key})`:n,fillOpacity:A?1:.12,dot:O?{r:3,fill:n,strokeWidth:2,stroke:`var(--background)`}:!1,activeDot:{r:5,strokeWidth:2,stroke:`var(--background)`},isAnimationActive:!1},e.key):(0,a.jsx)(o.Line,{type:D,dataKey:e.key,name:l(e.label,e.key),stroke:n,strokeWidth:j,dot:O?{r:3,fill:n,strokeWidth:2,stroke:`var(--background)`}:!1,activeDot:{r:5,strokeWidth:2,stroke:`var(--background)`},isAnimationActive:!1},e.key)})]})})}),k&&L.length>1?(0,a.jsx)(x,{className:`mt-3`,data:L.map((e,t)=>({label:e.label,value:0,color:c(t,e.color)}))}):null,(0,a.jsx)(p,{labels:B,series:L,valueFormatter:b,caption:E})]})}function v(e){return(0,a.jsx)(_,{showArea:!0,...e})}function y({values:e,positive:n=!0,stroke:r,className:i,showTooltip:o=!1,...s}){return(0,a.jsx)(_,{values:e,size:`sm`,stroke:r??(n?`var(--aui-success,var(--primary))`:`var(--destructive)`),showGrid:!1,showAxis:!1,showTooltip:o,className:t.cn(`max-w-44`,i),ariaLabel:`Sparkline`,...s})}function b({data:e,size:n=180,strokeWidth:r=18,centerLabel:i,centerValue:s,state:u=`ready`,emptyLabel:p=`No distribution data.`,showTooltip:h=!0,valueFormatter:g,ariaLabel:_=`Donut chart`,className:v,style:y,...b}){let x=u===`ready`&&e.length===0?`empty`:u;if(x!==`ready`)return(0,a.jsx)(d,{state:x,emptyLabel:p,height:n});let S=e.map((e,t)=>({name:l(e.label,`Item ${t+1}`),value:Math.max(0,e.value),fill:c(t,e.color),description:e.description})),C=Math.max(8,n/2-8);return(0,a.jsxs)(`div`,{"data-slot":`donut-chart`,role:`img`,"aria-label":_,className:t.cn(`relative inline-grid place-items-center`,v),style:{width:n,height:n,...y},...b,children:[(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,a.jsxs)(o.PieChart,{children:[h?(0,a.jsx)(o.Tooltip,{content:(0,a.jsx)(m,{valueFormatter:g})}):null,(0,a.jsx)(o.Pie,{data:S,dataKey:`value`,nameKey:`name`,cx:`50%`,cy:`50%`,innerRadius:Math.max(0,C-r),outerRadius:C,paddingAngle:2,stroke:`var(--background)`,strokeWidth:2,isAnimationActive:!1,children:S.map(e=>(0,a.jsx)(o.Cell,{fill:e.fill},e.name))})]})}),s||i?(0,a.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 grid place-content-center text-center`,children:[(0,a.jsx)(`div`,{className:`text-xl font-semibold tabular-nums`,children:s}),(0,a.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i})]}):null,(0,a.jsx)(f,{data:e,valueFormatter:g,caption:_})]})}function x({data:e,className:n,...r}){return(0,a.jsx)(`div`,{"data-slot":`chart-legend`,className:t.cn(`flex flex-wrap gap-x-4 gap-y-2 text-xs text-muted-foreground`,n),...r,children:e.map((e,t)=>(0,a.jsxs)(`div`,{className:`inline-flex min-w-0 items-center gap-2`,children:[(0,a.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-sm`,style:{background:c(t,e.color)}}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},t))})}function S({label:e,value:n,change:r,positive:i=!0,values:o,className:s,...c}){return(0,a.jsxs)(`div`,{"data-slot":`metric-trend`,className:t.cn(`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-end gap-4`,s),...c,children:[(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e}),(0,a.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tracking-tight tabular-nums`,children:n}),r?(0,a.jsx)(`div`,{className:t.cn(`mt-1 text-xs font-medium`,i?`text-[color:var(--aui-success,var(--primary))]`:`text-destructive`),children:r}):null]}),o?.length?(0,a.jsx)(y,{values:o,positive:i}):null]})}exports.AreaChart=v,exports.BarChart=g,exports.ChartFrame=h,exports.ChartLegend=x,exports.ChartTooltipContent=m,exports.DonutChart=b,exports.LineChart=_,exports.MetricTrend=S,exports.Sparkline=y;