@mithrl/design-system 0.1.0 → 0.3.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.
@@ -0,0 +1,115 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { type DragEvent, type HTMLAttributes, type MouseEvent, type MouseEventHandler } from "react";
3
+ import { type IconButtonProps } from "../icon-button/IconButton";
4
+
5
+ export declare const workspaceNavigationVariants: (props?: ({
6
+ presentation?: "inline" | "overlay" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type WorkspaceNavigationPresentation = NonNullable<VariantProps<typeof workspaceNavigationVariants>["presentation"]>;
9
+ export type WorkspaceNavigationQuestion = {
10
+ /** Stable owner-defined identity used for controlled selection. */
11
+ id: string;
12
+ /** Visible destination name. Long values use Navigation Item's text fade. */
13
+ label: string;
14
+ /** Stable route. Omit only when the owner performs an in-place selection. */
15
+ href?: string;
16
+ /** Uses the approved text shimmer and Progress Indicator. */
17
+ loading?: boolean;
18
+ /** Enables opening this unopened Question through native drag. */
19
+ draggable?: boolean;
20
+ /** Optional explicit name for the product-owned overflow action. */
21
+ menuActionLabel?: string;
22
+ };
23
+ type NavigationClick = MouseEvent<HTMLAnchorElement | HTMLButtonElement>;
24
+ type MenuClick = MouseEvent<HTMLButtonElement>;
25
+ type QuestionDrag = DragEvent<HTMLAnchorElement | HTMLButtonElement>;
26
+ export type WorkspaceNavigationProps = Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & VariantProps<typeof workspaceNavigationVariants> & {
27
+ /** Accessible name for the navigation landmark. */
28
+ "aria-label"?: string;
29
+ /** Destination for the persistent collection-level route. */
30
+ allProjectsHref?: string;
31
+ /** Visible label for the collection-level route. */
32
+ allProjectsLabel?: string;
33
+ /** Visible label for the creation action. */
34
+ newQuestionLabel?: string;
35
+ /** Stable identity for a controlled New Question dialog trigger. */
36
+ newQuestionTriggerId?: string;
37
+ /** Visible heading for the question destination region. */
38
+ questionsLabel?: string;
39
+ /** Controlled question destinations in display order. */
40
+ questions: readonly WorkspaceNavigationQuestion[];
41
+ /** Controlled current question identity. */
42
+ selectedQuestionId?: string;
43
+ /** Controlled Questions currently active in Primary or Secondary panels. */
44
+ activeQuestionIds?: readonly string[];
45
+ /** Selects a question without prescribing router ownership. */
46
+ onQuestionSelect?: (question: WorkspaceNavigationQuestion, event: NavigationClick) => void;
47
+ /** Opens the product-owned menu for one question. */
48
+ onQuestionMenuAction?: (question: WorkspaceNavigationQuestion, event: MenuClick) => void;
49
+ /** Reports the beginning of an enabled Question drag. */
50
+ onQuestionDragStart?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
51
+ /** Reports the end of an enabled Question drag. */
52
+ onQuestionDragEnd?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
53
+ /** Starts a new question. */
54
+ onNewQuestion: MouseEventHandler<HTMLButtonElement>;
55
+ /** Reports activation of the All Projects destination. */
56
+ onAllProjectsClick?: MouseEventHandler<HTMLAnchorElement>;
57
+ /** Controls the bottom scroll affordance. Auto reflects real overflow. */
58
+ bottomFade?: "auto" | "always" | "never";
59
+ };
60
+ /**
61
+ * Project-level destination panel for Workspace. It composes Navigation Item,
62
+ * Separator, Icon, and Progress Indicator through their public contracts.
63
+ * App Shell remains responsible for breakpoint selection and overlay placement.
64
+ */
65
+ export declare const WorkspaceNavigation: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & VariantProps<(props?: ({
66
+ presentation?: "inline" | "overlay" | null | undefined;
67
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
68
+ /** Accessible name for the navigation landmark. */
69
+ "aria-label"?: string;
70
+ /** Destination for the persistent collection-level route. */
71
+ allProjectsHref?: string;
72
+ /** Visible label for the collection-level route. */
73
+ allProjectsLabel?: string;
74
+ /** Visible label for the creation action. */
75
+ newQuestionLabel?: string;
76
+ /** Stable identity for a controlled New Question dialog trigger. */
77
+ newQuestionTriggerId?: string;
78
+ /** Visible heading for the question destination region. */
79
+ questionsLabel?: string;
80
+ /** Controlled question destinations in display order. */
81
+ questions: readonly WorkspaceNavigationQuestion[];
82
+ /** Controlled current question identity. */
83
+ selectedQuestionId?: string;
84
+ /** Controlled Questions currently active in Primary or Secondary panels. */
85
+ activeQuestionIds?: readonly string[];
86
+ /** Selects a question without prescribing router ownership. */
87
+ onQuestionSelect?: (question: WorkspaceNavigationQuestion, event: NavigationClick) => void;
88
+ /** Opens the product-owned menu for one question. */
89
+ onQuestionMenuAction?: (question: WorkspaceNavigationQuestion, event: MenuClick) => void;
90
+ /** Reports the beginning of an enabled Question drag. */
91
+ onQuestionDragStart?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
92
+ /** Reports the end of an enabled Question drag. */
93
+ onQuestionDragEnd?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
94
+ /** Starts a new question. */
95
+ onNewQuestion: MouseEventHandler<HTMLButtonElement>;
96
+ /** Reports activation of the All Projects destination. */
97
+ onAllProjectsClick?: MouseEventHandler<HTMLAnchorElement>;
98
+ /** Controls the bottom scroll affordance. Auto reflects real overflow. */
99
+ bottomFade?: "auto" | "always" | "never";
100
+ } & import("react").RefAttributes<HTMLElement>>;
101
+ export type WorkspacePanelSide = "navigator" | "explorer";
102
+ export type WorkspacePanelToggleButtonProps = Omit<IconButtonProps, "icon" | "loading" | "size" | "variant"> & {
103
+ /** Identifies which App Shell panel the animated divider represents. */
104
+ side: WorkspacePanelSide;
105
+ /** Controlled visibility state. */
106
+ expanded: boolean;
107
+ };
108
+ /** App Bar control with the approved moving and shortening panel divider. */
109
+ export declare const WorkspacePanelToggleButton: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "icon" | "loading" | "size" | "variant"> & {
110
+ /** Identifies which App Shell panel the animated divider represents. */
111
+ side: WorkspacePanelSide;
112
+ /** Controlled visibility state. */
113
+ expanded: boolean;
114
+ } & import("react").RefAttributes<HTMLButtonElement>>;
115
+ export {};
package/dist/index.d.ts CHANGED
@@ -3,12 +3,18 @@ export { Button, buttonVariants } from "./components/button/Button";
3
3
  export type { ButtonProps, ButtonSize, ButtonVariant, } from "./components/button/Button";
4
4
  export { Icon, iconVariants } from "./components/icon/Icon";
5
5
  export type { IconGlyphComponent, IconProps, IconSize, } from "./components/icon/Icon";
6
+ export { NavigationItem, navigationItemVariants, } from "./components/navigation-item/NavigationItem";
7
+ export type { NavigationItemPreviewState, NavigationItemProps, } from "./components/navigation-item/NavigationItem";
8
+ export { WorkspaceNavigation, WorkspacePanelToggleButton, workspaceNavigationVariants, } from "./components/workspace-navigation/WorkspaceNavigation";
9
+ export type { WorkspaceNavigationPresentation, WorkspaceNavigationProps, WorkspaceNavigationQuestion, WorkspacePanelSide, WorkspacePanelToggleButtonProps, } from "./components/workspace-navigation/WorkspaceNavigation";
6
10
  export { IconButton, iconButtonVariants, } from "./components/icon-button/IconButton";
7
11
  export type { IconButtonProps, IconButtonSize, IconButtonVariant, } from "./components/icon-button/IconButton";
8
12
  export { SegmentedTabs, segmentedTabsVariants, } from "./components/segmented-tabs/SegmentedTabs";
9
13
  export type { SegmentedTabItem, SegmentedTabsActivationMode, SegmentedTabsProps, SegmentedTabsSize, } from "./components/segmented-tabs/SegmentedTabs";
10
14
  export { PanelTabs } from "./components/panel-tabs/PanelTabs";
11
15
  export type { PanelTabItem, PanelTabsProps, } from "./components/panel-tabs/PanelTabs";
16
+ export { MITHRL_QUESTION_DRAG_TYPE, SecondaryPanel, } from "./components/secondary-panel/SecondaryPanel";
17
+ export type { SecondaryPanelDropTarget, SecondaryPanelProps, SecondaryPanelTab, SecondaryPanelTabKind, } from "./components/secondary-panel/SecondaryPanel";
12
18
  export { Switch, ThemeSwitch } from "./components/switch/Switch";
13
19
  export type { SwitchProps, ThemeMode, ThemeSwitchProps, } from "./components/switch/Switch";
14
20
  export { ToggleButton, toggleButtonVariants, } from "./components/toggle-button/ToggleButton";
@@ -19,6 +25,12 @@ export { TextField, textFieldVariants, } from "./components/text-field/TextField
19
25
  export type { TextFieldPreviewState, TextFieldProps, TextFieldStatus, TextFieldSurface, } from "./components/text-field/TextField";
20
26
  export { Textarea, textareaVariants } from "./components/textarea/Textarea";
21
27
  export type { TextareaPreviewState, TextareaProps, TextareaResize, TextareaStatus, TextareaSurface, } from "./components/textarea/Textarea";
28
+ export { Composer } from "./components/composer/Composer";
29
+ export type { ComposerLabels, ComposerMode, ComposerPreviewState, ComposerProps, ComposerStatus, } from "./components/composer/Composer";
30
+ export { ComposerViewTransition } from "./components/composer/ComposerViewTransition";
31
+ export type { ComposerView, ComposerViewTransitionProps, } from "./components/composer/ComposerViewTransition";
32
+ export { ComposerAttachmentView } from "./components/composer/ComposerAttachmentView";
33
+ export type { ComposerAttachmentViewProps, } from "./components/composer/ComposerAttachmentView";
22
34
  export { Select, selectVariants } from "./components/select/Select";
23
35
  export type { SelectPreviewState, SelectProps, SelectSize, } from "./components/select/Select";
24
36
  export { Link, linkVariants } from "./components/link/Link";
@@ -49,10 +61,16 @@ export { Field } from "./components/field/Field";
49
61
  export type { FieldControlProps, FieldControlStatus, FieldProps, FieldRenderProps, FieldSize, FieldState, } from "./components/field/Field";
50
62
  export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuLinkItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, dropdownMenuContentVariants, } from "./components/dropdown-menu/DropdownMenu";
51
63
  export type { DropdownMenuContentProps, DropdownMenuContentWidth, DropdownMenuGroupProps, DropdownMenuItemProps, DropdownMenuItemTone, DropdownMenuLabelProps, DropdownMenuLinkItemProps, DropdownMenuProps, DropdownMenuSeparatorProps, DropdownMenuTriggerProps, } from "./components/dropdown-menu/DropdownMenu";
64
+ export { PopoverSurface } from "./components/popover-surface/PopoverSurface";
65
+ export type { PopoverSurfaceProps } from "./components/popover-surface/PopoverSurface";
66
+ export { ProjectMenu } from "./components/project-menu/ProjectMenu";
67
+ export type { ProjectMenuLabels, ProjectMenuProject, ProjectMenuProps, } from "./components/project-menu/ProjectMenu";
68
+ export { Explorer } from "./components/explorer/Explorer";
69
+ export type { ExplorerLabels, ExplorerProps, ExplorerQuestion, ExplorerScientificOutput, ExplorerScientificOutputFolder, ExplorerScientificOutputNode, ExplorerScientificOutputType, ExplorerUploadFile, ExplorerUploadFileType, ExplorerUploadFolder, ExplorerUploadNode, } from "./components/explorer/Explorer";
52
70
  export { AccountMenu } from "./components/account-menu/AccountMenu";
53
71
  export type { AccountMenuAction, AccountMenuProps, } from "./components/account-menu/AccountMenu";
54
72
  export { GlobalAppBar } from "./components/global-app-bar/GlobalAppBar";
55
- export type { GlobalAppBarProps } from "./components/global-app-bar/GlobalAppBar";
73
+ export type { GlobalAppBarProjectSelector, GlobalAppBarProjectSelectorPresentation, GlobalAppBarProps, } from "./components/global-app-bar/GlobalAppBar";
56
74
  export { ProjectCard } from "./components/project-card/ProjectCard";
57
75
  export type { ProjectCardActivity, ProjectCardCreator, ProjectCardMetric, ProjectCardPresentation, ProjectCardPreviewArtwork, ProjectCardPreviewState, ProjectCardProps, } from "./components/project-card/ProjectCard";
58
76
  export { UploadQueue, UploadQueueItem } from "./components/upload-queue/UploadQueue";
@@ -65,3 +83,11 @@ export { FileDropzone } from "./components/file-dropzone/FileDropzone";
65
83
  export type { FileDropzoneHandle, FileDropzoneProps, FileDropzoneRejection, FileDropzoneRejectionReason, FileDropzoneSelection, FileDropzoneSelectionSource, FileDropzoneState, } from "./components/file-dropzone/FileDropzone";
66
84
  export { DialogBackdrop, DialogBody, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, DialogViewport, dialogPopupVariants, } from "./components/dialog/Dialog";
67
85
  export type { DialogBackdropProps, DialogBodyProps, DialogCloseButtonProps, DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogPopupProps, DialogPortalProps, DialogRootProps, DialogSize, DialogTitleProps, DialogTriggerProps, DialogViewportProps, } from "./components/dialog/Dialog";
86
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "./components/resizable-panels/ResizablePanels";
87
+ export type { ResizableHandleProps, ResizablePanelDirection, ResizablePanelGroupProps, ResizablePanelMinimum, ResizablePanelProps, } from "./components/resizable-panels/ResizablePanels";
88
+ export { WorkspaceAppShell } from "./patterns/workspace-app-shell/WorkspaceAppShell";
89
+ export { WorkspaceNewQuestionDialog } from "./patterns/workspace-app-shell/WorkspaceNewQuestionDialog";
90
+ export { WorkspaceQuestionSurface } from "./patterns/workspace-app-shell/WorkspaceQuestionSurface";
91
+ export type { WorkspaceAppShellNavigationRenderContext, WorkspaceAppShellNavigationRenderer, WorkspaceAppShellLayout, WorkspaceAppShellProps, WorkspaceNavigationConfiguration, } from "./patterns/workspace-app-shell/WorkspaceAppShell";
92
+ export type { WorkspaceNewQuestionDialogProps, WorkspaceNewQuestionDraft, } from "./patterns/workspace-app-shell/WorkspaceNewQuestionDialog";
93
+ export type { WorkspaceQuestionSurfacePanel, WorkspaceQuestionSurfaceProps, WorkspaceQuestionSurfaceScroll, } from "./patterns/workspace-app-shell/WorkspaceQuestionSurface";