ionbase-ui 0.81.1 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Menu.d.ts +87 -24
- package/dist/components/Menu.d.ts.map +1 -1
- package/dist/components/Menu.js +245 -28
- package/dist/components/Menu.js.map +1 -1
- package/dist/components/PageHeader.d.ts +59 -0
- package/dist/components/PageHeader.d.ts.map +1 -0
- package/dist/components/PageHeader.js +29 -0
- package/dist/components/PageHeader.js.map +1 -0
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/figma-descriptions.json +86 -76
- package/dist/figma-map.json +142 -38
- package/dist/meta/Menu.json +201 -27
- package/dist/meta/MenuItem.json +137 -17
- package/dist/meta/MenuSection.json +90 -0
- package/dist/meta/MenuTrigger.json +177 -0
- package/dist/meta/PageHeader.json +169 -0
- package/dist/meta/components.json +817 -87
- package/dist/meta/contrast.json +240 -32
- package/dist/meta/index.json +31 -3
- package/dist/meta/patterns/PageShell.json +18 -5
- package/dist/meta/patterns/index.json +2 -1
- package/dist/styles/index.css +1 -0
- package/dist/styles/menu.css +153 -32
- package/dist/styles/page-header.css +94 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
|
@@ -1,35 +1,98 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { type AriaMenuProps } from 'react-aria';
|
|
3
|
+
import { Section } from '@react-stately/collections';
|
|
4
|
+
import type { ItemProps } from '@react-types/shared';
|
|
5
|
+
export interface MenuProps<T extends object> extends AriaMenuProps<T> {
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
4
8
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* hard half to unpick later.
|
|
13
|
-
*
|
|
14
|
-
* `role="menu"` is deliberately NOT set. A real ARIA menu owes the user
|
|
15
|
-
* roving-tabindex arrow navigation, typeahead and focus containment; claiming
|
|
16
|
-
* the role without them is worse for a screen-reader user than an honest list,
|
|
17
|
-
* because it promises interactions that are not there. When the popover exists,
|
|
18
|
-
* the role comes with it.
|
|
19
|
-
*/
|
|
20
|
-
export declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
21
|
-
export interface MenuItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
22
|
-
/** Figma's `Selected` / `Selected-hover` states. Shows the trailing check. */
|
|
23
|
-
isSelected?: boolean;
|
|
9
|
+
export interface MenuItemProps<T extends object = object> extends ItemProps<T> {
|
|
10
|
+
/**
|
|
11
|
+
* Only on a row that opens a submenu: the row's label. Its children are then
|
|
12
|
+
* the submenu's MenuItems rather than its label. Submenus open only inside a
|
|
13
|
+
* MenuTrigger — a standalone Menu has nothing to open them from.
|
|
14
|
+
*/
|
|
15
|
+
title?: React.ReactNode;
|
|
24
16
|
/** Figma's `Show Leading Icon` + `Leading Icon` swap. */
|
|
25
17
|
icon?: React.ReactNode;
|
|
26
|
-
/** Whether the item is disabled. */
|
|
18
|
+
/** Whether the item is disabled. Listed, skipped by the arrow keys. */
|
|
27
19
|
isDisabled?: boolean;
|
|
28
20
|
/**
|
|
29
21
|
* @deprecated Use `isDisabled`. Accepted as an alias for one minor version.
|
|
30
22
|
*/
|
|
31
23
|
disabled?: boolean;
|
|
32
|
-
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Put the item's key in Menu's `selectedKeys`. Accepted for one
|
|
26
|
+
* minor version: when no item's key is in `selectedKeys` and Menu is given
|
|
27
|
+
* neither `selectedKeys` nor `defaultSelectedKeys`, the items passing this
|
|
28
|
+
* become the selection.
|
|
29
|
+
*/
|
|
30
|
+
isSelected?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* One row of a Menu. A collection element, like TabItem: it renders nothing
|
|
34
|
+
* itself — Menu reads its props and draws the row — so it only means anything
|
|
35
|
+
* as a direct child of Menu or MenuSection. Give it a `key`; that key is what
|
|
36
|
+
* `onAction` and `selectedKeys` speak in.
|
|
37
|
+
*/
|
|
38
|
+
export declare function MenuItem<T extends object>(_props: MenuItemProps<T>): React.ReactElement | null;
|
|
39
|
+
export declare namespace MenuItem {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A named group of MenuItems. `title` is Figma's `Menu Section Title`; without
|
|
44
|
+
* one, pass `aria-label` and the group is set off by a rule instead.
|
|
45
|
+
*/
|
|
46
|
+
export { Section as MenuSection };
|
|
47
|
+
/**
|
|
48
|
+
* Menu — Figma `Menu` (82:306), `Menu Item` and `Menu Section Title`.
|
|
49
|
+
*
|
|
50
|
+
* A real ARIA menu: `role="menu"`, one tab stop, arrow keys, Home and End,
|
|
51
|
+
* typeahead, and disabled rows listed but skipped. Figma's `Type` is
|
|
52
|
+
* `selectionMode` — Single draws one check, Multi draws several — and with
|
|
53
|
+
* a selection mode the rows become `menuitemradio` / `menuitemcheckbox` and
|
|
54
|
+
* announce their checked state.
|
|
55
|
+
*
|
|
56
|
+
* On its own it is the surface only, rendered in flow. Inside a MenuTrigger it
|
|
57
|
+
* floats, opens and closes, is named by its trigger, and can open submenus.
|
|
58
|
+
*/
|
|
59
|
+
export declare const Menu: <T extends object>(props: MenuProps<T> & {
|
|
60
|
+
ref?: React.Ref<HTMLUListElement>;
|
|
61
|
+
}) => React.ReactElement;
|
|
62
|
+
export type MenuTriggerPlacement = 'bottom start' | 'bottom end' | 'top start' | 'top end';
|
|
63
|
+
export interface MenuTriggerProps {
|
|
64
|
+
/**
|
|
65
|
+
* Exactly two children: the Button that opens the menu, then the Menu. The
|
|
66
|
+
* Button must accept a ref and react-aria press props — IonBase's Button
|
|
67
|
+
* does; a plain `<button>` does not.
|
|
68
|
+
*/
|
|
69
|
+
children: [React.ReactElement, React.ReactElement];
|
|
70
|
+
/**
|
|
71
|
+
* Where the menu opens, relative to the trigger. A preference, not a
|
|
72
|
+
* guarantee: it flips when there is no room.
|
|
73
|
+
*/
|
|
74
|
+
placement?: MenuTriggerPlacement;
|
|
75
|
+
/** Whether the trigger is disabled. */
|
|
76
|
+
isDisabled?: boolean;
|
|
77
|
+
isOpen?: boolean;
|
|
78
|
+
defaultOpen?: boolean;
|
|
79
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* MenuTrigger — a Button that opens a Menu.
|
|
83
|
+
*
|
|
84
|
+
* The "⋯" overflow menu is this with an icon-only Button; there is no separate
|
|
85
|
+
* component for it, because the only difference is the Button's content and
|
|
86
|
+
* its required aria-label.
|
|
87
|
+
*
|
|
88
|
+
* `useMenuTrigger` does what a Popover wrapped round a Menu could not: the
|
|
89
|
+
* trigger announces `aria-haspopup="menu"` and `aria-expanded`, the menu is
|
|
90
|
+
* named by the trigger, ArrowDown and ArrowUp open it with focus on the first
|
|
91
|
+
* or last row, and choosing an action closes it and returns focus to the
|
|
92
|
+
* trigger.
|
|
93
|
+
*/
|
|
94
|
+
export declare function MenuTrigger({ children, placement, isDisabled, ...stateProps }: MenuTriggerProps): React.JSX.Element;
|
|
95
|
+
export declare namespace MenuTrigger {
|
|
96
|
+
var displayName: string;
|
|
33
97
|
}
|
|
34
|
-
export declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
98
|
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../src/components/Menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../src/components/Menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,EAYL,KAAK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,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAA0B,EAC1B,UAAU,EACV,GAAG,UAAU,EACd,EAAE,gBAAgB,qBA2ClB;yBAhDe,WAAW"}
|
package/dist/components/Menu.js
CHANGED
|
@@ -1,35 +1,252 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { cloneElement, createContext, forwardRef, useContext, useMemo, useRef, } from 'react';
|
|
4
|
+
import { DismissButton, Overlay, mergeProps, useMenu, useMenuItem, useMenuSection, useMenuTrigger, usePopover, useSeparator, useSubmenuTrigger, } from 'react-aria';
|
|
5
|
+
import { useMenuTriggerState, useSubmenuTriggerState, useTreeState, } from 'react-stately';
|
|
6
|
+
import { CollectionBuilder, Item, Section, getChildNodes, } from '@react-stately/collections';
|
|
3
7
|
import { resolveDisabled } from './resolve-disabled.js';
|
|
4
8
|
/**
|
|
5
|
-
* Menu
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
* One row of a Menu. A collection element, like TabItem: it renders nothing
|
|
10
|
+
* itself — Menu reads its props and draws the row — so it only means anything
|
|
11
|
+
* as a direct child of Menu or MenuSection. Give it a `key`; that key is what
|
|
12
|
+
* `onAction` and `selectedKeys` speak in.
|
|
13
|
+
*/
|
|
14
|
+
export function MenuItem(
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
_props) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
* The collection builder asks the element's TYPE how to turn it into a node.
|
|
21
|
+
* Borrowing Item's answer is what makes MenuItem a collection element while
|
|
22
|
+
* keeping its own prop type: the builder copies every prop onto `node.props`,
|
|
23
|
+
* which is where Menu reads `icon` and `isDisabled` back from.
|
|
24
|
+
*/
|
|
25
|
+
MenuItem.getCollectionNode = Item.getCollectionNode;
|
|
26
|
+
MenuItem.displayName = 'MenuItem';
|
|
27
|
+
/**
|
|
28
|
+
* A named group of MenuItems. `title` is Figma's `Menu Section Title`; without
|
|
29
|
+
* one, pass `aria-label` and the group is set off by a rule instead.
|
|
30
|
+
*/
|
|
31
|
+
export { Section as MenuSection };
|
|
21
32
|
/** Figma's trailing check. Always occupies its slot so rows never reflow as the
|
|
22
33
|
* selection moves; only its visibility changes. */
|
|
23
34
|
const Check = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m5 13 4 4L19 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
/** Figma draws no submenu row; this is Button's chevron, turned to point
|
|
36
|
+
* where the submenu opens. Mirrored in right-to-left layouts by the CSS. */
|
|
37
|
+
const Chevron = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m9 18 6-6-6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
38
|
+
/**
|
|
39
|
+
* What MenuTrigger hands the Menu it opens: the ARIA wiring from
|
|
40
|
+
* `useMenuTrigger` (the label, autofocus and close-on-action), and the root
|
|
41
|
+
* state every submenu's state is derived from.
|
|
42
|
+
*/
|
|
43
|
+
const MenuTriggerContext = createContext(null);
|
|
44
|
+
/**
|
|
45
|
+
* What a menu hands the submenus beneath it. `onAction` is the ROOT menu's:
|
|
46
|
+
* an action chosen three levels down is still one of the actions the caller
|
|
47
|
+
* listed, and it reaches the one handler the caller wrote.
|
|
48
|
+
*/
|
|
49
|
+
const MenuTreeContext = createContext(null);
|
|
50
|
+
/**
|
|
51
|
+
* Reads the two deprecated item props before the menu's state exists.
|
|
52
|
+
*
|
|
53
|
+
* `isDisabled` needs nothing here: react-stately's SelectionManager reads an
|
|
54
|
+
* item's own `isDisabled` off `node.props`, and the arrow keys skip it. The
|
|
55
|
+
* `disabled` alias it has never heard of, so that one has to reach
|
|
56
|
+
* `useTreeState` as a key — a row that only LOOKED disabled would still take
|
|
57
|
+
* focus and fire `onAction`. `isSelected` has to become `selectedKeys` for the
|
|
58
|
+
* same reason. Building the collection once more is the price of the aliases,
|
|
59
|
+
* and a menu is small enough that the price is nothing. Delete this with them.
|
|
60
|
+
*/
|
|
61
|
+
function readItemFlags(props) {
|
|
62
|
+
const flags = {
|
|
63
|
+
disabled: [],
|
|
64
|
+
selected: [],
|
|
65
|
+
hasLegacySelected: false,
|
|
66
|
+
};
|
|
67
|
+
const visit = (nodes) => {
|
|
68
|
+
for (const node of nodes) {
|
|
69
|
+
if (node.type === 'section') {
|
|
70
|
+
visit(node.childNodes);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const p = node.props;
|
|
74
|
+
if (!p)
|
|
75
|
+
continue;
|
|
76
|
+
if (p.isDisabled === undefined &&
|
|
77
|
+
resolveDisabled(p.isDisabled, p.disabled))
|
|
78
|
+
flags.disabled.push(node.key);
|
|
79
|
+
if (p.isSelected !== undefined) {
|
|
80
|
+
flags.hasLegacySelected = true;
|
|
81
|
+
if (p.isSelected)
|
|
82
|
+
flags.selected.push(node.key);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
visit(new CollectionBuilder().build(props));
|
|
87
|
+
return flags;
|
|
88
|
+
}
|
|
89
|
+
function MenuRow(props) {
|
|
90
|
+
const tree = useContext(MenuTreeContext);
|
|
91
|
+
return props.item.hasChildNodes && tree ? (_jsx(SubmenuRow, { ...props, tree: tree })) : (_jsx(ActionRow, { ...props }));
|
|
92
|
+
}
|
|
93
|
+
function ActionRow({ item, state }) {
|
|
94
|
+
const ref = useRef(null);
|
|
95
|
+
const { menuItemProps, labelProps, isFocused, isFocusVisible, isSelected, isDisabled, } = useMenuItem({ key: item.key }, state, ref);
|
|
96
|
+
const icon = item.props?.icon;
|
|
97
|
+
return (_jsxs("li", { ...menuItemProps, ref: ref, className: [
|
|
98
|
+
'ion-menu__item',
|
|
99
|
+
isSelected ? 'ion-menu__item--selected' : '',
|
|
100
|
+
]
|
|
101
|
+
.filter(Boolean)
|
|
102
|
+
.join(' '), "data-focused": isFocused || undefined, "data-focus-visible": isFocusVisible || undefined, "data-disabled": isDisabled || undefined, children: [icon && (_jsx("span", { className: "ion-menu__icon", "aria-hidden": "true", children: icon })), _jsx("span", { ...labelProps, className: "ion-menu__label", children: item.rendered }), state.selectionManager.selectionMode !== 'none' && (_jsx("span", { className: "ion-menu__check", "aria-hidden": "true", children: _jsx(Check, {}) }))] }));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A row that opens a submenu. Right arrow, Enter or Space opens it with focus
|
|
106
|
+
* on its first row; hovering opens it after a short delay; left arrow or
|
|
107
|
+
* Escape closes it and puts focus back on this row.
|
|
108
|
+
*
|
|
109
|
+
* The submenu is NOT modal: the parent menu stays on screen and hoverable, so
|
|
110
|
+
* the pointer can move between the two. react-aria makes that choice, and it
|
|
111
|
+
* is the right one — a submenu that trapped focus would make moving back up a
|
|
112
|
+
* level a keyboard-only act.
|
|
113
|
+
*/
|
|
114
|
+
function SubmenuRow({ item, state, menuRef, tree, }) {
|
|
115
|
+
const ref = useRef(null);
|
|
116
|
+
const submenuRef = useRef(null);
|
|
117
|
+
const submenuState = useSubmenuTriggerState({ triggerKey: item.key }, tree.rootState);
|
|
118
|
+
const { submenuTriggerProps, submenuProps, popoverProps } = useSubmenuTrigger({ parentMenuRef: menuRef, submenuRef, type: 'menu' }, submenuState, ref);
|
|
119
|
+
// `isOpen` describes the trigger, it is not a menu-item option.
|
|
120
|
+
const { isOpen, ...triggerOptions } = submenuTriggerProps;
|
|
121
|
+
const { menuItemProps, labelProps, isFocused, isFocusVisible, isDisabled } = useMenuItem({ ...triggerOptions, key: item.key }, state, ref);
|
|
122
|
+
const icon = item.props?.icon;
|
|
123
|
+
return (_jsxs("li", { ...menuItemProps, ref: ref, className: "ion-menu__item ion-menu__item--submenu", "data-focused": isFocused || undefined, "data-focus-visible": isFocusVisible || undefined, "data-disabled": isDisabled || undefined, "data-open": isOpen || undefined, children: [icon && (_jsx("span", { className: "ion-menu__icon", "aria-hidden": "true", children: icon })), _jsx("span", { ...labelProps, className: "ion-menu__label", children: item.rendered }), _jsx("span", { className: "ion-menu__chevron", "aria-hidden": "true", children: _jsx(Chevron, {}) }), submenuState.isOpen && (_jsx(MenuPopover, { state: submenuState, triggerRef: ref, popoverRef: submenuRef, placement: "end top", isNonModal: popoverProps.isNonModal, shouldCloseOnInteractOutside: popoverProps.shouldCloseOnInteractOutside, disableFocusManagement: popoverProps.disableFocusManagement, children: _jsx(MenuList, { ...submenuProps, onAction: tree.onAction, children: item.props.children }) }))] }));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The floating surface a menu opens on. Mounted only while open, for the
|
|
127
|
+
* reason AGENTS.md gives about overlay hooks: `usePopover` has to be called in
|
|
128
|
+
* the component that mounts with the overlay.
|
|
129
|
+
*
|
|
130
|
+
* Figma's Menu already IS the surface — border, radius, Shadow/lg — so this
|
|
131
|
+
* wrapper paints nothing. It positions, and it carries the underlay that makes
|
|
132
|
+
* an outside click close the root menu. A submenu has no underlay: it is
|
|
133
|
+
* non-modal, and an underlay would swallow the pointer on its way back to the
|
|
134
|
+
* parent.
|
|
135
|
+
*/
|
|
136
|
+
function MenuPopover({ state, triggerRef, popoverRef, placement, isNonModal, shouldCloseOnInteractOutside, disableFocusManagement, children, }) {
|
|
137
|
+
const { popoverProps, underlayProps } = usePopover({
|
|
138
|
+
triggerRef,
|
|
139
|
+
popoverRef,
|
|
140
|
+
placement,
|
|
141
|
+
offset: isNonModal ? 0 : 4,
|
|
142
|
+
// Line the submenu's first row up with the row that opened it: the
|
|
143
|
+
// menu's own padding plus its border.
|
|
144
|
+
crossOffset: isNonModal ? -7 : 0,
|
|
145
|
+
isNonModal,
|
|
146
|
+
shouldCloseOnInteractOutside,
|
|
147
|
+
}, state);
|
|
148
|
+
return (_jsxs(Overlay, { disableFocusManagement: disableFocusManagement, children: [!isNonModal && (_jsx("div", { ...underlayProps, className: "ion-menu-popover__underlay" })), _jsxs("div", { ...popoverProps, ref: popoverRef, className: "ion-menu-popover", children: [!isNonModal && _jsx(DismissButton, { onDismiss: state.close }), children, !isNonModal && _jsx(DismissButton, { onDismiss: state.close })] })] }));
|
|
149
|
+
}
|
|
150
|
+
function MenuSectionGroup({ section, state, isFirst, menuRef, }) {
|
|
151
|
+
const { itemProps, headingProps, groupProps } = useMenuSection({
|
|
152
|
+
heading: section.rendered,
|
|
153
|
+
'aria-label': section['aria-label'],
|
|
154
|
+
});
|
|
155
|
+
const { separatorProps } = useSeparator({ elementType: 'li' });
|
|
156
|
+
return (_jsxs(_Fragment, { children: [!isFirst && !section.rendered && (_jsx("li", { ...separatorProps, className: "ion-menu__separator" })), _jsxs("li", { ...itemProps, className: "ion-menu__section", children: [section.rendered && (_jsx("span", { ...headingProps, className: "ion-menu__section-title", children: section.rendered })), _jsx("ul", { ...groupProps, className: "ion-menu__group", children: [...getChildNodes(section, state.collection)].map((node) => (_jsx(MenuRow, { item: node, state: state, menuRef: menuRef }, node.key))) })] })] }));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The list itself, shared by the root menu and every submenu. It knows nothing
|
|
160
|
+
* about triggers: whatever opened it has already put its wiring into `props`.
|
|
161
|
+
*/
|
|
162
|
+
const MenuList = forwardRef(function MenuList(props, forwardedRef) {
|
|
163
|
+
const { className, style } = props;
|
|
164
|
+
const flags = useMemo(() => readItemFlags(props),
|
|
165
|
+
// Only the collection's inputs matter here; the rest of `props` changes on
|
|
166
|
+
// every render and would rebuild the collection for nothing.
|
|
167
|
+
[props.children, props.items]);
|
|
168
|
+
const disabledKeys = useMemo(() => new Set([...(props.disabledKeys ?? []), ...flags.disabled]), [props.disabledKeys, flags.disabled]);
|
|
169
|
+
const usesLegacySelection = flags.hasLegacySelected &&
|
|
170
|
+
props.selectedKeys === undefined &&
|
|
171
|
+
props.defaultSelectedKeys === undefined;
|
|
172
|
+
const stateProps = {
|
|
173
|
+
...props,
|
|
174
|
+
disabledKeys,
|
|
175
|
+
...(usesLegacySelection && {
|
|
176
|
+
selectedKeys: new Set(flags.selected),
|
|
177
|
+
selectionMode: props.selectionMode ??
|
|
178
|
+
(flags.selected.length > 1 ? 'multiple' : 'single'),
|
|
179
|
+
}),
|
|
180
|
+
};
|
|
181
|
+
const state = useTreeState(stateProps);
|
|
182
|
+
const ref = useRef(null);
|
|
183
|
+
const { menuProps } = useMenu(stateProps, state, ref);
|
|
184
|
+
const setRef = (el) => {
|
|
185
|
+
ref.current = el;
|
|
186
|
+
if (typeof forwardedRef === 'function')
|
|
187
|
+
forwardedRef(el);
|
|
188
|
+
else if (forwardedRef)
|
|
189
|
+
forwardedRef.current = el;
|
|
190
|
+
};
|
|
191
|
+
const nodes = [...state.collection];
|
|
192
|
+
return (_jsx("ul", { ...menuProps, ref: setRef, style: style, className: ['ion-menu', className].filter(Boolean).join(' '), children: nodes.map((node, i) => node.type === 'section' ? (_jsx(MenuSectionGroup, { section: node, state: state, isFirst: i === 0, menuRef: ref }, node.key)) : (_jsx(MenuRow, { item: node, state: state, menuRef: ref }, node.key))) }));
|
|
33
193
|
});
|
|
34
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Menu — Figma `Menu` (82:306), `Menu Item` and `Menu Section Title`.
|
|
196
|
+
*
|
|
197
|
+
* A real ARIA menu: `role="menu"`, one tab stop, arrow keys, Home and End,
|
|
198
|
+
* typeahead, and disabled rows listed but skipped. Figma's `Type` is
|
|
199
|
+
* `selectionMode` — Single draws one check, Multi draws several — and with
|
|
200
|
+
* a selection mode the rows become `menuitemradio` / `menuitemcheckbox` and
|
|
201
|
+
* announce their checked state.
|
|
202
|
+
*
|
|
203
|
+
* On its own it is the surface only, rendered in flow. Inside a MenuTrigger it
|
|
204
|
+
* floats, opens and closes, is named by its trigger, and can open submenus.
|
|
205
|
+
*/
|
|
206
|
+
export const Menu = forwardRef(function Menu(props, forwardedRef) {
|
|
207
|
+
const trigger = useContext(MenuTriggerContext);
|
|
208
|
+
if (!trigger)
|
|
209
|
+
return _jsx(MenuList, { ...props, ref: forwardedRef });
|
|
210
|
+
/*
|
|
211
|
+
* The trigger names the menu through aria-labelledby. An aria-label the
|
|
212
|
+
* caller passed is kept and wins, because a trigger reading "⋯" or "Options"
|
|
213
|
+
* is often a worse name than the one the caller wrote.
|
|
214
|
+
*/
|
|
215
|
+
const { 'aria-labelledby': labelledBy, ...wiring } = trigger.menuProps;
|
|
216
|
+
const named = props['aria-label'] || props['aria-labelledby'];
|
|
217
|
+
const merged = mergeProps(wiring, named ? {} : { 'aria-labelledby': labelledBy }, props);
|
|
218
|
+
return (_jsx(MenuTreeContext.Provider, { value: {
|
|
219
|
+
rootState: trigger.rootState,
|
|
220
|
+
onAction: props.onAction,
|
|
221
|
+
}, children: _jsx(MenuList, { ...merged, ref: forwardedRef }) }));
|
|
222
|
+
});
|
|
223
|
+
/**
|
|
224
|
+
* MenuTrigger — a Button that opens a Menu.
|
|
225
|
+
*
|
|
226
|
+
* The "⋯" overflow menu is this with an icon-only Button; there is no separate
|
|
227
|
+
* component for it, because the only difference is the Button's content and
|
|
228
|
+
* its required aria-label.
|
|
229
|
+
*
|
|
230
|
+
* `useMenuTrigger` does what a Popover wrapped round a Menu could not: the
|
|
231
|
+
* trigger announces `aria-haspopup="menu"` and `aria-expanded`, the menu is
|
|
232
|
+
* named by the trigger, ArrowDown and ArrowUp open it with focus on the first
|
|
233
|
+
* or last row, and choosing an action closes it and returns focus to the
|
|
234
|
+
* trigger.
|
|
235
|
+
*/
|
|
236
|
+
export function MenuTrigger({ children, placement = 'bottom start', isDisabled, ...stateProps }) {
|
|
237
|
+
const [trigger, menu] = React.Children.toArray(children);
|
|
238
|
+
const rootState = useMenuTriggerState(stateProps);
|
|
239
|
+
const triggerRef = useRef(null);
|
|
240
|
+
const popoverRef = useRef(null);
|
|
241
|
+
const { menuTriggerProps, menuProps } = useMenuTrigger({ isDisabled }, rootState, triggerRef);
|
|
242
|
+
return (_jsxs(_Fragment, { children: [cloneElement(trigger, mergeProps(trigger.props, {
|
|
243
|
+
...menuTriggerProps,
|
|
244
|
+
isDisabled,
|
|
245
|
+
ref: triggerRef,
|
|
246
|
+
})), rootState.isOpen && (_jsx(MenuPopover, { state: rootState, triggerRef: triggerRef, popoverRef: popoverRef, placement: placement, children: _jsx(MenuTriggerContext.Provider, { value: {
|
|
247
|
+
rootState,
|
|
248
|
+
menuProps: menuProps,
|
|
249
|
+
}, children: menu }) }))] }));
|
|
250
|
+
}
|
|
251
|
+
MenuTrigger.displayName = 'MenuTrigger';
|
|
35
252
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../src/components/Menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../src/components/Menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,aAAa,EACb,OAAO,EACP,UAAU,EACV,OAAO,EACP,WAAW,EACX,cAAc,EACd,cAAc,EACd,UAAU,EACV,YAAY,EACZ,iBAAiB,GAIlB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,GAGb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,OAAO,EACP,aAAa,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA+BxD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ;AACtB,6DAA6D;AAC7D,MAAwB;IAExB,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACF,QAAsD,CAAC,iBAAiB,GACvE,IACD,CAAC,iBAAiB,CAAC;AAEpB,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC;;;GAGG;AACH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,CAAC;AAElC;oDACoD;AACpD,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CAClB,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACvE,eACE,CAAC,EAAC,gBAAgB,EAClB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AAEF;6EAC6E;AAC7E,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,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AAG,gBAAgB;gBACnB,UAAU;gBACV,GAAG,EAAE,UAAU;aAChB,CAAC,CACH,EACA,SAAS,CAAC,MAAM,IAAI,CACnB,KAAC,WAAW,IACV,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAsB,YAEjC,KAAC,kBAAkB,CAAC,QAAQ,IAC1B,KAAK,EAAE;wBACL,SAAS;wBACT,SAAS,EAAE,SAAoC;qBAChD,YAEA,IAAI,GACuB,GAClB,CACf,IACA,CACJ,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Which heading the title renders as. `1` is the default because a page
|
|
4
|
+
* header is the page's title. `2` is for a header inside a pane that is not
|
|
5
|
+
* the page — the detail half of a list-detail layout, under the list's `h1`.
|
|
6
|
+
*/
|
|
7
|
+
export type PageHeaderHeadingLevel = 1 | 2;
|
|
8
|
+
export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
9
|
+
/** The page's title. Rendered as the `h1`. */
|
|
10
|
+
title: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The title's id. Pass it when something else points at the heading —
|
|
13
|
+
* `<main aria-labelledby>` is the usual one. Generated when omitted.
|
|
14
|
+
*/
|
|
15
|
+
titleId?: string;
|
|
16
|
+
/** Heading element for the title. Defaults to `1`. */
|
|
17
|
+
headingLevel?: PageHeaderHeadingLevel;
|
|
18
|
+
/** One or two sentences under the title: what this page is for. */
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
/** A Breadcrumb, above the title. */
|
|
21
|
+
breadcrumb?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Beside the title: a Badge or two for the record's state — "Paused",
|
|
24
|
+
* "Draft". State, not actions.
|
|
25
|
+
*/
|
|
26
|
+
status?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* At the end of the title row: the page's actions, most important last.
|
|
29
|
+
* One primary Button at most; several more go in a MenuTrigger.
|
|
30
|
+
*/
|
|
31
|
+
actions?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* A row beneath, that belongs to the header rather than the page's
|
|
34
|
+
* content: the page's Tabs, or the filters its table answers to.
|
|
35
|
+
*/
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* PageHeader — the top of a page: where you are, what it is, and what you can
|
|
40
|
+
* do to it.
|
|
41
|
+
*
|
|
42
|
+
* Promoted from the demo app, where five screens hand-wrote it in three
|
|
43
|
+
* different shapes (`.demo-page__header`, `.demo-run-header`, and a bare
|
|
44
|
+
* `<div>`), each with its own gap and its own idea of where the actions
|
|
45
|
+
* aligned. Every enterprise system ships one — Carbon's PageHeader,
|
|
46
|
+
* Lightning's page headers — because every page has one.
|
|
47
|
+
*
|
|
48
|
+
* NOT A LANDMARK
|
|
49
|
+
*
|
|
50
|
+
* It renders a `<div>`, not a `<header>`. A `<header>` that is a child of
|
|
51
|
+
* `<body>` is the page's banner, and the app shell's Header already is that.
|
|
52
|
+
* The page's landmark is `<main>`, named by this title: pass `titleId` and
|
|
53
|
+
* point `<main aria-labelledby>` at it.
|
|
54
|
+
*
|
|
55
|
+
* No `'use client'`: `useId` resolves on the server, and nothing here is
|
|
56
|
+
* interactive. Interactive parts arrive through the slots.
|
|
57
|
+
*/
|
|
58
|
+
export declare const PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
//# sourceMappingURL=PageHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,CAAC,CAAC;AAE3C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,OAAO,CACR;IACC,8CAA8C;IAC9C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,mEAAmE;IACnE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,wFAmDtB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* PageHeader — the top of a page: where you are, what it is, and what you can
|
|
5
|
+
* do to it.
|
|
6
|
+
*
|
|
7
|
+
* Promoted from the demo app, where five screens hand-wrote it in three
|
|
8
|
+
* different shapes (`.demo-page__header`, `.demo-run-header`, and a bare
|
|
9
|
+
* `<div>`), each with its own gap and its own idea of where the actions
|
|
10
|
+
* aligned. Every enterprise system ships one — Carbon's PageHeader,
|
|
11
|
+
* Lightning's page headers — because every page has one.
|
|
12
|
+
*
|
|
13
|
+
* NOT A LANDMARK
|
|
14
|
+
*
|
|
15
|
+
* It renders a `<div>`, not a `<header>`. A `<header>` that is a child of
|
|
16
|
+
* `<body>` is the page's banner, and the app shell's Header already is that.
|
|
17
|
+
* The page's landmark is `<main>`, named by this title: pass `titleId` and
|
|
18
|
+
* point `<main aria-labelledby>` at it.
|
|
19
|
+
*
|
|
20
|
+
* No `'use client'`: `useId` resolves on the server, and nothing here is
|
|
21
|
+
* interactive. Interactive parts arrive through the slots.
|
|
22
|
+
*/
|
|
23
|
+
export const PageHeader = forwardRef(({ title, titleId, headingLevel = 1, description, breadcrumb, status, actions, className, children, ...rest }, ref) => {
|
|
24
|
+
const generatedId = useId();
|
|
25
|
+
const Heading = `h${headingLevel}`;
|
|
26
|
+
return (_jsxs("div", { ...rest, ref: ref, className: ['ion-page-header', className].filter(Boolean).join(' '), children: [breadcrumb && (_jsx("div", { className: "ion-page-header__breadcrumb", children: breadcrumb })), _jsxs("div", { className: "ion-page-header__main", children: [_jsxs("div", { className: "ion-page-header__heading", children: [_jsxs("div", { className: "ion-page-header__title-row", children: [_jsx(Heading, { id: titleId ?? generatedId, className: "ion-page-header__title", children: title }), status && (_jsx("div", { className: "ion-page-header__status", children: status }))] }), description && (_jsx("p", { className: "ion-page-header__description", children: description }))] }), actions && _jsx("div", { className: "ion-page-header__actions", children: actions })] }), children && _jsx("div", { className: "ion-page-header__below", children: children })] }));
|
|
27
|
+
});
|
|
28
|
+
PageHeader.displayName = 'PageHeader';
|
|
29
|
+
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AA2CjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,KAAK,EACL,OAAO,EACP,YAAY,GAAG,CAAC,EAChB,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,IAAI,YAAY,EAAW,CAAC;IAE5C,OAAO,CACL,kBACM,IAAI,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAElE,UAAU,IAAI,CACb,cAAK,SAAS,EAAC,6BAA6B,YAAE,UAAU,GAAO,CAChE,EACD,eAAK,SAAS,EAAC,uBAAuB,aACpC,eAAK,SAAS,EAAC,0BAA0B,aACvC,eAAK,SAAS,EAAC,4BAA4B,aACzC,KAAC,OAAO,IACN,EAAE,EAAE,OAAO,IAAI,WAAW,EAC1B,SAAS,EAAC,wBAAwB,YAEjC,KAAK,GACE,EACT,MAAM,IAAI,CACT,cAAK,SAAS,EAAC,yBAAyB,YAAE,MAAM,GAAO,CACxD,IACG,EACL,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,8BAA8B,YAAE,WAAW,GAAK,CAC9D,IACG,EACL,OAAO,IAAI,cAAK,SAAS,EAAC,0BAA0B,YAAE,OAAO,GAAO,IACjE,EACL,QAAQ,IAAI,cAAK,SAAS,EAAC,wBAAwB,YAAE,QAAQ,GAAO,IACjE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -22,8 +22,8 @@ export { Radio, RadioGroup } from './Radio.js';
|
|
|
22
22
|
export type { RadioProps, RadioGroupProps, RadioSize, RadioIntent, } from './Radio.js';
|
|
23
23
|
export { Toggle } from './Toggle.js';
|
|
24
24
|
export type { ToggleProps, ToggleSize, ToggleIntent } from './Toggle.js';
|
|
25
|
-
export { Menu, MenuItem } from './Menu.js';
|
|
26
|
-
export type { MenuProps, MenuItemProps } from './Menu.js';
|
|
25
|
+
export { Menu, MenuItem, MenuSection, MenuTrigger } from './Menu.js';
|
|
26
|
+
export type { MenuProps, MenuItemProps, MenuTriggerProps, MenuTriggerPlacement, } from './Menu.js';
|
|
27
27
|
export { Avatar, AvatarGroup } from './Avatar.js';
|
|
28
28
|
export type { AvatarProps, AvatarGroupProps, AvatarSize, AvatarShape, AvatarIndicatorIntent, } from './Avatar.js';
|
|
29
29
|
export { AvatarGradient } from './AvatarGradient.js';
|
|
@@ -57,6 +57,8 @@ export type { TimeFieldProps, TimeFieldSize, TimeFieldGranularity, } from './Tim
|
|
|
57
57
|
export type { IsoTime } from './iso-time.js';
|
|
58
58
|
export { TagGroup, Tag } from './TagGroup.js';
|
|
59
59
|
export type { TagGroupProps, TagGroupSize } from './TagGroup.js';
|
|
60
|
+
export { PageHeader } from './PageHeader.js';
|
|
61
|
+
export type { PageHeaderProps, PageHeaderHeadingLevel } from './PageHeader.js';
|
|
60
62
|
export { Card } from './Card.js';
|
|
61
63
|
export type { CardProps, CardHeadingLevel, CardIntent } from './Card.js';
|
|
62
64
|
export { FullCard } from './FullCard.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EACV,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ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EAChB,WAAW,EACX,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AAQpB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export { Select } from './Select.js';
|
|
|
10
10
|
export { Checkbox } from './Checkbox.js';
|
|
11
11
|
export { Radio, RadioGroup } from './Radio.js';
|
|
12
12
|
export { Toggle } from './Toggle.js';
|
|
13
|
-
export { Menu, MenuItem } from './Menu.js';
|
|
13
|
+
export { Menu, MenuItem, MenuSection, MenuTrigger } from './Menu.js';
|
|
14
14
|
export { Avatar, AvatarGroup } from './Avatar.js';
|
|
15
15
|
export { AvatarGradient } from './AvatarGradient.js';
|
|
16
16
|
export { Header } from './Header.js';
|
|
@@ -27,6 +27,7 @@ export { useTableSort } from './use-table-sort.js';
|
|
|
27
27
|
export { ScrollProgress } from './ScrollProgress.js';
|
|
28
28
|
export { TimeField } from './TimeField.js';
|
|
29
29
|
export { TagGroup, Tag } from './TagGroup.js';
|
|
30
|
+
export { PageHeader } from './PageHeader.js';
|
|
30
31
|
export { Card } from './Card.js';
|
|
31
32
|
export { FullCard } from './FullCard.js';
|
|
32
33
|
export { AgentStop } from './AgentStop.js';
|