@instruments/materia-ui 0.4.6 → 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 (119) hide show
  1. package/dist/components/accordion/accordion-variants.js +1 -0
  2. package/dist/components/alert/alert-root.js +1 -0
  3. package/dist/components/anchor/anchor-root.js +1 -0
  4. package/dist/components/avatar/avatar-badge.d.ts +1 -1
  5. package/dist/components/avatar/avatar-fallback.d.ts +1 -1
  6. package/dist/components/avatar/avatar-root.d.ts +1 -1
  7. package/dist/components/avatar/avatar-status.d.ts +2 -1
  8. package/dist/components/badge/badge-button.d.ts +1 -0
  9. package/dist/components/badge/badge-button.js +1 -0
  10. package/dist/components/badge/badge-root.d.ts +4 -1
  11. package/dist/components/breadcrumb/breadcrumb-root.d.ts +1 -0
  12. package/dist/components/button/button-variants.js +7 -0
  13. package/dist/components/button-group/button-group-root.js +4 -0
  14. package/dist/components/card/card-root.d.ts +1 -0
  15. package/dist/components/card/card-root.js +1 -0
  16. package/dist/components/checkbox-card/checkbox-card-root.d.ts +1 -1
  17. package/dist/components/checkbox-field/checkbox-field-root.d.ts +4 -1
  18. package/dist/components/context-menu/context-menu-checkbox-item.d.ts +1 -1
  19. package/dist/components/context-menu/context-menu-content.d.ts +1 -1
  20. package/dist/components/context-menu/context-menu-item.d.ts +1 -1
  21. package/dist/components/context-menu/context-menu-radio-item.d.ts +1 -1
  22. package/dist/components/context-menu/context-menu-separator.d.ts +2 -2
  23. package/dist/components/context-menu/context-menu-separator.js +1 -1
  24. package/dist/components/context-menu/context-menu-sub-trigger.d.ts +1 -1
  25. package/dist/components/dot/dot-root.js +1 -0
  26. package/dist/components/drawer/drawer-root.d.ts +1 -0
  27. package/dist/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +1 -1
  28. package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +1 -1
  29. package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +1 -1
  30. package/dist/components/dropdown-menu/dropdown-menu-radio-item.d.ts +1 -1
  31. package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -2
  32. package/dist/components/dropdown-menu/dropdown-menu-separator.js +1 -1
  33. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
  34. package/dist/components/empty/empty-root.js +1 -0
  35. package/dist/components/expand-button/expand-button-root.js +1 -0
  36. package/dist/components/field/field-error.d.ts +1 -0
  37. package/dist/components/field/field-variants.js +1 -0
  38. package/dist/components/icon-box/icon-box-root.js +4 -0
  39. package/dist/components/identified-surface.d.ts +5 -0
  40. package/dist/components/input/input-variants.js +1 -0
  41. package/dist/components/input-card/input-card-root.d.ts +3 -0
  42. package/dist/components/input-group/input-group-button.d.ts +7 -3
  43. package/dist/components/item/item-group.js +1 -0
  44. package/dist/components/item/item-media.d.ts +8 -0
  45. package/dist/components/item/item-media.js +1 -0
  46. package/dist/components/item/item-root.d.ts +1 -0
  47. package/dist/components/item/item-root.js +1 -0
  48. package/dist/components/kbd/kbd-root.js +2 -0
  49. package/dist/components/menu-item/menu-item-variants.js +5 -0
  50. package/dist/components/menu-parts-types.d.ts +82 -0
  51. package/dist/components/menu-parts-types.js +1 -0
  52. package/dist/components/menu-parts.d.ts +3 -66
  53. package/dist/components/menubar/menubar-checkbox-item.d.ts +1 -1
  54. package/dist/components/menubar/menubar-content.d.ts +1 -1
  55. package/dist/components/menubar/menubar-item.d.ts +1 -1
  56. package/dist/components/menubar/menubar-radio-item.d.ts +1 -1
  57. package/dist/components/menubar/menubar-separator.d.ts +2 -2
  58. package/dist/components/menubar/menubar-separator.js +1 -1
  59. package/dist/components/menubar/menubar-sub-trigger.d.ts +1 -1
  60. package/dist/components/phone-input/phone-input-root.js +2 -0
  61. package/dist/components/pill/pill-root.d.ts +1 -0
  62. package/dist/components/pill/pill-variants.js +3 -0
  63. package/dist/components/popover/popover-root.d.ts +2 -0
  64. package/dist/components/progress/progress-root.d.ts +2 -0
  65. package/dist/components/scroll-frame/scroll-frame-root.d.ts +8 -2
  66. package/dist/components/segmented-control/segmented-control-root.d.ts +8 -2
  67. package/dist/components/select/select-content.d.ts +1 -0
  68. package/dist/components/select/select-trigger.d.ts +9 -1
  69. package/dist/components/select/select-trigger.js +1 -1
  70. package/dist/components/sidepanel/sidepanel-header.d.ts +4 -0
  71. package/dist/components/sub-navigation/sub-navigation-link.d.ts +1 -0
  72. package/dist/components/swatch/swatch-tile.d.ts +2 -1
  73. package/dist/components/swatch/swatch-tile.js +1 -1
  74. package/dist/components/tab-navigation/tab-navigation-link.d.ts +1 -0
  75. package/dist/components/tabs/tabs-panel.d.ts +4 -0
  76. package/dist/components/tabs/tabs-variants.js +4 -0
  77. package/dist/components/thinking-loader/thinking-loader-counter.d.ts +2 -0
  78. package/dist/components/thinking-loader/thinking-loader-icon.d.ts +2 -0
  79. package/dist/components/thinking-loader/thinking-loader-step.d.ts +2 -0
  80. package/dist/components/toggle/toggle-root.js +2 -0
  81. package/dist/components/voice/voice-error-popover.d.ts +2 -0
  82. package/dist/components/voice/voice-pill.d.ts +2 -0
  83. package/dist/compositions/attribute-card.d.ts +1 -0
  84. package/dist/compositions/card-grid/card-grid-rows.d.ts +13 -0
  85. package/dist/compositions/data-grid/data-grid-checkbox.d.ts +8 -0
  86. package/dist/compositions/data-grid/data-grid-expand.d.ts +1 -0
  87. package/dist/compositions/data-grid/data-grid-filterable-header.d.ts +1 -0
  88. package/dist/compositions/data-grid/data-grid-types.d.ts +6 -0
  89. package/dist/compositions/data-grid-column-header/data-grid-column-header-root.d.ts +5 -0
  90. package/dist/compositions/data-grid-table/data-grid-table-body.d.ts +13 -1
  91. package/dist/compositions/data-grid-table/data-grid-table-body.js +1 -1
  92. package/dist/compositions/data-grid-table/data-grid-table-header.d.ts +5 -0
  93. package/dist/compositions/document-list/document-list-icon.d.ts +1 -0
  94. package/dist/compositions/document-list/document-list-root.js +4 -0
  95. package/dist/compositions/editorial-card/editorial-card-content.d.ts +2 -0
  96. package/dist/compositions/file-upload/file-upload-dropzone.d.ts +3 -0
  97. package/dist/compositions/folder-tile/folder-tile-types.d.ts +2 -0
  98. package/dist/compositions/mobile-navigation/mobile-navigation-header.d.ts +5 -2
  99. package/dist/compositions/mobile-navigation/mobile-navigation-header.js +0 -1
  100. package/dist/compositions/mobile-navigation/mobile-navigation-item.d.ts +2 -0
  101. package/dist/compositions/mobile-navigation/mobile-navigation-profile.d.ts +1 -0
  102. package/dist/compositions/mobile-navigation/mobile-navigation-root.d.ts +1 -0
  103. package/dist/compositions/page-toolbar/page-toolbar-applied.d.ts +4 -1
  104. package/dist/compositions/page-toolbar/page-toolbar-sort.d.ts +3 -0
  105. package/dist/compositions/product-card/product-card-content.d.ts +1 -0
  106. package/dist/compositions/product-card/product-card-image-types.d.ts +8 -2
  107. package/dist/compositions/product-card/product-card-provider-types.d.ts +47 -2
  108. package/dist/compositions/product-card/product-card-root.d.ts +1 -0
  109. package/dist/compositions/product-card/product-card-swatch.d.ts +2 -0
  110. package/dist/compositions/product-card/product-card-tools-types.d.ts +6 -0
  111. package/dist/compositions/product-specifications-selector/product-specifications-selector.d.ts +14 -0
  112. package/dist/compositions/sidebar/sidebar-group.d.ts +4 -0
  113. package/dist/compositions/sidebar/sidebar-menu-button.d.ts +11 -0
  114. package/dist/compositions/sidebar/sidebar-menu-sub.d.ts +4 -0
  115. package/dist/compositions/sidebar/sidebar-trigger.d.ts +2 -0
  116. package/dist/compositions/variant-selector/variant-selector-item.d.ts +1 -0
  117. package/dist/data/docs-manifest.js +551 -26
  118. package/dist/utils/with-test-id.d.ts +1 -0
  119. package/package.json +1 -1
@@ -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;
@@ -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;
@@ -30,10 +30,12 @@ export const tabsListVariants = cva("inline-flex h-auto w-fit items-center justi
30
30
  variant: "pill",
31
31
  },
32
32
  variants: {
33
+ /** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the style for every part, so set `variant` there. */
33
34
  variant: {
34
35
  pill: SEGMENTED_SHELL_BASE,
35
36
  line: "gap-6",
36
37
  },
38
+ /** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the size for every part, so set `size` there. */
37
39
  size: {
38
40
  "2xs": "",
39
41
  xs: "",
@@ -86,7 +88,9 @@ export const tabsTriggerVariants = cva(`transition-color-shadow-border inline-fl
86
88
  variant: "pill",
87
89
  },
88
90
  variants: {
91
+ /** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the size for every part, so set `size` there. */
89
92
  size: { ...SEGMENTED_TRIGGER_TEXT },
93
+ /** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the style for every part, so set `variant` there. */
90
94
  variant: {
91
95
  line: cn("text-muted-foreground hover:text-foreground data-active:text-foreground dark:text-gray-500 dark:hover:text-gray-300 dark:data-active:text-gray-100", focusRing()),
92
96
  pill: "text-muted-foreground data-active:text-foreground rounded-full dark:text-gray-500 dark:data-active:text-gray-100",
@@ -1,6 +1,8 @@
1
1
  interface ThinkingLoaderCounterProps {
2
2
  className?: string;
3
+ /** Number shown before the slash, counted from one (the first step is `1`). */
3
4
  current: number;
5
+ /** Number shown after the slash. */
4
6
  total: number;
5
7
  }
6
8
  /**
@@ -1,6 +1,8 @@
1
1
  import type { LucideIcon } from "lucide-react";
2
2
  interface ThinkingLoaderIconProps {
3
+ /** Icon to show. Renders nothing when `undefined`. */
3
4
  icon: LucideIcon | undefined;
5
+ /** Id of the current step. A new id makes the previous icon crossfade into this one. */
4
6
  stepId: string;
5
7
  }
6
8
  /**
@@ -18,9 +18,11 @@ interface ThinkingLoaderStepProps {
18
18
  hideIcon?: boolean;
19
19
  /** Inherit font size from a containing `ThinkingLoader`. */
20
20
  inheritSize?: boolean;
21
+ /** Sweeps a highlight across the label; `false` renders it as plain text. @default true */
21
22
  shimmer?: boolean;
22
23
  /** Shimmer highlight direction. Defaults to `"dark"`. */
23
24
  shimmerVariant?: ShimmerVariant;
25
+ /** The step to show: its `label` is the text, and its `icon` leads it unless `hideIcon` is set. */
24
26
  step: ThinkingStep;
25
27
  }
26
28
  /**
@@ -45,6 +45,7 @@ const toggleVariants = cva(cn(focusRing(), "border-border text-foreground bg-bac
45
45
  variant: "default",
46
46
  },
47
47
  variants: {
48
+ /** How a pressed toggle shows it is on: `default` greys the fill and border, `secondary` darkens the border only. Inside a `ToggleGroup` the group's value wins. @default "default" */
48
49
  variant: {
49
50
  default: "data-pressed:border-muted-foreground data-pressed:bg-muted",
50
51
  secondary: "data-pressed:border-foreground data-pressed:bg-background",
@@ -53,6 +54,7 @@ const toggleVariants = cva(cn(focusRing(), "border-border text-foreground bg-bac
53
54
  // Old `shape` values map onto the shared Radius vocabulary by their actual
54
55
  // class: old `square` was `rounded-lg` → "rounded"; old `round` was
55
56
  // `rounded-full` → "full". Appearance is preserved exactly.
57
+ /** Corner shape: `rounded` for soft corners, `full` for a pill. There is no sharp option. Inside a `ToggleGroup` the group's value wins. @default "rounded" */
56
58
  radius: {
57
59
  rounded: "rounded-lg",
58
60
  full: "rounded-full",
@@ -6,7 +6,9 @@ export interface VoiceErrorPopoverProps {
6
6
  message: string;
7
7
  /** When set, renders an action button (e.g. `"Retry"`) that calls `onAction`. */
8
8
  actionLabel?: string;
9
+ /** Called when the action button is clicked. The button only appears when `actionLabel` is set. */
9
10
  onAction?: () => void;
11
+ /** Called when the dismiss button is clicked. The parent should then set `open` to `false`. */
10
12
  onDismiss?: () => void;
11
13
  /** Accessible label for the dismiss button. @default "Dismiss" */
12
14
  dismissLabel?: string;
@@ -6,7 +6,9 @@ export interface VoicePillProps {
6
6
  level?: number;
7
7
  /** Elapsed capture time in ms, shown as an `mm:ss` timer while recording. @default 0 */
8
8
  elapsedMs?: number;
9
+ /** Called when the pill is pressed. The parent decides what the press does in each `state`, such as starting or stopping capture. */
9
10
  onClick?: () => void;
11
+ /** Block presses and dim the pill. @default false */
10
12
  disabled?: boolean;
11
13
  /** Accessible label. The parent chooses copy per state - never hardcoded here. */
12
14
  label: string;
@@ -5,6 +5,7 @@ interface AttributeCardProps {
5
5
  attributeLabel: string;
6
6
  /** CSS class name */
7
7
  className?: string;
8
+ /** Icon component (e.g. a Lucide icon), not a rendered element; shown small and muted at the top right. */
8
9
  icon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
9
10
  /** Current value */
10
11
  valueLabel: string;
@@ -5,20 +5,33 @@ export interface CardGridRowMetrics {
5
5
  rowWidth: number;
6
6
  }
7
7
  export interface CardGridRowsProps<T> extends Omit<ComponentProps<"div">, "children"> {
8
+ /** Stable unique key for an item, such as its id; never the array index. */
8
9
  getItemKey: (item: T) => string;
10
+ /** Stable key for a row. Defaults to `row-<rowIndex>`; supply one when rows can reorder or be re-chunked. */
9
11
  getRowKey?: (row: T[], rowIndex: number) => string;
12
+ /**
13
+ * Pixel `cardWidth` and `gap` the rows were chunked with (e.g. from
14
+ * `calculateColumns`). They only size `renderAfterRow`'s `rowWidth`; they do
15
+ * not lay the cards out.
16
+ */
10
17
  metrics: Omit<CardGridRowMetrics, "rowWidth">;
18
+ /**
19
+ * Content rendered beneath a row, such as an expanded detail panel. Receives
20
+ * `metrics` with `rowWidth`, the row's pixel width, so the panel can align to it.
21
+ */
11
22
  renderAfterRow?: (props: {
12
23
  metrics: CardGridRowMetrics;
13
24
  row: T[];
14
25
  rowIndex: number;
15
26
  }) => ReactNode;
27
+ /** Renders one item's card; each result is wrapped in a `CardGridItem`. `index` is the position within its row. */
16
28
  renderItem: (props: {
17
29
  index: number;
18
30
  item: T;
19
31
  row: T[];
20
32
  rowIndex: number;
21
33
  }) => ReactNode;
34
+ /** Items already chunked into rows, e.g. with `chunkIntoRows`; one `CardGrid` is rendered per row. */
22
35
  rows: T[][];
23
36
  }
24
37
  /**