@instruments/materia-ui 0.4.5 → 0.4.7

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 (127) hide show
  1. package/agent-docs.md +4 -0
  2. package/dist/components/accordion/accordion-variants.js +1 -0
  3. package/dist/components/alert/alert-root.js +1 -0
  4. package/dist/components/anchor/anchor-root.js +1 -0
  5. package/dist/components/aspect-ratio/aspect-ratio-root.d.ts +7 -3
  6. package/dist/components/aspect-ratio/aspect-ratio-root.js +5 -3
  7. package/dist/components/avatar/avatar-badge.d.ts +1 -1
  8. package/dist/components/avatar/avatar-fallback.d.ts +1 -1
  9. package/dist/components/avatar/avatar-root.d.ts +1 -1
  10. package/dist/components/avatar/avatar-status.d.ts +2 -1
  11. package/dist/components/badge/badge-button.d.ts +1 -0
  12. package/dist/components/badge/badge-button.js +1 -0
  13. package/dist/components/badge/badge-root.d.ts +4 -1
  14. package/dist/components/breadcrumb/breadcrumb-root.d.ts +1 -0
  15. package/dist/components/button/button-variants.js +7 -0
  16. package/dist/components/button-group/button-group-root.js +4 -0
  17. package/dist/components/card/card-root.d.ts +1 -0
  18. package/dist/components/card/card-root.js +1 -0
  19. package/dist/components/checkbox-card/checkbox-card-root.d.ts +1 -1
  20. package/dist/components/checkbox-field/checkbox-field-root.d.ts +4 -1
  21. package/dist/components/context-menu/context-menu-checkbox-item.d.ts +1 -1
  22. package/dist/components/context-menu/context-menu-content.d.ts +1 -1
  23. package/dist/components/context-menu/context-menu-item.d.ts +1 -1
  24. package/dist/components/context-menu/context-menu-radio-item.d.ts +1 -1
  25. package/dist/components/context-menu/context-menu-separator.d.ts +2 -2
  26. package/dist/components/context-menu/context-menu-separator.js +1 -1
  27. package/dist/components/context-menu/context-menu-sub-trigger.d.ts +1 -1
  28. package/dist/components/dot/dot-root.js +1 -0
  29. package/dist/components/drawer/drawer-root.d.ts +1 -0
  30. package/dist/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +1 -1
  31. package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +1 -1
  32. package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +1 -1
  33. package/dist/components/dropdown-menu/dropdown-menu-radio-item.d.ts +1 -1
  34. package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -2
  35. package/dist/components/dropdown-menu/dropdown-menu-separator.js +1 -1
  36. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
  37. package/dist/components/empty/empty-root.js +1 -0
  38. package/dist/components/expand-button/expand-button-root.js +1 -0
  39. package/dist/components/field/field-error.d.ts +1 -0
  40. package/dist/components/field/field-variants.js +1 -0
  41. package/dist/components/icon-box/icon-box-root.js +4 -0
  42. package/dist/components/identified-surface.d.ts +5 -0
  43. package/dist/components/input/input-variants.js +1 -0
  44. package/dist/components/input-card/input-card-root.d.ts +3 -0
  45. package/dist/components/input-group/input-group-button.d.ts +7 -3
  46. package/dist/components/item/item-group.js +1 -0
  47. package/dist/components/item/item-media.d.ts +8 -0
  48. package/dist/components/item/item-media.js +1 -0
  49. package/dist/components/item/item-root.d.ts +1 -0
  50. package/dist/components/item/item-root.js +1 -0
  51. package/dist/components/kbd/kbd-root.js +2 -0
  52. package/dist/components/media-frame/media-frame-root.d.ts +2 -0
  53. package/dist/components/media-frame/media-frame-root.js +2 -0
  54. package/dist/components/menu-item/menu-item-variants.js +5 -0
  55. package/dist/components/menu-parts-types.d.ts +82 -0
  56. package/dist/components/menu-parts-types.js +1 -0
  57. package/dist/components/menu-parts.d.ts +3 -66
  58. package/dist/components/menubar/menubar-checkbox-item.d.ts +1 -1
  59. package/dist/components/menubar/menubar-content.d.ts +1 -1
  60. package/dist/components/menubar/menubar-item.d.ts +1 -1
  61. package/dist/components/menubar/menubar-radio-item.d.ts +1 -1
  62. package/dist/components/menubar/menubar-separator.d.ts +2 -2
  63. package/dist/components/menubar/menubar-separator.js +1 -1
  64. package/dist/components/menubar/menubar-sub-trigger.d.ts +1 -1
  65. package/dist/components/phone-input/phone-input-root.js +2 -0
  66. package/dist/components/pill/pill-root.d.ts +1 -0
  67. package/dist/components/pill/pill-variants.js +3 -0
  68. package/dist/components/popover/popover-root.d.ts +2 -0
  69. package/dist/components/progress/progress-root.d.ts +2 -0
  70. package/dist/components/scroll-frame/scroll-frame-root.d.ts +8 -2
  71. package/dist/components/segmented-control/segmented-control-root.d.ts +8 -2
  72. package/dist/components/select/select-content.d.ts +1 -0
  73. package/dist/components/select/select-trigger.d.ts +9 -1
  74. package/dist/components/select/select-trigger.js +1 -1
  75. package/dist/components/sidepanel/sidepanel-header.d.ts +4 -0
  76. package/dist/components/sub-navigation/sub-navigation-link.d.ts +1 -0
  77. package/dist/components/swatch/swatch-root.d.ts +2 -0
  78. package/dist/components/swatch/swatch-root.js +2 -0
  79. package/dist/components/swatch/swatch-tile.d.ts +2 -1
  80. package/dist/components/swatch/swatch-tile.js +1 -1
  81. package/dist/components/tab-navigation/tab-navigation-link.d.ts +1 -0
  82. package/dist/components/tabs/tabs-panel.d.ts +4 -0
  83. package/dist/components/tabs/tabs-variants.js +4 -0
  84. package/dist/components/thinking-loader/thinking-loader-counter.d.ts +2 -0
  85. package/dist/components/thinking-loader/thinking-loader-icon.d.ts +2 -0
  86. package/dist/components/thinking-loader/thinking-loader-step.d.ts +2 -0
  87. package/dist/components/toggle/toggle-root.js +2 -0
  88. package/dist/components/voice/voice-error-popover.d.ts +2 -0
  89. package/dist/components/voice/voice-pill.d.ts +2 -0
  90. package/dist/compositions/attribute-card.d.ts +1 -0
  91. package/dist/compositions/card-grid/card-grid-rows.d.ts +13 -0
  92. package/dist/compositions/data-grid/data-grid-checkbox.d.ts +8 -0
  93. package/dist/compositions/data-grid/data-grid-expand.d.ts +1 -0
  94. package/dist/compositions/data-grid/data-grid-filterable-header.d.ts +1 -0
  95. package/dist/compositions/data-grid/data-grid-types.d.ts +6 -0
  96. package/dist/compositions/data-grid-column-header/data-grid-column-header-root.d.ts +5 -0
  97. package/dist/compositions/data-grid-table/data-grid-table-body.d.ts +13 -1
  98. package/dist/compositions/data-grid-table/data-grid-table-body.js +1 -1
  99. package/dist/compositions/data-grid-table/data-grid-table-header.d.ts +5 -0
  100. package/dist/compositions/document-list/document-list-icon.d.ts +1 -0
  101. package/dist/compositions/document-list/document-list-root.js +4 -0
  102. package/dist/compositions/editorial-card/editorial-card-content.d.ts +2 -0
  103. package/dist/compositions/file-upload/file-upload-dropzone.d.ts +3 -0
  104. package/dist/compositions/folder-tile/folder-tile-types.d.ts +2 -0
  105. package/dist/compositions/mobile-navigation/mobile-navigation-header.d.ts +5 -2
  106. package/dist/compositions/mobile-navigation/mobile-navigation-header.js +0 -1
  107. package/dist/compositions/mobile-navigation/mobile-navigation-item.d.ts +2 -0
  108. package/dist/compositions/mobile-navigation/mobile-navigation-profile.d.ts +1 -0
  109. package/dist/compositions/mobile-navigation/mobile-navigation-root.d.ts +1 -0
  110. package/dist/compositions/page-toolbar/page-toolbar-applied.d.ts +4 -1
  111. package/dist/compositions/page-toolbar/page-toolbar-sort.d.ts +3 -0
  112. package/dist/compositions/product-card/product-card-content.d.ts +1 -0
  113. package/dist/compositions/product-card/product-card-image-types.d.ts +8 -2
  114. package/dist/compositions/product-card/product-card-provider-types.d.ts +47 -2
  115. package/dist/compositions/product-card/product-card-root.d.ts +3 -0
  116. package/dist/compositions/product-card/product-card-root.js +2 -0
  117. package/dist/compositions/product-card/product-card-swatch.d.ts +2 -0
  118. package/dist/compositions/product-card/product-card-tools-types.d.ts +6 -0
  119. package/dist/compositions/product-specifications-selector/product-specifications-selector.d.ts +14 -0
  120. package/dist/compositions/sidebar/sidebar-group.d.ts +4 -0
  121. package/dist/compositions/sidebar/sidebar-menu-button.d.ts +11 -0
  122. package/dist/compositions/sidebar/sidebar-menu-sub.d.ts +4 -0
  123. package/dist/compositions/sidebar/sidebar-trigger.d.ts +2 -0
  124. package/dist/compositions/variant-selector/variant-selector-item.d.ts +1 -0
  125. package/dist/data/docs-manifest.js +580 -32
  126. package/dist/utils/with-test-id.d.ts +1 -0
  127. package/package.json +2 -1
@@ -5,6 +5,14 @@ declare const itemMediaVariants: (props?: ({
5
5
  variant?: "default" | "icon" | "image" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export interface ItemMediaProps extends Omit<React.ComponentProps<"div">, keyof IconBoxProps>, Omit<Partial<IconBoxProps>, "variant">, VariantProps<typeof itemMediaVariants> {
8
+ /** Has no effect: the `icon` variant always renders a `neutral` icon box. */
9
+ tone?: IconBoxProps["tone"];
10
+ /** Has no effect: the `icon` variant always renders the default icon box corners. */
11
+ radius?: IconBoxProps["radius"];
12
+ /** Has no effect: the `icon` variant always renders a `sm` (32px) icon box. */
13
+ size?: IconBoxProps["size"];
14
+ /** Has no effect: the `icon` variant always renders the default solid icon box. */
15
+ emphasis?: IconBoxProps["emphasis"];
8
16
  }
9
17
  /**
10
18
  * Leading media slot for an item - renders an IconBox when `variant="icon"`,
@@ -7,6 +7,7 @@ const itemMediaVariants = cva("flex shrink-0 items-center justify-center gap-2 g
7
7
  variant: "default",
8
8
  },
9
9
  variants: {
10
+ /** Media type: `icon` renders the `icon` prop in a small neutral `IconBox`, `image` crops its child `<img>` to a 40px square, `default` wraps any children as they are. @default "default" */
10
11
  variant: {
11
12
  default: "",
12
13
  icon: "",
@@ -18,6 +18,7 @@ declare const itemVariants: (props?: ({
18
18
  size?: "2xl" | "2xs" | "3xl" | "base" | "lg" | "sm" | "xl" | "xs" | null | undefined;
19
19
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
20
20
  export interface ItemProps extends useRender.ComponentProps<"div">, Omit<VariantProps<typeof itemVariants>, "size"> {
21
+ /** Padding and gap between the item's parts, `2xs` (tightest) to `3xl` (roomiest). @default "base" */
21
22
  size?: ComponentSize;
22
23
  }
23
24
  /**
@@ -45,6 +45,7 @@ const itemVariants = cva(cn(focusRing(), "group/item duration-quick text-paragra
45
45
  variant: "default",
46
46
  },
47
47
  variants: {
48
+ /** Surface: `default` is transparent, `outline` adds a border, `muted` a faint fill, `card` a bordered rounded card. Inside an `ItemGroup` the group's variant overrides most of this. @default "default" */
48
49
  variant: {
49
50
  default: "bg-transparent",
50
51
  outline: "border-border border",
@@ -88,11 +88,13 @@ const kbdVariants = cva("pointer-events-none inline-flex w-fit items-center just
88
88
  tone: "neutral",
89
89
  },
90
90
  variants: {
91
+ /** Semantic colour: `neutral` for ordinary keys, `brand` to highlight one, `danger` for a destructive shortcut. `brand` and `danger` are only styled with `emphasis="solid"`. @default "neutral" */
91
92
  tone: {
92
93
  neutral: "",
93
94
  brand: "",
94
95
  danger: "",
95
96
  },
97
+ /** Fill treatment: `solid` is a muted chip, `soft` a secondary-coloured fill, `outline` a bordered key on the page background, `ghost` bare text. @default "solid" */
96
98
  emphasis: {
97
99
  solid: "",
98
100
  soft: "",
@@ -51,6 +51,8 @@ export interface MediaFrameProps extends useRender.ComponentProps<"div"> {
51
51
  * @bestPractice Use `as` to change the element (a tag); use `render` only to swap in a component (e.g. a router Link). Never `render={<Box as=…/>}` - pass `as` directly.
52
52
  * @bestPractice Set `edge` to frame photography with an inset hairline that stays above the media; do not fake it with a border or an inset shadow on the frame, which the media hides.
53
53
  * @bestPractice Reach for `raised` only when the frame sits on the same fill as its surface; in a dense row the edge already separates it.
54
+ * @bestPractice Frame a material, swatch or sample square: give the frame `aspect-square` (or wrap it in `AspectRatio`, which defaults to 1:1). Never crop a material landscape.
55
+ * @keywords material image, product image, photo frame, thumbnail
54
56
  * @category layout
55
57
  */
56
58
  export declare const MediaFrame: ({ as, className, children, edge, raised, ref, render, ...props }: MediaFrameProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -25,6 +25,8 @@ import { reportDevIssue } from "../../utils/dev-issue.js";
25
25
  * @bestPractice Use `as` to change the element (a tag); use `render` only to swap in a component (e.g. a router Link). Never `render={<Box as=…/>}` - pass `as` directly.
26
26
  * @bestPractice Set `edge` to frame photography with an inset hairline that stays above the media; do not fake it with a border or an inset shadow on the frame, which the media hides.
27
27
  * @bestPractice Reach for `raised` only when the frame sits on the same fill as its surface; in a dense row the edge already separates it.
28
+ * @bestPractice Frame a material, swatch or sample square: give the frame `aspect-square` (or wrap it in `AspectRatio`, which defaults to 1:1). Never crop a material landscape.
29
+ * @keywords material image, product image, photo frame, thumbnail
28
30
  * @category layout
29
31
  */
30
32
  export const MediaFrame = ({ as, className, children, edge = false, raised = false, ref, render, ...props }) => {
@@ -128,10 +128,12 @@ const menuItemVariants = cva(`duration-quick hover:duration-instant focus:durati
128
128
  variant: "default",
129
129
  },
130
130
  variants: {
131
+ /** Row height, padding and text size, on the shared component scale. Match the surrounding menu's `size`. @default "sm" */
131
132
  size: MENU_ITEM_SIZE_CLASSES,
132
133
  // Surface axis (background/hover treatment). The former `destructive`
133
134
  // member split off onto the orthogonal `tone` axis below, so a
134
135
  // destructive item of any surface is now expressible.
136
+ /** Surface treatment: `default` tints on hover, `input` uses the input fill, `outline` adds a ring. @default "default" */
135
137
  variant: {
136
138
  default: "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[active=true]:bg-accent data-[active=true]:text-accent-foreground data-[active=true]:font-medium",
137
139
  input: "hover:bg-input hover:text-foreground focus:bg-input focus:text-foreground focus-visible:bg-input focus-visible:text-foreground data-[active=true]:bg-input data-[active=true]:text-foreground data-[active=true]:font-medium",
@@ -143,11 +145,14 @@ const menuItemVariants = cva(`duration-quick hover:duration-instant focus:durati
143
145
  // look. Active keeps the danger signal - destructive foreground on a
144
146
  // destructive tint one step stronger than hover (/20 vs /10) - instead
145
147
  // of falling through to the surface's neutral `bg-accent` active state.
148
+ /** `danger` marks a destructive action with red text and a red hover and active tint. @default "neutral" */
146
149
  tone: {
147
150
  neutral: "",
148
151
  danger: "text-destructive hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive data-[active=true]:bg-destructive/20 data-[active=true]:text-destructive [&_svg:not([class*='text-'])]:text-destructive data-[active=true]:font-medium",
149
152
  },
153
+ /** Corner shape: `full` is a pill, `rounded` a soft rectangle, `square` has sharp corners. @default "full" */
150
154
  radius: RADIUS_CLASSES,
155
+ /** Pads the start so a row with no leading glyph lines up with rows that have an icon, dot or avatar. Switched on automatically when `indicator` is set. @default false */
151
156
  inset: {
152
157
  true: "",
153
158
  false: "",
@@ -0,0 +1,82 @@
1
+ import type { Menu as MenuPrimitive } from "@base-ui/react/menu";
2
+ import type { LucideIcon } from "lucide-react";
3
+ import type * as React from "react";
4
+ import type { MenuContentWidth, MenuOverflow, MenuSurface } from "../tokens/menu-content.js";
5
+ import type { Radius } from "../tokens/radius.js";
6
+ import type { ComponentSize } from "../tokens/size.js";
7
+ import type { Tone } from "../tokens/tone.js";
8
+ import type { MenuItemProps } from "./menu-item/menu-item-root.js";
9
+ /** The props of the shared menu parts built by `menu-parts.ts`, one set for DropdownMenu, ContextMenu and Menubar. */
10
+ /** Positioning props accepted on every menu `*Content` and forwarded to the Base UI Positioner. */
11
+ export type MenuPositionProps = Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "anchor" | "arrowPadding" | "collisionAvoidance" | "collisionBoundary" | "collisionPadding" | "disableAnchorTracking" | "side" | "sideOffset" | "sticky">;
12
+ /** Base UI Popup props plus the positioning props, with a string `className`. */
13
+ export type MenuPopupProps = Omit<MenuPrimitive.Popup.Props, "className"> & MenuPositionProps & {
14
+ className?: string;
15
+ };
16
+ /** Props for a menu Item. */
17
+ export type MenuItemPartProps = Omit<MenuPrimitive.Item.Props, "children" | "className" | "render"> & {
18
+ className?: string;
19
+ /** Pads the start so a row with no leading glyph lines up with rows that have an icon, dot or avatar. */
20
+ inset?: boolean;
21
+ /** `danger` marks a destructive action with red text and a red highlight. @default "neutral" */
22
+ tone?: Extract<Tone, "neutral" | "danger">;
23
+ /** Custom leading element, such as an `Avatar`. Takes precedence over `dot` and `icon`. */
24
+ avatar?: React.ReactNode;
25
+ /** Dot indicator at the start (takes precedence over icon): `true` for a neutral dot, or a {@link Tone} to tint it. */
26
+ dot?: boolean | Tone;
27
+ /** Leading icon, passed as a component (such as a Lucide icon) rather than an element. Hidden when `avatar` or `dot` is set. */
28
+ icon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
29
+ /** Trailing icon, passed as a component. Replaces `kbd` when both are set. */
30
+ suffixIcon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
31
+ /** Keyboard shortcut keys shown as keycaps at the end, for example `["⌘", "C"]`. Ignored when `suffixIcon` is set. */
32
+ kbd?: string[];
33
+ /** Custom trailing content, rendered after `suffixIcon` or `kbd`. */
34
+ suffix?: React.ReactNode;
35
+ /** Whether the item is in an active/selected state */
36
+ active?: boolean;
37
+ /** Visual indicator for active state. "dot" shows grey dot normally, green when active. "check" shows green checkmark only when active. */
38
+ activeIndicator?: "dot" | "check" | "none";
39
+ /** Replace the default `<button>` row (e.g. with a link); glyph props render inside it, around `children`. */
40
+ render?: MenuItemProps["render"];
41
+ /** Text label. Use `icon` prop for icons, not children. */
42
+ children?: React.ReactElement | string | number;
43
+ };
44
+ /** Props shared by the CheckboxItem, RadioItem and SubTrigger rows over their Base UI part. */
45
+ type MenuRowProps<P> = Omit<P, "children" | "className" | "render"> & {
46
+ className?: string;
47
+ /** Replace the default `<button>` row; glyph props render inside it, around `children`. */
48
+ render?: MenuItemProps["render"];
49
+ /** Text label. Use `icon` prop for icons, not children. */
50
+ children?: React.ReactElement | string | number;
51
+ };
52
+ /** Props for a menu CheckboxItem. */
53
+ export type MenuCheckboxItemProps = MenuRowProps<MenuPrimitive.CheckboxItem.Props>;
54
+ /** Props for a menu RadioItem. */
55
+ export type MenuRadioItemProps = MenuRowProps<MenuPrimitive.RadioItem.Props>;
56
+ /** Props for a menu SubTrigger. */
57
+ export type MenuSubTriggerProps = MenuRowProps<MenuPrimitive.SubmenuTrigger.Props> & {
58
+ /** Pads the start so a row with no leading icon lines up with rows that have one. */
59
+ inset?: boolean;
60
+ /** Leading icon, passed as a component (such as a Lucide icon) rather than an element. The trailing chevron is added for you. */
61
+ icon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
62
+ };
63
+ /** Props for a menu Separator. */
64
+ export type MenuSeparatorProps = Omit<React.ComponentProps<typeof MenuPrimitive.Separator>, "className"> & {
65
+ className?: string;
66
+ /** `default` is a 1px rule with 4px margins. `compact` centres the same rule in a taller transparent band, leaving more room around it. @default "default" */
67
+ spacing?: "default" | "compact";
68
+ };
69
+ /** Props for a menu Content. */
70
+ export type MenuContentProps = MenuPopupProps & {
71
+ /** Size of every item, label and shortcut inside, which read it from context. Submenus inherit it. @default "sm" */
72
+ size?: ComponentSize;
73
+ /** Border radius for menu items. When "full", items become pill-shaped. */
74
+ itemRadius?: Radius;
75
+ /** Surface density. Compact maps to the 16px-radius, 4px-padding menu surface. */
76
+ surface?: MenuSurface;
77
+ /** Named content widths from the design system. */
78
+ contentWidth?: MenuContentWidth;
79
+ /** Outer content overflow behaviour. Use hidden when a child owns scrolling. */
80
+ overflow?: MenuOverflow;
81
+ };
82
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,7 @@
1
1
  import { Menu as MenuPrimitive } from "@base-ui/react/menu";
2
- import type { LucideIcon } from "lucide-react";
3
2
  import type * as React from "react";
4
- import type { MenuContentWidth, MenuOverflow, MenuSurface } from "../tokens/menu-content.js";
5
- import type { Radius } from "../tokens/radius.js";
6
3
  import type { ComponentSize } from "../tokens/size.js";
7
- import type { Tone } from "../tokens/tone.js";
8
- import type { MenuItemProps } from "./menu-item/menu-item-root.js";
4
+ import type { MenuCheckboxItemProps, MenuContentProps, MenuItemPartProps, MenuPopupProps, MenuPositionProps, MenuRadioItemProps, MenuSeparatorProps, MenuSubTriggerProps } from "./menu-parts-types.js";
9
5
  /**
10
6
  * Internal factory for the menu families (DropdownMenu / ContextMenu /
11
7
  * Menubar). The three compose the same Base UI Menu parts (ContextMenu's and
@@ -18,12 +14,6 @@ import type { MenuItemProps } from "./menu-item/menu-item-root.js";
18
14
  * menu part files. Unlike that module the parts read React context, so it
19
15
  * carries a `"use client"` directive.
20
16
  */
21
- /** Positioning props accepted on every menu `*Content` and forwarded to the Base UI Positioner. */
22
- type MenuPositionProps = Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "anchor" | "arrowPadding" | "collisionAvoidance" | "collisionBoundary" | "collisionPadding" | "disableAnchorTracking" | "side" | "sideOffset" | "sticky">;
23
- /** Base UI Popup props plus the positioning props, with a string `className`. */
24
- export type MenuPopupProps = Omit<MenuPrimitive.Popup.Props, "className"> & MenuPositionProps & {
25
- className?: string;
26
- };
27
17
  /** Default Positioner offsets/alignment a family applies when the caller omits them. */
28
18
  interface MenuPositionDefaults {
29
19
  align?: MenuPositionProps["align"];
@@ -37,67 +27,13 @@ interface MenuContextValue {
37
27
  }
38
28
  /** Props for a menu SubContent: the Content's popup props plus a `size` override. */
39
29
  export type MenuSubContentProps = MenuPopupProps & {
30
+ /** Item size for this submenu only. Omit to inherit the parent menu's `size`. */
40
31
  size?: ComponentSize;
41
32
  };
42
33
  /** Props for a menu Label: Base UI `GroupLabel` props with a string `className`. */
43
34
  export type MenuLabelProps = Omit<MenuPrimitive.GroupLabel.Props, "className"> & {
44
35
  className?: string;
45
36
  };
46
- /** Props for a menu Item. */
47
- export type MenuItemPartProps = Omit<MenuPrimitive.Item.Props, "children" | "className" | "render"> & {
48
- className?: string;
49
- inset?: boolean;
50
- tone?: Extract<Tone, "neutral" | "danger">;
51
- avatar?: React.ReactNode;
52
- /** Dot indicator at the start (takes precedence over icon): `true` for a neutral dot, or a {@link Tone} to tint it. */
53
- dot?: boolean | Tone;
54
- icon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
55
- suffixIcon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
56
- kbd?: string[];
57
- suffix?: React.ReactNode;
58
- /** Whether the item is in an active/selected state */
59
- active?: boolean;
60
- /** Visual indicator for active state. "dot" shows grey dot normally, green when active. "check" shows green checkmark only when active. */
61
- activeIndicator?: "dot" | "check" | "none";
62
- /** Replace the default `<button>` row (e.g. with a link); glyph props render inside it, around `children`. */
63
- render?: MenuItemProps["render"];
64
- /** Text label. Use `icon` prop for icons, not children. */
65
- children?: React.ReactElement | string | number;
66
- };
67
- /** Props shared by the CheckboxItem, RadioItem and SubTrigger rows over their Base UI part. */
68
- type MenuRowProps<P> = Omit<P, "children" | "className" | "render"> & {
69
- className?: string;
70
- /** Replace the default `<button>` row; glyph props render inside it, around `children`. */
71
- render?: MenuItemProps["render"];
72
- /** Text label. Use `icon` prop for icons, not children. */
73
- children?: React.ReactElement | string | number;
74
- };
75
- /** Props for a menu CheckboxItem. */
76
- export type MenuCheckboxItemProps = MenuRowProps<MenuPrimitive.CheckboxItem.Props>;
77
- /** Props for a menu RadioItem. */
78
- export type MenuRadioItemProps = MenuRowProps<MenuPrimitive.RadioItem.Props>;
79
- /** Props for a menu SubTrigger. */
80
- export type MenuSubTriggerProps = MenuRowProps<MenuPrimitive.SubmenuTrigger.Props> & {
81
- inset?: boolean;
82
- icon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
83
- };
84
- /** Props for a menu Separator. */
85
- export type MenuSeparatorProps = Omit<React.ComponentProps<typeof MenuPrimitive.Separator>, "className"> & {
86
- className?: string;
87
- spacing?: "default" | "compact";
88
- };
89
- /** Props for a menu Content. */
90
- export type MenuContentProps = MenuPopupProps & {
91
- size?: ComponentSize;
92
- /** Border radius for menu items. When "full", items become pill-shaped. */
93
- itemRadius?: Radius;
94
- /** Surface density. Compact maps to the 16px-radius, 4px-padding menu surface. */
95
- surface?: MenuSurface;
96
- /** Named content widths from the design system. */
97
- contentWidth?: MenuContentWidth;
98
- /** Outer content overflow behaviour. Use hidden when a child owns scrolling. */
99
- overflow?: MenuOverflow;
100
- };
101
37
  /** The Content defaults that differ between families. */
102
38
  interface MenuContentConfig {
103
39
  /** Positioner defaults applied when the caller omits them. */
@@ -129,6 +65,7 @@ export interface MenuFamilyParts {
129
65
  Group: MenuPart<React.ComponentProps<typeof MenuPrimitive.Group>>;
130
66
  Item: MenuPart<MenuItemPartProps>;
131
67
  Label: MenuPart<MenuLabelProps & {
68
+ /** Pads the start so the label lines up with items that have a leading icon. */
132
69
  inset?: boolean;
133
70
  }>;
134
71
  Portal: MenuPart<React.ComponentProps<typeof MenuPrimitive.Portal>>;
@@ -2,5 +2,5 @@
2
2
  * Menu item with a toggleable checkmark. Controlled via `checked`/`onCheckedChange`;
3
3
  * the menu stays open on select unless you set `closeOnClick`.
4
4
  */
5
- declare const MenubarCheckboxItem: (props: import("../menu-parts.js").MenuCheckboxItemProps) => React.JSX.Element;
5
+ declare const MenubarCheckboxItem: (props: import("../menu-parts-types.js").MenuCheckboxItemProps) => React.JSX.Element;
6
6
  export { MenubarCheckboxItem };
@@ -3,5 +3,5 @@
3
3
  * open/close. Provides item size and radius to descendants via context, so
4
4
  * `size`/`itemRadius` set here flow to every item, label, and shortcut inside.
5
5
  */
6
- declare const MenubarContent: (props: import("../menu-parts.js").MenuContentProps) => React.JSX.Element;
6
+ declare const MenubarContent: (props: import("../menu-parts-types.js").MenuContentProps) => React.JSX.Element;
7
7
  export { MenubarContent };
@@ -4,5 +4,5 @@
4
4
  * for a leading icon rather than nesting icon elements in `children`. Handle
5
5
  * selection with `onClick`; set `closeOnClick={false}` to keep the menu open.
6
6
  */
7
- declare const MenubarItem: (props: import("../menu-parts.js").MenuItemPartProps) => React.JSX.Element;
7
+ declare const MenubarItem: (props: import("../menu-parts-types.js").MenuItemPartProps) => React.JSX.Element;
8
8
  export { MenubarItem };
@@ -2,5 +2,5 @@
2
2
  * Single-select menu item showing a trailing checkmark when active. Must be
3
3
  * rendered inside a MenubarRadioGroup, which supplies its `value`.
4
4
  */
5
- declare const MenubarRadioItem: (props: import("../menu-parts.js").MenuRadioItemProps) => React.JSX.Element;
5
+ declare const MenubarRadioItem: (props: import("../menu-parts-types.js").MenuRadioItemProps) => React.JSX.Element;
6
6
  export { MenubarRadioItem };
@@ -1,3 +1,3 @@
1
- /** Horizontal divider between groups of menu items. `spacing="compact"` tightens the vertical gap. */
2
- declare const MenubarSeparator: (props: import("../menu-parts.js").MenuSeparatorProps) => React.JSX.Element;
1
+ /** Horizontal divider between groups of menu items. `spacing="compact"` leaves more room around the rule. */
2
+ declare const MenubarSeparator: (props: import("../menu-parts-types.js").MenuSeparatorProps) => React.JSX.Element;
3
3
  export { MenubarSeparator };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
2
  import { menubarParts } from "./menubar-parts.js";
3
- /** Horizontal divider between groups of menu items. `spacing="compact"` tightens the vertical gap. */
3
+ /** Horizontal divider between groups of menu items. `spacing="compact"` leaves more room around the rule. */
4
4
  const MenubarSeparator = menubarParts.Separator;
5
5
  export { MenubarSeparator };
@@ -3,5 +3,5 @@
3
3
  * arrow key, with a trailing chevron. Pass label text via `children` and a
4
4
  * leading icon via `icon`.
5
5
  */
6
- declare const MenubarSubTrigger: (props: import("../menu-parts.js").MenuSubTriggerProps) => React.JSX.Element;
6
+ declare const MenubarSubTrigger: (props: import("../menu-parts-types.js").MenuSubTriggerProps) => React.JSX.Element;
7
7
  export { MenubarSubTrigger };
@@ -17,6 +17,7 @@ const phoneInputVariants = cva("border-border bg-input relative flex w-full item
17
17
  },
18
18
  variants: {
19
19
  // Heights from shared CONTROL_HEIGHT_CLASSES (aligns with Button/Input).
20
+ /** Control height and text size, matching Button and Input at the same size. Also sizes the country selector. @default "xl" */
20
21
  size: withControlHeights({
21
22
  "2xs": "text-xs",
22
23
  xs: "text-xs",
@@ -27,6 +28,7 @@ const phoneInputVariants = cva("border-border bg-input relative flex w-full item
27
28
  "2xl": "text-base",
28
29
  "3xl": "text-base",
29
30
  }),
31
+ /** Corner shape: `rounded` for a soft rectangle, `full` for a capsule. @default "rounded" */
30
32
  radius: {
31
33
  rounded: "rounded-md",
32
34
  full: "rounded-full",
@@ -6,6 +6,7 @@ import { pillVariants } from "../pill/pill-variants.js";
6
6
  export interface PillProps extends React.HTMLAttributes<HTMLElement>, Omit<VariantProps<typeof pillVariants>, "size"> {
7
7
  /** Host tag rendered when `render` is not given. @default "span" */
8
8
  as?: keyof React.JSX.IntrinsicElements;
9
+ /** Dims the pill and blocks pointer events. Styling only: no `disabled` attribute reaches the element. */
9
10
  disabled?: boolean;
10
11
  /** Replace the rendered element with another element or component. */
11
12
  render?: useRender.RenderProp | undefined;
@@ -233,6 +233,7 @@ export const pillVariants = cva(cn("inline-flex items-center justify-center bord
233
233
  // `satisfies Record<Tone|Emphasis, string>` fails to compile if a canon
234
234
  // member is missing or a stray key creeps in, keeping PillTone=Tone and
235
235
  // PillEmphasis=Emphasis (declared below) honest.
236
+ /** Semantic colour: `neutral` for plain labels, `brand` for the house yellow, `success` / `warning` / `info` / `danger` for status. @default "neutral" */
236
237
  tone: {
237
238
  neutral: "bg-primary text-primary-foreground",
238
239
  brand: "bg-brand text-brand-foreground",
@@ -241,6 +242,7 @@ export const pillVariants = cva(cn("inline-flex items-center justify-center bord
241
242
  info: "bg-info-accent text-info-foreground",
242
243
  danger: "bg-destructive text-destructive-foreground",
243
244
  },
245
+ /** Visual weight: `solid` is a filled pill, `soft` a pale tint, `outline` a border, `ghost` text only, `transparent` frosted glass for use over images only. @default "solid" */
244
246
  emphasis: {
245
247
  solid: "",
246
248
  soft: "",
@@ -252,6 +254,7 @@ export const pillVariants = cva(cn("inline-flex items-center justify-center bord
252
254
  true: "pointer-events-none opacity-50",
253
255
  },
254
256
  size: PILL_SIZE_CLASSES,
257
+ /** Corner shape: `full` is a capsule, `rounded` a soft rectangle, `square` has sharp corners. Overrides the size's own corner radius. @default "full" */
255
258
  radius: {
256
259
  rounded: "rounded-md!",
257
260
  square: "rounded-none!",
@@ -57,7 +57,9 @@ type PopoverPositionerProps = Pick<PopoverPrimitive.Positioner.Props, "align" |
57
57
  */
58
58
  declare const PopoverContent: ({ className, align, sideOffset, size, side, alignOffset, anchor, arrowPadding, collisionAvoidance, collisionBoundary, collisionPadding, positionMethod, positionerClassName, sticky, ...props }: Omit<PopoverPrimitive.Popup.Props, "className"> & PopoverPositionerProps & {
59
59
  className?: string;
60
+ /** Classes for the positioning layer around the content, such as a lower `z-*` for a panel that sits beneath fixed chrome. Defaults to `z-50`. */
60
61
  positionerClassName?: string;
62
+ /** Padding and corner radius: `sm` is compact (8px), `base` is 16px, `lg` is roomy (24px). @default "lg" */
61
63
  size?: PopoverSize;
62
64
  }) => import("react").JSX.Element;
63
65
  /**
@@ -5,6 +5,7 @@ interface ProgressCircleProps {
5
5
  /** Optional content rendered centred over the ring (e.g. a percentage). */
6
6
  children?: React.ReactNode;
7
7
  className?: string;
8
+ /** Classes for the filled arc, for example a stroke colour such as `stroke-brand`. Defaults to `stroke-primary`. */
8
9
  indicatorClassName?: string;
9
10
  /** Accessible label announced by screen readers (required). */
10
11
  label: string;
@@ -14,6 +15,7 @@ interface ProgressCircleProps {
14
15
  size?: number;
15
16
  /** Ring stroke width in pixels. @default 3 */
16
17
  strokeWidth?: number;
18
+ /** Classes for the unfilled ring behind the arc, for example a stroke colour such as `stroke-border`. Defaults to `stroke-muted`. */
17
19
  trackClassName?: string;
18
20
  /** Current progress; clamped to `0..max`. */
19
21
  value: number;
@@ -30,7 +30,10 @@ export interface ScrollFrameProps {
30
30
  * @default false
31
31
  */
32
32
  dragScroll?: boolean | undefined;
33
- /** @default "color" */
33
+ /**
34
+ * How the fades are drawn: `color` blends a gradient of `fadeTheme` into a solid surface, `mask` fades the content itself to transparent, for use over images or blurs.
35
+ * @default "color"
36
+ */
34
37
  fadeMode?: ScrollFrameFadeMode | undefined;
35
38
  /**
36
39
  * Which edges fade. An edge fades only while there is more beyond it.
@@ -52,7 +55,10 @@ export interface ScrollFrameProps {
52
55
  * @default false
53
56
  */
54
57
  hideScrollbar?: boolean | undefined;
55
- /** @default "vertical" */
58
+ /**
59
+ * Scroll axis: `vertical` scrolls up and down, `horizontal` left and right, as for a row of chips.
60
+ * @default "vertical"
61
+ */
56
62
  orientation?: Orientation | undefined;
57
63
  /** Classes for the scrolling element. */
58
64
  viewportClassName?: string | undefined;
@@ -10,9 +10,15 @@ export type SegmentedControlProps<T extends string = string> = Omit<ToggleGroup.
10
10
  defaultValue?: T;
11
11
  /** Fires with the newly selected value - never with "". */
12
12
  onValueChange?: (value: T) => void;
13
- /** @default "sm" */
13
+ /**
14
+ * Size of every segment (text and padding), or an object per breakpoint like `{ base: "sm", md: "lg" }`.
15
+ * @default "sm"
16
+ */
14
17
  size?: ResponsiveValue<ComponentSize>;
15
- /** @default false */
18
+ /**
19
+ * Stretches the control to its container's width, with the segments sharing the space equally; otherwise it hugs its content.
20
+ * @default false
21
+ */
16
22
  fullWidth?: boolean;
17
23
  };
18
24
  /**
@@ -10,6 +10,7 @@ type SelectPositionerProps = Pick<SelectPrimitive.Positioner.Props, "align" | "a
10
10
  */
11
11
  declare const SelectContent: ({ className, children, align, alignItemWithTrigger, side, sideOffset, alignOffset, anchor, arrowPadding, collisionAvoidance, collisionBoundary, collisionPadding, positionMethod, sticky, size, testId, ...props }: WithTestId<Omit<SelectPrimitive.Popup.Props, "className"> & SelectPositionerProps & {
12
12
  className?: string;
13
+ /** Size of every SelectItem, label and group inside, which read it from context. Match the trigger's `size`. @default "sm" */
13
14
  size?: ComponentSize;
14
15
  }>) => import("react").JSX.Element;
15
16
  export { SelectContent };
@@ -5,10 +5,18 @@ import type { ButtonProps } from "../button.js";
5
5
  /**
6
6
  * Button that opens the listbox and displays the selected value (or the
7
7
  * SelectValue placeholder), with a trailing chevron; forwards Button styling
8
- * props - defaults to `size="lg"`, `emphasis="outline"`, `tone="neutral"`.
8
+ * props - defaults to `size="xl"`, `emphasis="outline"`, `radius="rounded"`.
9
9
  */
10
10
  declare const SelectTrigger: ({ className, children, testId, tone, size, emphasis, radius, pressed, ...props }: WithTestId<Omit<SelectPrimitive.Trigger.Props, "className" | "render"> & Pick<ButtonProps, "emphasis" | "pressed" | "radius" | "tone"> & {
11
11
  className?: string;
12
+ /** Semantic colour of the trigger, as on Button. @default "neutral" */
13
+ tone?: ButtonProps["tone"];
14
+ /** Visual weight, as on Button; the outline reads as a form field. @default "outline" */
15
+ emphasis?: ButtonProps["emphasis"];
16
+ /** Corner shape, as on Button. @default "rounded" */
17
+ radius?: ButtonProps["radius"];
18
+ /** Shrink while held down, as on Button, but off by default here. @default false */
19
+ pressed?: ButtonProps["pressed"];
12
20
  /**
13
21
  * Trigger size - a single token or a per-breakpoint object like
14
22
  * `{ base: "sm", md: "xl" }`. Forwarded to the underlying Button. @default "xl"
@@ -8,7 +8,7 @@ import { Icon } from "../icon.js";
8
8
  /**
9
9
  * Button that opens the listbox and displays the selected value (or the
10
10
  * SelectValue placeholder), with a trailing chevron; forwards Button styling
11
- * props - defaults to `size="lg"`, `emphasis="outline"`, `tone="neutral"`.
11
+ * props - defaults to `size="xl"`, `emphasis="outline"`, `radius="rounded"`.
12
12
  */
13
13
  const SelectTrigger = ({ className, children, testId, tone = "neutral", size = "xl", emphasis = "outline", radius = "rounded", pressed = false, ...props }) => (_jsxs(SelectPrimitive.Trigger, { render: _jsx(Button, { emphasis: emphasis, className: cn("bg-input data-placeholder:text-muted-foreground text-paragraph-sm justify-between rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2", className), pressed: pressed, radius: radius, size: size, tone: tone }), "data-component": "select-trigger", "data-slot": "select-trigger", "data-testid": testId, ...props, children: [children, _jsx(SelectPrimitive.Icon, { className: "flex", children: _jsx(Icon, { className: "opacity-50", icon: ChevronDown, size: "xs" }) })] }));
14
14
  export { SelectTrigger };
@@ -11,6 +11,10 @@ import type { ComponentProps } from "react";
11
11
  */
12
12
  type SidepanelHeaderVariant = "bar" | "default";
13
13
  type SidepanelHeaderProps = ComponentProps<"div"> & {
14
+ /**
15
+ * `default` is a stacked title and description with a bottom border. `bar` is a transparent toolbar pinned over the top of the panel, for two `SidepanelControls` groups.
16
+ * @default "default"
17
+ */
14
18
  variant?: SidepanelHeaderVariant;
15
19
  };
16
20
  /**
@@ -5,6 +5,7 @@ export interface SubNavigationLinkProps extends Omit<React.ComponentProps<"a">,
5
5
  active?: boolean;
6
6
  /** Link label, matching what `MenuItem` renders. */
7
7
  children?: React.ReactElement | string | number | undefined;
8
+ /** Destination of the default `<a>`. Not used when `render` supplies its own element. */
8
9
  href?: string;
9
10
  /** Leading icon shown before the label. */
10
11
  icon?: LucideIcon;
@@ -38,6 +38,8 @@ type SwatchProps = ChipSwatchProps | TileSwatchProps;
38
38
  * @bestPractice Feed fills through `color`/`background`/`colors`, never a hex in `className`/`style` - the props drive the contrast-aware text colour, selection ring, and darkening overlay.
39
39
  * @bestPractice Reach for `Swatch` for a selectable colour/gradient/material chip or tile; a tiny non-interactive status marker is `Dot`, and a display-only status/category label is `Badge`.
40
40
  * @bestPractice For a gradient or image chip fill pass `light` - auto contrast detection (`isLightColor`) only reads solid colours, so overlaid icons/labels lose legibility without it.
41
+ * @bestPractice A material swatch is always square, as Swatch draws it; never stretch a tile into a landscape crop, and in a grid let the column set the size.
42
+ * @keywords material swatch, material sample, finish, colourway, colour chip
41
43
  * @category color
42
44
  */
43
45
  declare const Swatch: (props: SwatchProps) => import("react").JSX.Element;
@@ -29,6 +29,8 @@ import { SwatchTile } from "./swatch-tile.js";
29
29
  * @bestPractice Feed fills through `color`/`background`/`colors`, never a hex in `className`/`style` - the props drive the contrast-aware text colour, selection ring, and darkening overlay.
30
30
  * @bestPractice Reach for `Swatch` for a selectable colour/gradient/material chip or tile; a tiny non-interactive status marker is `Dot`, and a display-only status/category label is `Badge`.
31
31
  * @bestPractice For a gradient or image chip fill pass `light` - auto contrast detection (`isLightColor`) only reads solid colours, so overlaid icons/labels lose legibility without it.
32
+ * @bestPractice A material swatch is always square, as Swatch draws it; never stretch a tile into a landscape crop, and in a grid let the column set the size.
33
+ * @keywords material swatch, material sample, finish, colourway, colour chip
32
34
  * @category color
33
35
  */
34
36
  const Swatch = (props) => {
@@ -14,7 +14,8 @@ import type { TileSwatchProps } from "./swatch-tile-types.js";
14
14
  * </div>
15
15
  * ```
16
16
  */
17
- declare const SwatchFrameRing: ({ radius }: {
17
+ declare const SwatchFrameRing: ({ radius, }: {
18
+ /** Tailwind rounding class (such as `rounded-xl`) matching the framed container's corners, so the ring follows them. */
18
19
  radius: string;
19
20
  }) => import("react").JSX.Element;
20
21
  /**
@@ -18,7 +18,7 @@ import { buildTileClasses, buildTileStyle, getInnerRingRadius, resolveTileState,
18
18
  * </div>
19
19
  * ```
20
20
  */
21
- const SwatchFrameRing = ({ radius }) => (_jsx("span", { "aria-hidden": "true", className: cn("pointer-events-none absolute inset-0 ring-1 ring-black/5 ring-inset", radius) }));
21
+ const SwatchFrameRing = ({ radius, }) => (_jsx("span", { "aria-hidden": "true", className: cn("pointer-events-none absolute inset-0 ring-1 ring-black/5 ring-inset", radius) }));
22
22
  /**
23
23
  * Card/bare renderer: the tiered radius/border/ring/shadow tile.
24
24
  */
@@ -8,6 +8,7 @@ export interface TabNavigationLinkProps extends Omit<useRender.ComponentProps<"a
8
8
  * @default false
9
9
  */
10
10
  active?: boolean;
11
+ /** Destination of the link. Also forwarded to the element given in `render`, such as a router `Link`. */
11
12
  href: string;
12
13
  /** Optional icon rendered alongside the label. */
13
14
  icon?: IconComponent;
@@ -8,5 +8,9 @@
8
8
  export declare const TabsPanel: ({ children, className, layout, }: {
9
9
  children: React.ReactNode;
10
10
  className?: string;
11
+ /**
12
+ * Motion `layout` value for the height animation when the active tab's content changes size: `false` switches it off, `"size"` or `"position"` animates only that, `"preserve-aspect"` keeps the aspect ratio.
13
+ * @default true
14
+ */
11
15
  layout?: boolean | "position" | "size" | "preserve-aspect";
12
16
  }) => import("react").JSX.Element;