@nebutra/ui 0.2.1 → 0.2.3

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 (56) hide show
  1. package/LICENSE +21 -676
  2. package/README.md +81 -86
  3. package/dist/agent/index.d.ts +119 -0
  4. package/dist/agent/index.js +135 -0
  5. package/dist/agent/index.js.map +1 -0
  6. package/dist/canonical-Drca5UMj.d.ts +4309 -0
  7. package/dist/components/index.d.ts +51 -56
  8. package/dist/components/index.js +1696 -1203
  9. package/dist/components/index.js.map +1 -1
  10. package/dist/hooks/index.d.ts +62 -15
  11. package/dist/hooks/index.js +56 -34
  12. package/dist/hooks/index.js.map +1 -1
  13. package/dist/index-CKLIGfiU.d.ts +19 -0
  14. package/dist/index-Dg4jRJV2.d.ts +57 -0
  15. package/dist/layout/index.d.ts +7 -3
  16. package/dist/layout/index.js +525 -542
  17. package/dist/layout/index.js.map +1 -1
  18. package/dist/layouts/index.d.ts +80 -2
  19. package/dist/layouts/index.js +32 -19
  20. package/dist/layouts/index.js.map +1 -1
  21. package/dist/patterns/index.d.ts +131 -5
  22. package/dist/patterns/index.js +1594 -806
  23. package/dist/patterns/index.js.map +1 -1
  24. package/dist/primitives/canonical.d.ts +25 -0
  25. package/dist/primitives/canonical.js +12269 -0
  26. package/dist/primitives/canonical.js.map +1 -0
  27. package/dist/primitives/index.d.ts +694 -3544
  28. package/dist/primitives/index.js +8994 -6583
  29. package/dist/primitives/index.js.map +1 -1
  30. package/dist/shared/animation/css/index.d.ts +1 -0
  31. package/dist/shared/animation/css/index.js +14 -0
  32. package/dist/shared/animation/css/index.js.map +1 -0
  33. package/dist/shared/animation/index.d.ts +6 -0
  34. package/dist/shared/animation/index.js +272 -0
  35. package/dist/shared/animation/index.js.map +1 -0
  36. package/dist/shared/animation/motion/index.d.ts +4 -0
  37. package/dist/shared/animation/motion/index.js +205 -0
  38. package/dist/shared/animation/motion/index.js.map +1 -0
  39. package/dist/styles/brand-override.css +11 -11
  40. package/dist/tailwind.preset.d.ts +10 -10
  41. package/dist/tailwind.preset.js +7 -4
  42. package/dist/tailwind.preset.js.map +1 -1
  43. package/dist/theme/index.d.ts +2 -2
  44. package/dist/tokens-EAC6uPem.d.ts +302 -0
  45. package/dist/typography/fonts.css +51 -37
  46. package/dist/typography/index.d.ts +27 -27
  47. package/dist/typography/index.js +24 -4
  48. package/dist/typography/index.js.map +1 -1
  49. package/dist/utils/index.d.ts +66 -14
  50. package/dist/utils/index.js +53 -10
  51. package/dist/utils/index.js.map +1 -1
  52. package/package.json +56 -14
  53. package/src/styles/brand-override.css +61 -0
  54. package/src/styles/preset.css +29 -0
  55. package/src/styles/sources.css +37 -0
  56. package/src/typography/fonts.css +124 -0
@@ -1,7 +1,25 @@
1
- import * as React from 'react';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { HTMLAttributes, ReactNode, ComponentType } from 'react';
3
4
  import { Icon } from '@nebutra/icons';
4
5
 
6
+ interface ArtifactShiftCardProps extends HTMLAttributes<HTMLDivElement> {
7
+ children: ReactNode;
8
+ contentClassName?: string;
9
+ }
10
+ interface ArtifactShiftCardPreviewProps extends HTMLAttributes<HTMLElement> {
11
+ filename: string;
12
+ language: string;
13
+ code: string;
14
+ label: string;
15
+ maxLines?: number;
16
+ signals?: readonly string[];
17
+ }
18
+ type ArtifactShiftCardFooterProps = HTMLAttributes<HTMLElement>;
19
+ declare function ArtifactShiftCard({ className, contentClassName, children, ...props }: ArtifactShiftCardProps): react_jsx_runtime.JSX.Element;
20
+ declare function ArtifactShiftCardPreview({ filename, language, code, label, maxLines, signals, className, ...props }: ArtifactShiftCardPreviewProps): react_jsx_runtime.JSX.Element;
21
+ declare function ArtifactShiftCardFooter({ className, ...props }: ArtifactShiftCardFooterProps): react_jsx_runtime.JSX.Element;
22
+
5
23
  type CardVariant = "default" | "elevated" | "bordered" | "ghost" | "gradient";
6
24
  type CardPadding = "none" | "sm" | "md" | "lg";
7
25
  interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
@@ -48,6 +66,40 @@ interface CommandBoxProps extends React.HTMLAttributes<HTMLDivElement> {
48
66
  }
49
67
  declare const CommandBox: React.ForwardRefExoticComponent<CommandBoxProps & React.RefAttributes<HTMLDivElement>>;
50
68
 
69
+ type DashboardMetricTone = "neutral" | "blue" | "green" | "amber";
70
+ interface DashboardCommandSurfaceProps {
71
+ status?: ReactNode;
72
+ title: ReactNode;
73
+ description?: ReactNode;
74
+ actions?: ReactNode;
75
+ children?: ReactNode;
76
+ className?: string;
77
+ }
78
+ declare function DashboardCommandSurface({ status, title, description, actions, children, className, }: DashboardCommandSurfaceProps): react_jsx_runtime.JSX.Element;
79
+ interface DashboardPanelProps {
80
+ title: ReactNode;
81
+ description?: ReactNode;
82
+ meta?: ReactNode;
83
+ action?: ReactNode;
84
+ children: ReactNode;
85
+ className?: string;
86
+ headerClassName?: string;
87
+ }
88
+ declare function DashboardPanel({ title, description, meta, action, children, className, headerClassName, }: DashboardPanelProps): react_jsx_runtime.JSX.Element;
89
+ interface DashboardMetricTileProps {
90
+ label: ReactNode;
91
+ value: ReactNode;
92
+ detail?: ReactNode;
93
+ source?: ReactNode;
94
+ icon?: ComponentType<{
95
+ className?: string;
96
+ "aria-hidden"?: boolean;
97
+ }>;
98
+ tone?: DashboardMetricTone;
99
+ className?: string;
100
+ }
101
+ declare function DashboardMetricTile({ label, value, detail, source, icon: Icon, tone, className, }: DashboardMetricTileProps): react_jsx_runtime.JSX.Element;
102
+
51
103
  type GalleryCardIconTone = "neutral" | "blue" | "cyan" | "purple" | "amber" | "green" | "pink";
52
104
  type GalleryCardBadgeTone = "beta" | "new" | "owner" | "featured" | "coming-soon";
53
105
  interface GalleryCardMetadata {
@@ -101,6 +153,58 @@ declare namespace GalleryCard {
101
153
  var displayName: string;
102
154
  }
103
155
 
156
+ type IconComponent = ComponentType<{
157
+ className?: string;
158
+ "aria-hidden"?: boolean;
159
+ }>;
160
+ type IconInput = IconComponent | ReactNode;
161
+ interface KineticFeatureCardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
162
+ icon?: IconInput;
163
+ eyebrow?: ReactNode;
164
+ title: ReactNode;
165
+ description: ReactNode;
166
+ children?: ReactNode;
167
+ }
168
+ interface KineticCodePreviewProps extends HTMLAttributes<HTMLDivElement> {
169
+ filename?: string;
170
+ language?: string;
171
+ lines: readonly string[];
172
+ }
173
+ interface KineticConsoleFrameProps extends HTMLAttributes<HTMLDivElement> {
174
+ title?: string;
175
+ status?: ReactNode;
176
+ children: ReactNode;
177
+ }
178
+ type KineticStepRailProps = HTMLAttributes<HTMLDivElement>;
179
+ interface KineticMorphSurfaceProps extends HTMLAttributes<HTMLDivElement> {
180
+ activeKey?: string | number;
181
+ children: ReactNode;
182
+ }
183
+ interface KineticSignalMarqueeProps extends HTMLAttributes<HTMLDivElement> {
184
+ eyebrow?: ReactNode;
185
+ children: ReactNode;
186
+ }
187
+ interface KineticCommandBoxProps extends HTMLAttributes<HTMLDivElement> {
188
+ command: string;
189
+ copyLabel: string;
190
+ copiedLabel: string;
191
+ }
192
+ interface KineticStepProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
193
+ icon?: IconComponent;
194
+ index: number;
195
+ title: ReactNode;
196
+ description: ReactNode;
197
+ phaseLabel?: string;
198
+ }
199
+ declare function KineticFeatureCard({ icon, eyebrow, title, description, children, className, ...props }: KineticFeatureCardProps): react_jsx_runtime.JSX.Element;
200
+ declare function KineticCodePreview({ filename, language, lines, className, ...props }: KineticCodePreviewProps): react_jsx_runtime.JSX.Element;
201
+ declare function KineticConsoleFrame({ title, status, children, className, ...props }: KineticConsoleFrameProps): react_jsx_runtime.JSX.Element;
202
+ declare function KineticMorphSurface({ activeKey, className, children, ...props }: KineticMorphSurfaceProps): react_jsx_runtime.JSX.Element;
203
+ declare function KineticSignalMarquee({ eyebrow, className, children, ...props }: KineticSignalMarqueeProps): react_jsx_runtime.JSX.Element;
204
+ declare function KineticCommandBox({ command, copyLabel, copiedLabel, className, ...props }: KineticCommandBoxProps): react_jsx_runtime.JSX.Element;
205
+ declare function KineticStepRail({ className, children, ...props }: KineticStepRailProps): react_jsx_runtime.JSX.Element;
206
+ declare function KineticStep({ icon: Icon, index, title, description, phaseLabel, className, ...props }: KineticStepProps): react_jsx_runtime.JSX.Element;
207
+
104
208
  interface MarkdownEditorProps {
105
209
  value: string;
106
210
  onChange: (next: string) => void;
@@ -224,20 +328,42 @@ interface SidebarNavItem {
224
328
  /** Nested children — 1 level deep max */
225
329
  children?: SidebarNavItem[];
226
330
  disabled?: boolean;
331
+ /** Controlled expansion for parent items (with children). When provided
332
+ * together with onExpandedChange, the inner Collapsible runs as a
333
+ * controlled component. Falls back to uncontrolled otherwise. */
334
+ expanded?: boolean;
335
+ onExpandedChange?: (next: boolean) => void;
336
+ }
337
+ /** A single icon-button action rendered inline-right of the section label,
338
+ * revealed only on section hover/focus-within. Max 3 per section. */
339
+ interface SidebarNavSectionAction {
340
+ id: string;
341
+ icon: SidebarNavIcon;
342
+ /** Accessible name (also used as title attribute). */
343
+ label: string;
344
+ /** Click handler — required unless `render` is provided. */
345
+ onClick?: () => void;
346
+ /** Optional wrapper to replace the default `<button>` rendering. Receives
347
+ * the default icon-button element so consumers can compose, e.g., a
348
+ * DropdownMenu trigger around it. When provided, `onClick` is ignored. */
349
+ render?: (defaultButton: React.ReactElement) => React.ReactNode;
227
350
  }
228
351
  interface SidebarNavSection {
229
352
  id: string;
230
353
  /** Group label, e.g. "MiniMax 实验室". Hidden when collapsed. */
231
354
  label?: string;
232
355
  items: SidebarNavItem[];
356
+ /** Hover/focus-revealed actions next to the section label. Skipped in
357
+ * collapsed mode and when empty. Limit to ≤ 3 to keep visual rhythm. */
358
+ actions?: SidebarNavSectionAction[];
233
359
  }
234
360
  interface SidebarNavRenderLinkProps {
235
361
  href: string;
236
362
  children: React.ReactNode;
237
- className?: string;
363
+ className?: string | undefined;
238
364
  "aria-current"?: "page" | undefined;
239
- "aria-label"?: string;
240
- onClick?: () => void;
365
+ "aria-label"?: string | undefined;
366
+ onClick?: (() => void) | undefined;
241
367
  }
242
368
  interface SidebarNavProps {
243
369
  sections: SidebarNavSection[];
@@ -360,4 +486,4 @@ interface WorkspaceSwitcherProps {
360
486
  }
361
487
  declare function WorkspaceSwitcher({ workspaces, activeWorkspaceId, onSwitch, variant, footerSlot, headerSlot, className, showRoleBadge, disabled, }: WorkspaceSwitcherProps): React.ReactElement;
362
488
 
363
- export { type AnswerType, type Author, Card, CardBody, type CardBodyProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardIcon, type CardIconProps, type CardProps, CardRoot, CardTitle, type CardTitleProps, CommandBox, type CommandBoxProps, GalleryCard, type GalleryCardAction, type GalleryCardBadge, type GalleryCardBadgeTone, type GalleryCardIconTone, type GalleryCardMetadata, type GalleryCardProps, type GalleryCardRenderLinkProps, MarkdownEditor, type MarkdownEditorProps, MarkdownRenderer, type MarkdownRendererProps, QAPage, type QAPageProps, type QuestionType, SidebarNav, type SidebarNavBadge, type SidebarNavBadgeTone, type SidebarNavIcon, type SidebarNavItem, type SidebarNavProps, type SidebarNavRenderLinkProps, type SidebarNavSection, Terminal, TerminalBody, type TerminalBodyProps, TerminalHeader, type TerminalHeaderProps, TerminalLine, type TerminalLineProps, type TerminalProps, TerminalRoot, UserInfo, type UserInfoProps, UserMenu, type UserMenuGroup, type UserMenuItem, type UserMenuProps, type UserMenuUser, VoteButtons, type VoteButtonsProps, type VoteType, type Workspace, type WorkspaceRole, WorkspaceSwitcher, type WorkspaceSwitcherProps };
489
+ export { type AnswerType, ArtifactShiftCard, ArtifactShiftCardFooter, type ArtifactShiftCardFooterProps, ArtifactShiftCardPreview, type ArtifactShiftCardPreviewProps, type ArtifactShiftCardProps, type Author, Card, CardBody, type CardBodyProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardIcon, type CardIconProps, type CardProps, CardRoot, CardTitle, type CardTitleProps, CommandBox, type CommandBoxProps, DashboardCommandSurface, type DashboardCommandSurfaceProps, DashboardMetricTile, type DashboardMetricTileProps, DashboardPanel, type DashboardPanelProps, GalleryCard, type GalleryCardAction, type GalleryCardBadge, type GalleryCardBadgeTone, type GalleryCardIconTone, type GalleryCardMetadata, type GalleryCardProps, type GalleryCardRenderLinkProps, KineticCodePreview, type KineticCodePreviewProps, KineticCommandBox, type KineticCommandBoxProps, KineticConsoleFrame, type KineticConsoleFrameProps, KineticFeatureCard, type KineticFeatureCardProps, KineticMorphSurface, type KineticMorphSurfaceProps, KineticSignalMarquee, type KineticSignalMarqueeProps, KineticStep, type KineticStepProps, KineticStepRail, type KineticStepRailProps, MarkdownEditor, type MarkdownEditorProps, MarkdownRenderer, type MarkdownRendererProps, QAPage, type QAPageProps, type QuestionType, SidebarNav, type SidebarNavBadge, type SidebarNavBadgeTone, type SidebarNavIcon, type SidebarNavItem, type SidebarNavProps, type SidebarNavRenderLinkProps, type SidebarNavSection, type SidebarNavSectionAction, Terminal, TerminalBody, type TerminalBodyProps, TerminalHeader, type TerminalHeaderProps, TerminalLine, type TerminalLineProps, type TerminalProps, TerminalRoot, UserInfo, type UserInfoProps, UserMenu, type UserMenuGroup, type UserMenuItem, type UserMenuProps, type UserMenuUser, VoteButtons, type VoteButtonsProps, type VoteType, type Workspace, type WorkspaceRole, WorkspaceSwitcher, type WorkspaceSwitcherProps };