@instruments/materia-ui 0.4.7 → 0.4.9
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.
- package/agent-docs.md +4 -2
- package/dist/components/code/code-root.d.ts +1 -1
- package/dist/components/code/code-root.js +4 -1
- package/dist/components/combobox/combobox-root.js +3 -3
- package/dist/components/command/command-list.d.ts +1 -1
- package/dist/components/command/command-list.js +3 -2
- package/dist/components/country-combobox/country-combobox-root.d.ts +1 -1
- package/dist/components/input-group/input-group-button.d.ts +2 -2
- package/dist/components/location-input/location-input-root.js +9 -4
- package/dist/components/scroll-frame/scroll-frame-root.d.ts +18 -5
- package/dist/components/scroll-frame/scroll-frame-root.js +49 -17
- package/dist/components/scroll-frame.d.ts +1 -1
- package/dist/components/select/select-trigger.d.ts +1 -1
- package/dist/components/sidepanel/sidepanel-body.d.ts +4 -3
- package/dist/components/sidepanel/sidepanel-body.js +6 -4
- package/dist/components/swatch-group/swatch-group-item.d.ts +1 -1
- package/dist/components/swatch-selector/swatch-selector-item.d.ts +1 -1
- package/dist/components/table/table-root.d.ts +1 -1
- package/dist/components/table/table-root.js +3 -2
- package/dist/compositions/data-grid-column-filter/data-grid-column-filter-root.js +2 -1
- package/dist/compositions/data-grid-table/data-grid-table-root.js +2 -1
- package/dist/compositions/mega-menu/mega-menu-content.js +3 -2
- package/dist/compositions/mobile-navigation/mobile-navigation-header.d.ts +1 -1
- package/dist/compositions/quick-view/quick-view-body.d.ts +1 -1
- package/dist/compositions/sidebar/sidebar-content.d.ts +1 -1
- package/dist/compositions/sidebar/sidebar-content.js +3 -2
- package/dist/compositions/sidebar/sidebar-group.d.ts +1 -1
- package/dist/compositions/sidebar/sidebar-menu-sub.d.ts +2 -2
- package/dist/compositions/sidebar/sidebar-menu-sub.js +2 -1
- package/dist/compositions/sidebar/sidebar-trigger.d.ts +1 -1
- package/dist/compositions/tag-selector/tag-selector-list.js +4 -3
- package/dist/data/docs-manifest.js +270 -221
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { Dot } from "@instruments/materia-ui/components/dot";
|
|
|
5
5
|
import { Flex } from "@instruments/materia-ui/components/flex";
|
|
6
6
|
import { Icon } from "@instruments/materia-ui/components/icon";
|
|
7
7
|
import { MenuItem } from "@instruments/materia-ui/components/menu-item";
|
|
8
|
+
import { ScrollFrame } from "@instruments/materia-ui/components/scroll-frame";
|
|
8
9
|
import { cn } from "@instruments/materia-ui/utils/cn";
|
|
9
10
|
import { isString } from "../../utils/type-guards.js";
|
|
10
11
|
/** The `<ul>` container for a nested submenu under a menu item; hidden when the sidebar collapses to an icon rail. */
|
|
@@ -13,7 +14,7 @@ export const SidebarMenuSub = ({ className, ...props }) => (_jsx(Flex, { as: "ul
|
|
|
13
14
|
* Scroll viewport for sidebar submenu content inside floating surfaces.
|
|
14
15
|
* Keeps menu list scrolling, scrollbar styling, and bottom fade treatment centralised.
|
|
15
16
|
*/
|
|
16
|
-
export const SidebarMenuSubScrollArea = ({ children, className, fade = false, maxHeight = "none", ...props }) => (
|
|
17
|
+
export const SidebarMenuSubScrollArea = ({ children, className, fade = false, maxHeight = "none", ...props }) => (_jsx(ScrollFrame, { ...props, className: cn("min-h-0", maxHeight === "dropdown" && "max-h-menu-sidebar-list", className), "data-component": "sidebar-menu-sub-scroll-area", "data-slot": "sidebar-menu-sub-scroll-area", fadeSize: "3xl", fadeTheme: "popover", fades: fade ? "end" : "none", children: children }));
|
|
17
18
|
/** The `<li>` wrapper for a single submenu row. */
|
|
18
19
|
export const SidebarMenuSubItem = ({ className, ...props }) => (_jsx("li", { className: cn("group/menu-sub-item relative", className), "data-component": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", "data-slot": "sidebar-menu-sub-item", ...props }));
|
|
19
20
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from "@instruments/materia-ui/components/button";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import type { IconComponent } from "../../tokens/icon-component.js";
|
|
4
|
-
type SidebarTriggerProps = Omit<React.ComponentProps<typeof Button>, "icon"> & {
|
|
4
|
+
type SidebarTriggerProps = Omit<React.ComponentProps<typeof Button>, "emphasis" | "icon"> & {
|
|
5
5
|
/** Icon to display. Defaults to PanelLeftCloseIcon. */
|
|
6
6
|
icon?: IconComponent;
|
|
7
7
|
/** Visual weight, as on Button. @default "ghost" */
|
|
@@ -7,6 +7,7 @@ import { Plus } from "lucide-react";
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { Button } from "../../components/button.js";
|
|
9
9
|
import { Flex } from "../../components/flex.js";
|
|
10
|
+
import { ScrollFrame } from "../../components/scroll-frame.js";
|
|
10
11
|
import { TagSelectorColorSwatches } from "../tag-selector/tag-selector-color-swatches.js";
|
|
11
12
|
import { useTagSelectorContext } from "../tag-selector/tag-selector-context.js";
|
|
12
13
|
import { TagSelectorItem } from "../tag-selector/tag-selector-item.js";
|
|
@@ -94,7 +95,7 @@ export const TagSelectorList = ({ emptyMessage = "No tags found.", className, })
|
|
|
94
95
|
const exactMatch = tags.some((tag) => tag.label.toLowerCase() === searchQuery.toLowerCase());
|
|
95
96
|
const showCreateOption = allowCreate && searchQuery !== "" && !exactMatch;
|
|
96
97
|
const selectedIds = new Set(value.map((t) => t.id));
|
|
97
|
-
return (_jsx(
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
return (_jsx(ScrollFrame, { className: cn("max-h-75", className), fadeTheme: "popover", fades: "end", children: _jsx(Flex, { className: "p-1", "data-component": "tag-selector-list", "data-slot": "tag-selector-list", direction: "column", id: listboxId,
|
|
99
|
+
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role, react-doctor/prefer-tag-over-role -- this is a custom listbox widget whose children are interactive TagSelectorItem rows, a drag-to-reorder DndContext, and a "Create" affordance with a colour palette; <datalist>/<select> can only hold plain <option>s, so they cannot represent this content.
|
|
100
|
+
role: "listbox", children: filteredTags.length === 0 && !showCreateOption ? (_jsx("div", { className: "text-muted-foreground text-paragraph-sm py-6 text-center", children: emptyMessage })) : (_jsxs(_Fragment, { children: [showCreateOption && _jsx(TagSelectorCreateOption, {}), _jsx(TagSelectorItems, { filteredTags: filteredTags, selectedIds: selectedIds })] })) }) }));
|
|
100
101
|
};
|