@mithrl/design-system 0.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 (39) hide show
  1. package/README.md +63 -0
  2. package/dist/components/account-menu/AccountMenu.d.ts +27 -0
  3. package/dist/components/avatar/Avatar.d.ts +38 -0
  4. package/dist/components/badge/Badge.d.ts +28 -0
  5. package/dist/components/button/Button.d.ts +28 -0
  6. package/dist/components/checkbox/Checkbox.d.ts +27 -0
  7. package/dist/components/dialog/Dialog.d.ts +94 -0
  8. package/dist/components/dropdown-menu/DropdownMenu.d.ts +102 -0
  9. package/dist/components/field/Field.d.ts +62 -0
  10. package/dist/components/field-label/FieldLabel.d.ts +32 -0
  11. package/dist/components/field-message/FieldMessage.d.ts +23 -0
  12. package/dist/components/file-dropzone/FileDropzone.d.ts +54 -0
  13. package/dist/components/global-app-bar/GlobalAppBar.d.ts +77 -0
  14. package/dist/components/icon/Icon.d.ts +41 -0
  15. package/dist/components/icon-button/IconButton.d.ts +57 -0
  16. package/dist/components/link/Link.d.ts +39 -0
  17. package/dist/components/panel-tabs/PanelTabs.d.ts +46 -0
  18. package/dist/components/progress-indicator/ProgressIndicator.d.ts +28 -0
  19. package/dist/components/project-card/ProjectCard.d.ts +59 -0
  20. package/dist/components/radio/Radio.d.ts +23 -0
  21. package/dist/components/segmented-tabs/SegmentedTabs.d.ts +61 -0
  22. package/dist/components/select/Select.d.ts +40 -0
  23. package/dist/components/separator/Separator.d.ts +35 -0
  24. package/dist/components/skeleton/Skeleton.d.ts +17 -0
  25. package/dist/components/standard-tabs/StandardTabs.d.ts +54 -0
  26. package/dist/components/switch/Switch.d.ts +61 -0
  27. package/dist/components/tag/Tag.d.ts +27 -0
  28. package/dist/components/text-field/TextField.d.ts +46 -0
  29. package/dist/components/textarea/Textarea.d.ts +44 -0
  30. package/dist/components/toggle-button/ToggleButton.d.ts +47 -0
  31. package/dist/components/tooltip/Tooltip.d.ts +46 -0
  32. package/dist/components/upload-queue/UploadQueue.d.ts +73 -0
  33. package/dist/index.d.ts +67 -0
  34. package/dist/index.js +3869 -0
  35. package/dist/patterns/new-project-dialog/NewProjectDialog.d.ts +42 -0
  36. package/dist/patterns/project-library/ProjectLibrary.d.ts +101 -0
  37. package/dist/styles.css +2 -0
  38. package/dist/styles.d.ts +1 -0
  39. package/package.json +79 -0
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Mithrl Design System
2
+
3
+ The repository for Mithrl interface foundations, design references, and reusable React components, distributed under the `@mithrl` namespace.
4
+
5
+ ## Repository structure
6
+
7
+ - `tokens/foundations.tokens.json` is the canonical token registry.
8
+ - [`docs/`](docs/README.md) contains approved meaning, usage, rationale, and exceptions.
9
+ - `figma/` contains parity metadata and future Code Connect mappings; the Figma library is the design reference.
10
+ - `src/tokens/` contains the CSS implementation generated or synchronized from the registry.
11
+ - `src/components/` contains the production React components.
12
+ - `.storybook/` and `tests/` contain the review and verification layers.
13
+
14
+ ## Local review
15
+
16
+ Install dependencies, then start the executable Foundations reference:
17
+
18
+ ```bash
19
+ npm install
20
+ npm run storybook
21
+ ```
22
+
23
+ The first component implementation, Button, will follow in a separate pull
24
+ request after the Foundations baseline is approved.
25
+
26
+ ## Hosted Storybook
27
+
28
+ Pull requests validate the Storybook build without publishing it. After an
29
+ approved change is merged into `main`, GitHub Actions publishes the current
30
+ Storybook to GitHub Pages for the organization.
31
+
32
+ Pull request branches publish review builds through Chromatic after the
33
+ `CHROMATIC_PROJECT_TOKEN` repository secret is configured. See the
34
+ [workflow setup](docs/governance/workflow-setup.md) for the required settings.
35
+
36
+ ## Package use
37
+
38
+ The library build produces an installable package with React exports, types,
39
+ tokens, and component styles.
40
+
41
+ ```bash
42
+ npm run build
43
+ npm run check:package
44
+ ```
45
+
46
+ ```tsx
47
+ import "@mithrl/design-system/styles.css";
48
+ import { ProjectLibrary } from "@mithrl/design-system";
49
+ ```
50
+
51
+ Public package changes require a Changeset.
52
+
53
+ ```bash
54
+ npm run changeset
55
+ ```
56
+
57
+ ## Validation
58
+
59
+ ```bash
60
+ npm run test
61
+ npm run build
62
+ npm run build-storybook
63
+ ```
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from "react";
2
+ import { type DropdownMenuContentProps, type DropdownMenuItemProps } from "../dropdown-menu/DropdownMenu";
3
+
4
+ export type AccountMenuAction = {
5
+ /** Native destination for a navigational item. Omit it to render a button. */
6
+ href?: string;
7
+ /** Invoked by command items. Navigation remains owned by the anchor. */
8
+ onSelect?: DropdownMenuItemProps["onClick"];
9
+ /** Disables the action without changing the menu's structure. */
10
+ disabled?: boolean;
11
+ };
12
+ export type AccountMenuProps = Omit<DropdownMenuContentProps, "aria-label" | "children" | "width"> & {
13
+ /** Signed-in display name. Long names truncate to one line. */
14
+ displayName: string;
15
+ /** Supporting identity copy from the approved product contract. */
16
+ message?: string;
17
+ account?: AccountMenuAction;
18
+ settings?: AccountMenuAction;
19
+ signOut?: Omit<AccountMenuAction, "href">;
20
+ /** Optional replacement for the default action labels. */
21
+ labels?: Partial<Record<"account" | "settings" | "signOut", ReactNode>>;
22
+ };
23
+ /**
24
+ * Product-specific account actions composed from Dropdown Menu. The external
25
+ * native Avatar button trigger and open state remain owned by Global App Bar.
26
+ */
27
+ export declare function AccountMenu({ displayName, message, account, settings, signOut, labels, align, ...contentProps }: AccountMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { type HTMLAttributes } from "react";
3
+
4
+ export declare const avatarVariants: (props?: ({
5
+ size?: "default" | "large" | "small" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>["size"]>;
8
+ type RestrictedAvatarAttribute = "aria-hidden" | "aria-label" | "aria-live" | "children" | "onClick" | "onDoubleClick" | "onKeyDown" | "onKeyUp" | "role" | "tabIndex";
9
+ export type AvatarProps = Omit<HTMLAttributes<HTMLSpanElement>, RestrictedAvatarAttribute> & VariantProps<typeof avatarVariants> & {
10
+ /** Optional image source. The fallback stays visible until it loads. */
11
+ src?: string;
12
+ /** Consumer-supplied one- or two-grapheme fallback. */
13
+ initials?: string;
14
+ /**
15
+ * Accessible identity name. Without a label Avatar is decorative and
16
+ * hidden from assistive technology.
17
+ */
18
+ label?: string;
19
+ };
20
+ /**
21
+ * A compact, display-only identity primitive. Image content is revealed only
22
+ * after a successful load; otherwise Avatar shows supplied initials and then
23
+ * the official Lucide UserRound fallback through Icon.
24
+ */
25
+ export declare const Avatar: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, RestrictedAvatarAttribute> & VariantProps<(props?: ({
26
+ size?: "default" | "large" | "small" | null | undefined;
27
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
28
+ /** Optional image source. The fallback stays visible until it loads. */
29
+ src?: string;
30
+ /** Consumer-supplied one- or two-grapheme fallback. */
31
+ initials?: string;
32
+ /**
33
+ * Accessible identity name. Without a label Avatar is decorative and
34
+ * hidden from assistive technology.
35
+ */
36
+ label?: string;
37
+ } & import("react").RefAttributes<HTMLSpanElement>>;
38
+ export {};
@@ -0,0 +1,28 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { type HTMLAttributes, type ReactNode } from "react";
3
+ import { type IconGlyphComponent } from "../icon/Icon";
4
+
5
+ export declare const badgeVariants: (props?: ({
6
+ tone?: "destructive" | "information" | "neutral" | "success" | "warning" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type MetadataTone = NonNullable<VariantProps<typeof badgeVariants>["tone"]>;
9
+ type RestrictedBadgeAttribute = "aria-live" | "children" | "onClick" | "onDoubleClick" | "onKeyDown" | "onKeyUp" | "role" | "tabIndex";
10
+ export type BadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, RestrictedBadgeAttribute> & VariantProps<typeof badgeVariants> & {
11
+ /** Short visible count or compact version. */
12
+ children: ReactNode;
13
+ /** Optional approved Lucide glyph rendered through Icon/XSmall. */
14
+ icon?: IconGlyphComponent;
15
+ };
16
+ /**
17
+ * A static count or compact version. Badge is intentionally noninteractive;
18
+ * nearby visible text supplies context for bare numeric values.
19
+ */
20
+ export declare const Badge: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, RestrictedBadgeAttribute> & VariantProps<(props?: ({
21
+ tone?: "destructive" | "information" | "neutral" | "success" | "warning" | null | undefined;
22
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
23
+ /** Short visible count or compact version. */
24
+ children: ReactNode;
25
+ /** Optional approved Lucide glyph rendered through Icon/XSmall. */
26
+ icon?: IconGlyphComponent;
27
+ } & import("react").RefAttributes<HTMLSpanElement>>;
28
+ export {};
@@ -0,0 +1,28 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type { ButtonHTMLAttributes, ReactNode } from "react";
3
+
4
+ export declare const buttonVariants: (props?: ({
5
+ variant?: "brand" | "destructive" | "ghost" | "outline" | "primary" | "secondary" | "text" | null | undefined;
6
+ size?: "comfortable" | "compact" | "default" | "large" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>["variant"]>;
9
+ export type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>["size"]>;
10
+ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & VariantProps<typeof buttonVariants> & {
11
+ children: ReactNode;
12
+ loading?: boolean;
13
+ leadingIcon?: ReactNode;
14
+ trailingIcon?: ReactNode;
15
+ };
16
+ /**
17
+ * A labelled action control following the shadcn-style variant API and
18
+ * Mithrl's approved visual hierarchy. Icon-only actions use IconButton.
19
+ */
20
+ export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & VariantProps<(props?: ({
21
+ variant?: "brand" | "destructive" | "ghost" | "outline" | "primary" | "secondary" | "text" | null | undefined;
22
+ size?: "comfortable" | "compact" | "default" | "large" | null | undefined;
23
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
24
+ children: ReactNode;
25
+ loading?: boolean;
26
+ leadingIcon?: ReactNode;
27
+ trailingIcon?: ReactNode;
28
+ } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,27 @@
1
+ import { type InputHTMLAttributes } from "react";
2
+
3
+ export type CheckboxPreviewState = "hover" | "pressed" | "focus";
4
+ export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "aria-checked" | "children" | "className" | "type"> & {
5
+ /** Mixed parent/child selection; assigned through the native DOM property. */
6
+ indeterminate?: boolean;
7
+ /** Class applied to the 28px visual root. */
8
+ className?: string;
9
+ /** Class applied directly to the native checkbox input. */
10
+ inputClassName?: string;
11
+ /** Storybook-only hook for reviewing non-persistent CSS states. */
12
+ "data-preview-state"?: CheckboxPreviewState;
13
+ };
14
+ /**
15
+ * Native form checkbox with the approved compact Mithrl visual. Visible labels,
16
+ * descriptions, validation, and group policy belong to the owning composition.
17
+ */
18
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "aria-checked" | "children" | "className" | "type"> & {
19
+ /** Mixed parent/child selection; assigned through the native DOM property. */
20
+ indeterminate?: boolean;
21
+ /** Class applied to the 28px visual root. */
22
+ className?: string;
23
+ /** Class applied directly to the native checkbox input. */
24
+ inputClassName?: string;
25
+ /** Storybook-only hook for reviewing non-persistent CSS states. */
26
+ "data-preview-state"?: CheckboxPreviewState;
27
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,94 @@
1
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
4
+ import { type IconButtonProps } from "../icon-button/IconButton";
5
+
6
+ export declare const dialogPopupVariants: (props?: ({
7
+ size?: "default" | "large" | "small" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ export type DialogSize = NonNullable<VariantProps<typeof dialogPopupVariants>["size"]>;
10
+ export type DialogRootProps = Omit<ComponentPropsWithoutRef<typeof BaseDialog.Root>, "modal">;
11
+ export type DialogTriggerProps = ComponentPropsWithoutRef<typeof BaseDialog.Trigger>;
12
+ export type DialogPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;
13
+ /**
14
+ * Modal state owner. Base UI provides focus trapping, outside-page inertness,
15
+ * Escape dismissal, scroll locking, and focus return.
16
+ */
17
+ export declare function DialogRoot(props: DialogRootProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare const DialogTrigger: BaseDialog.Trigger;
19
+ export declare const DialogPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
20
+ export type DialogBackdropProps = Omit<ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>, "className"> & {
21
+ className?: string;
22
+ };
23
+ export declare const DialogBackdrop: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").DialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "className"> & {
24
+ className?: string;
25
+ } & import("react").RefAttributes<HTMLDivElement>>;
26
+ export type DialogViewportProps = Omit<ComponentPropsWithoutRef<typeof BaseDialog.Viewport>, "className"> & {
27
+ className?: string;
28
+ };
29
+ export declare const DialogViewport: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").DialogViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "className"> & {
30
+ className?: string;
31
+ } & import("react").RefAttributes<HTMLDivElement>>;
32
+ export type DialogPopupProps = Omit<ComponentPropsWithoutRef<typeof BaseDialog.Popup>, "className"> & VariantProps<typeof dialogPopupVariants> & {
33
+ className?: string;
34
+ };
35
+ export declare const DialogPopup: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").DialogPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "className"> & VariantProps<(props?: ({
36
+ size?: "default" | "large" | "small" | null | undefined;
37
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
38
+ className?: string;
39
+ } & import("react").RefAttributes<HTMLDivElement>>;
40
+ export type DialogHeaderProps = ComponentPropsWithoutRef<"header">;
41
+ export declare const DialogHeader: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
42
+ export type DialogTitleProps = Omit<ComponentPropsWithoutRef<typeof BaseDialog.Title>, "className"> & {
43
+ className?: string;
44
+ };
45
+ export declare const DialogTitle: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").DialogTitleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>, "ref">, "className"> & {
46
+ className?: string;
47
+ } & import("react").RefAttributes<HTMLHeadingElement>>;
48
+ export type DialogDescriptionProps = Omit<ComponentPropsWithoutRef<typeof BaseDialog.Description>, "className"> & {
49
+ className?: string;
50
+ };
51
+ export declare const DialogDescription: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").DialogDescriptionProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>, "ref">, "className"> & {
52
+ className?: string;
53
+ } & import("react").RefAttributes<HTMLParagraphElement>>;
54
+ export type DialogBodyProps = ComponentPropsWithoutRef<"div">;
55
+ /**
56
+ * The Dialog's only scroll owner. A top fade appears after content starts
57
+ * leaving the readable region; at rest, the first item keeps a clear inset.
58
+ */
59
+ export declare const DialogBody: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
60
+ export type DialogFooterProps = ComponentPropsWithoutRef<"footer">;
61
+ export declare const DialogFooter: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
62
+ export type DialogCloseProps = ComponentPropsWithoutRef<typeof BaseDialog.Close>;
63
+ export declare const DialogClose: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
64
+ export type DialogCloseButtonProps = Omit<IconButtonProps, "icon" | "variant" | "size" | "aria-label"> & {
65
+ label?: string;
66
+ };
67
+ /** Approved, accessible close action using the shared Icon Button primitive. */
68
+ export declare const DialogCloseButton: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "aria-label" | "icon" | "size" | "variant"> & {
69
+ label?: string;
70
+ } & import("react").RefAttributes<HTMLButtonElement>>;
71
+ export type DialogContentProps = {
72
+ children: ReactNode;
73
+ /** Portal destination used to retain a local Light or Dark theme boundary. */
74
+ portalContainer?: DialogPortalProps["container"];
75
+ keepMounted?: DialogPortalProps["keepMounted"];
76
+ backdropProps?: DialogBackdropProps;
77
+ viewportProps?: DialogViewportProps;
78
+ } & DialogPopupProps;
79
+ /**
80
+ * Convenience layer for the approved Portal → Backdrop → Viewport → Popup
81
+ * structure. Header, Body, and Footer remain explicitly compositional.
82
+ */
83
+ export declare const DialogContent: import("react").ForwardRefExoticComponent<{
84
+ children: ReactNode;
85
+ /** Portal destination used to retain a local Light or Dark theme boundary. */
86
+ portalContainer?: DialogPortalProps["container"];
87
+ keepMounted?: DialogPortalProps["keepMounted"];
88
+ backdropProps?: DialogBackdropProps;
89
+ viewportProps?: DialogViewportProps;
90
+ } & Omit<Omit<Omit<import("@base-ui/react").DialogPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "className"> & VariantProps<(props?: ({
91
+ size?: "default" | "large" | "small" | null | undefined;
92
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
93
+ className?: string;
94
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,102 @@
1
+ import { Menu } from "@base-ui/react/menu";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
4
+
5
+ export declare const dropdownMenuContentVariants: (props?: ({
6
+ width?: "compact" | "default" | "maximum" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type DropdownMenuContentWidth = NonNullable<VariantProps<typeof dropdownMenuContentVariants>["width"]>;
9
+ export type DropdownMenuItemTone = "neutral" | "destructive";
10
+ export declare const DropdownMenuTrigger: Menu.Trigger;
11
+ export type DropdownMenuProps = ComponentPropsWithoutRef<typeof Menu.Root>;
12
+ export type DropdownMenuTriggerProps = ComponentPropsWithoutRef<typeof Menu.Trigger>;
13
+ /**
14
+ * Menu state owner. Mithrl menus are non-modal by default so outside content
15
+ * remains available while the menu is open; consumers may opt into modal
16
+ * behavior explicitly when a documented composition requires it.
17
+ */
18
+ export declare function DropdownMenu({ modal, ...props }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
19
+ export type DropdownMenuContentProps = Omit<ComponentPropsWithoutRef<typeof Menu.Positioner>, "children" | "className"> & {
20
+ children: ReactNode;
21
+ /** Approved preset width. Product compositions document wider exceptions. */
22
+ width?: DropdownMenuContentWidth;
23
+ /** Class applied to the positioned layer rather than the popup surface. */
24
+ positionerClassName?: string;
25
+ /** Class applied to the popup surface. */
26
+ className?: string;
27
+ /** Keeps the portal mounted while closed for controlled exit workflows. */
28
+ keepMounted?: boolean;
29
+ /** Optional portal owner, useful when a local theme boundary must be retained. */
30
+ portalContainer?: ComponentPropsWithoutRef<typeof Menu.Portal>["container"];
31
+ /** Focus destination after dismissal. Defaults to Base UI's trigger return. */
32
+ finalFocus?: ComponentPropsWithoutRef<typeof Menu.Popup>["finalFocus"];
33
+ /** Accessible name when no visible group label names the menu. */
34
+ "aria-label"?: string;
35
+ };
36
+ /**
37
+ * Portalled, collision-aware menu surface. Trigger styling remains external.
38
+ * The Base UI behavior layer owns dismissal, roving focus, typeahead, focus
39
+ * return, and positioning while Mithrl owns geometry, tokens, and motion.
40
+ */
41
+ export declare const DropdownMenuContent: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").MenuPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "children" | "className"> & {
42
+ children: ReactNode;
43
+ /** Approved preset width. Product compositions document wider exceptions. */
44
+ width?: DropdownMenuContentWidth;
45
+ /** Class applied to the positioned layer rather than the popup surface. */
46
+ positionerClassName?: string;
47
+ /** Class applied to the popup surface. */
48
+ className?: string;
49
+ /** Keeps the portal mounted while closed for controlled exit workflows. */
50
+ keepMounted?: boolean;
51
+ /** Optional portal owner, useful when a local theme boundary must be retained. */
52
+ portalContainer?: ComponentPropsWithoutRef<typeof Menu.Portal>["container"];
53
+ /** Focus destination after dismissal. Defaults to Base UI's trigger return. */
54
+ finalFocus?: ComponentPropsWithoutRef<typeof Menu.Popup>["finalFocus"];
55
+ /** Accessible name when no visible group label names the menu. */
56
+ "aria-label"?: string;
57
+ } & import("react").RefAttributes<HTMLDivElement>>;
58
+ export type DropdownMenuGroupProps = Omit<ComponentPropsWithoutRef<typeof Menu.Group>, "className"> & {
59
+ className?: string;
60
+ };
61
+ export declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").MenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "className"> & {
62
+ className?: string;
63
+ } & import("react").RefAttributes<HTMLDivElement>>;
64
+ export type DropdownMenuLabelProps = Omit<ComponentPropsWithoutRef<typeof Menu.GroupLabel>, "className"> & {
65
+ className?: string;
66
+ };
67
+ export declare const DropdownMenuLabel: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").MenuGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "className"> & {
68
+ className?: string;
69
+ } & import("react").RefAttributes<HTMLDivElement>>;
70
+ export type DropdownMenuItemProps = Omit<ComponentPropsWithoutRef<typeof Menu.Item>, "children" | "className" | "nativeButton" | "render"> & {
71
+ children: ReactNode;
72
+ leadingIcon?: ReactNode;
73
+ shortcut?: ReactNode;
74
+ tone?: DropdownMenuItemTone;
75
+ className?: string;
76
+ };
77
+ export declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").MenuItemProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref">, "children" | "className" | "nativeButton" | "render"> & {
78
+ children: ReactNode;
79
+ leadingIcon?: ReactNode;
80
+ shortcut?: ReactNode;
81
+ tone?: DropdownMenuItemTone;
82
+ className?: string;
83
+ } & import("react").RefAttributes<HTMLElement>>;
84
+ export type DropdownMenuLinkItemProps = Omit<ComponentPropsWithoutRef<typeof Menu.LinkItem>, "children" | "className"> & {
85
+ children: ReactNode;
86
+ leadingIcon?: ReactNode;
87
+ shortcut?: ReactNode;
88
+ className?: string;
89
+ };
90
+ export declare const DropdownMenuLinkItem: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").MenuLinkItemProps, "ref"> & import("react").RefAttributes<Element>, "ref">, "children" | "className"> & {
91
+ children: ReactNode;
92
+ leadingIcon?: ReactNode;
93
+ shortcut?: ReactNode;
94
+ className?: string;
95
+ } & import("react").RefAttributes<Element>>;
96
+ export type DropdownMenuSeparatorProps = Omit<ComponentPropsWithoutRef<typeof Menu.Separator>, "children" | "className" | "orientation"> & {
97
+ className?: string;
98
+ };
99
+ export declare const DropdownMenuSeparator: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").SeparatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "children" | "className" | "orientation"> & {
100
+ className?: string;
101
+ } & import("react").RefAttributes<HTMLDivElement>>;
102
+ export declare function DropdownMenuShortcut({ className, ...props }: ComponentPropsWithoutRef<"span">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+
3
+ export type FieldSize = "standard" | "compact";
4
+ export type FieldState = "default" | "warning" | "error";
5
+ export type FieldControlStatus = "default" | "warning";
6
+ export type FieldControlProps = {
7
+ id: string;
8
+ required?: boolean;
9
+ disabled?: boolean;
10
+ "aria-invalid"?: true;
11
+ "aria-describedby"?: string;
12
+ "aria-errormessage"?: string;
13
+ };
14
+ export type FieldRenderProps = {
15
+ /** Native and ARIA props that must be spread onto the labelable control. */
16
+ controlProps: FieldControlProps;
17
+ /** Advisory surface supported by Text Field and Textarea. */
18
+ status: FieldControlStatus;
19
+ };
20
+ type FieldRequirement = {
21
+ required: true;
22
+ optional?: never;
23
+ } | {
24
+ optional: true;
25
+ required?: never;
26
+ } | {
27
+ required?: false;
28
+ optional?: false;
29
+ };
30
+ type FieldFeedback = {
31
+ warning: ReactNode;
32
+ error?: never;
33
+ description?: never;
34
+ } | {
35
+ error: ReactNode;
36
+ warning?: never;
37
+ description?: ReactNode;
38
+ } | {
39
+ warning?: never;
40
+ error?: never;
41
+ description?: ReactNode;
42
+ };
43
+ export type FieldProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & FieldRequirement & FieldFeedback & {
44
+ /** Persistent visible name for the control. */
45
+ label: ReactNode;
46
+ /** Receives the resolved association props without cloning a child. */
47
+ children: (props: FieldRenderProps) => ReactNode;
48
+ /** Consumer-owned ID. A stable generated ID is used when omitted. */
49
+ controlId?: string;
50
+ /** Consumer-owned description IDs merged before Field-owned IDs. */
51
+ describedBy?: string;
52
+ size?: FieldSize;
53
+ /** Propagates the native disabled state and readable label treatment. */
54
+ disabled?: boolean;
55
+ };
56
+ /**
57
+ * Associates one persistent label and its feedback with one labelable control.
58
+ * Products own validation timing, live announcements, and control-specific
59
+ * behavior such as read-only state.
60
+ */
61
+ export declare function Field({ label, children, controlId, describedBy, size, description, warning, error, required, optional, disabled, className, ...props }: FieldProps): import("react/jsx-runtime").JSX.Element;
62
+ export {};
@@ -0,0 +1,32 @@
1
+ import { type LabelHTMLAttributes, type ReactNode } from "react";
2
+
3
+ export declare const fieldLabelVariants: (props?: ({
4
+ size?: "compact" | "standard" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export type FieldLabelSize = "standard" | "compact";
7
+ export type FieldLabelProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, "className"> & {
8
+ /** Approved semantic typography size. */
9
+ size?: FieldLabelSize;
10
+ /** Shows the explicit optional-field cue approved for Field composition. */
11
+ optional?: boolean;
12
+ /** Applies readable lower emphasis when the associated control is disabled. */
13
+ disabled?: boolean;
14
+ /** Class applied to the native label element. */
15
+ className?: string;
16
+ children: ReactNode;
17
+ };
18
+ /**
19
+ * Persistent visible name for one native form control. Field layout, messages,
20
+ * generated IDs, and validation behavior belong to the containing composition.
21
+ */
22
+ export declare const FieldLabel: import("react").ForwardRefExoticComponent<Omit<LabelHTMLAttributes<HTMLLabelElement>, "className"> & {
23
+ /** Approved semantic typography size. */
24
+ size?: FieldLabelSize;
25
+ /** Shows the explicit optional-field cue approved for Field composition. */
26
+ optional?: boolean;
27
+ /** Applies readable lower emphasis when the associated control is disabled. */
28
+ disabled?: boolean;
29
+ /** Class applied to the native label element. */
30
+ className?: string;
31
+ children: ReactNode;
32
+ } & import("react").RefAttributes<HTMLLabelElement>>;
@@ -0,0 +1,23 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { type HTMLAttributes, type ReactNode } from "react";
3
+
4
+ export declare const fieldMessageVariants: (props?: ({
5
+ tone?: "error" | "helper" | "warning" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type FieldMessageTone = NonNullable<VariantProps<typeof fieldMessageVariants>["tone"]>;
8
+ export type FieldMessageProps = Omit<HTMLAttributes<HTMLParagraphElement>, "children" | "className"> & VariantProps<typeof fieldMessageVariants> & {
9
+ /** Supporting or validation text for one form control. */
10
+ children: ReactNode;
11
+ className?: string;
12
+ };
13
+ /**
14
+ * Supporting or validation text for one form control. The consumer owns the
15
+ * ID, ARIA relationship, live-region policy, and validation behavior.
16
+ */
17
+ export declare const FieldMessage: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLParagraphElement>, "children" | "className"> & VariantProps<(props?: ({
18
+ tone?: "error" | "helper" | "warning" | null | undefined;
19
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
20
+ /** Supporting or validation text for one form control. */
21
+ children: ReactNode;
22
+ className?: string;
23
+ } & import("react").RefAttributes<HTMLParagraphElement>>;
@@ -0,0 +1,54 @@
1
+ import { type HTMLAttributes } from "react";
2
+
3
+ export type FileDropzoneSelectionSource = "browse" | "folder" | "drop";
4
+ export type FileDropzoneSelection = {
5
+ files: File[];
6
+ source: FileDropzoneSelectionSource;
7
+ };
8
+ export type FileDropzoneRejectionReason = "count" | "size" | "type";
9
+ export type FileDropzoneRejection = {
10
+ files: File[];
11
+ reason: FileDropzoneRejectionReason;
12
+ message: string;
13
+ };
14
+ export type FileDropzoneState = "default" | "drag-active" | "drag-rejected" | "disabled" | "selection-received";
15
+ export type FileDropzoneHandle = {
16
+ browseFiles: () => void;
17
+ browseFolder: () => void;
18
+ focusBrowse: () => void;
19
+ };
20
+ export type FileDropzoneProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onDrop" | "onDragEnter" | "onDragLeave" | "onDragOver"> & {
21
+ /** Persistent accessible name for the acquisition control. */
22
+ label: string;
23
+ /** Native accept policy, for example `.csv,application/pdf,image/*`. */
24
+ accept?: string;
25
+ multiple?: boolean;
26
+ enableFolderSelection?: boolean;
27
+ maxFiles?: number;
28
+ maxFileSize?: number;
29
+ disabled?: boolean;
30
+ onSelection?: (selection: FileDropzoneSelection) => void;
31
+ onReject?: (rejection: FileDropzoneRejection) => void;
32
+ /** Review-only state hook used by Storybook and visual regression tests. */
33
+ "data-preview-state"?: FileDropzoneState;
34
+ };
35
+ /**
36
+ * Generic file and folder acquisition surface. FileDropzone normalizes native
37
+ * picker and drop selections; upload lifecycle and product persistence remain
38
+ * with the owning workflow.
39
+ */
40
+ export declare const FileDropzone: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & {
41
+ /** Persistent accessible name for the acquisition control. */
42
+ label: string;
43
+ /** Native accept policy, for example `.csv,application/pdf,image/*`. */
44
+ accept?: string;
45
+ multiple?: boolean;
46
+ enableFolderSelection?: boolean;
47
+ maxFiles?: number;
48
+ maxFileSize?: number;
49
+ disabled?: boolean;
50
+ onSelection?: (selection: FileDropzoneSelection) => void;
51
+ onReject?: (rejection: FileDropzoneRejection) => void;
52
+ /** Review-only state hook used by Storybook and visual regression tests. */
53
+ "data-preview-state"?: FileDropzoneState;
54
+ } & import("react").RefAttributes<FileDropzoneHandle>>;