@ai-matrx/design-system 0.86.334 → 0.86.336
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/CHANGELOG.md +28 -68
- package/dist/carousel.cjs.map +1 -1
- package/dist/carousel.js +4 -4
- package/dist/{chunk-MFUNGDHO.js → chunk-B24DLFWR.js} +2 -2
- package/dist/{chunk-CSSD6NS4.js → chunk-DQUCOMAC.js} +2 -2
- package/dist/chunk-L5OACQXS.js +409 -0
- package/dist/chunk-L5OACQXS.js.map +1 -0
- package/dist/{chunk-6YZMGSQY.js → chunk-M34WPTPX.js} +2 -2
- package/dist/{chunk-7NEVJKDZ.js → chunk-MAMZGJJ3.js} +36 -7
- package/dist/chunk-MAMZGJJ3.js.map +1 -0
- package/dist/{chunk-VV6WZTH5.js → chunk-PBDQZPKV.js} +2 -2
- package/dist/{chunk-E4GS5QH7.js → chunk-Q2HWDJED.js} +2 -2
- package/dist/{chunk-ZOQ2XKXF.js → chunk-QOEKPR37.js} +5 -5
- package/dist/chunk-QOEKPR37.js.map +1 -0
- package/dist/{chunk-MEJVHDYJ.js → chunk-RGJPHRU3.js} +2 -2
- package/dist/{chunk-3MQMVPKO.js → chunk-VQ3G6AFN.js} +4 -4
- package/dist/{chunk-677JS6TX.js → chunk-WZC3K7SO.js} +75 -158
- package/dist/chunk-WZC3K7SO.js.map +1 -0
- package/dist/clipboard-fallback-dialog.cjs.map +1 -1
- package/dist/clipboard-fallback-dialog.js +1 -1
- package/dist/controls.cjs +4 -4
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.css +6 -0
- package/dist/controls.js +4 -4
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +4 -4
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +5 -5
- package/dist/data-table/index.cjs +4 -4
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +7 -7
- package/dist/data-table/pagination.cjs +4 -4
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +2 -2
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +2 -2
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.js +9 -8
- package/dist/desktop.js.map +1 -1
- package/dist/index.cjs +1508 -1187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +24 -23
- package/dist/index.js.map +1 -1
- package/dist/item.cjs +646 -372
- package/dist/item.cjs.map +1 -1
- package/dist/item.d.cts +1 -3
- package/dist/item.d.ts +1 -3
- package/dist/item.js +26 -34
- package/dist/item.js.map +1 -1
- package/dist/lite-table.cjs.map +1 -1
- package/dist/lite-table.js +1 -1
- package/dist/menu-look.cjs +521 -36
- package/dist/menu-look.cjs.map +1 -1
- package/dist/menu-look.css +96 -1
- package/dist/menu-look.d.cts +320 -37
- package/dist/menu-look.d.ts +320 -37
- package/dist/menu-look.js +60 -121
- package/dist/menu-look.js.map +1 -1
- package/dist/record-list.cjs +533 -253
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.js +4 -2
- package/dist/record-list.js.map +1 -1
- package/dist/settings.cjs.map +1 -1
- package/dist/settings.js +2 -2
- package/dist/writing-field.cjs.map +1 -1
- package/dist/writing-field.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-677JS6TX.js.map +0 -1
- package/dist/chunk-7NEVJKDZ.js.map +0 -1
- package/dist/chunk-ZOQ2XKXF.js.map +0 -1
- /package/dist/{chunk-MFUNGDHO.js.map → chunk-B24DLFWR.js.map} +0 -0
- /package/dist/{chunk-CSSD6NS4.js.map → chunk-DQUCOMAC.js.map} +0 -0
- /package/dist/{chunk-6YZMGSQY.js.map → chunk-M34WPTPX.js.map} +0 -0
- /package/dist/{chunk-VV6WZTH5.js.map → chunk-PBDQZPKV.js.map} +0 -0
- /package/dist/{chunk-E4GS5QH7.js.map → chunk-Q2HWDJED.js.map} +0 -0
- /package/dist/{chunk-MEJVHDYJ.js.map → chunk-RGJPHRU3.js.map} +0 -0
- /package/dist/{chunk-3MQMVPKO.js.map → chunk-VQ3G6AFN.js.map} +0 -0
package/dist/menu-look.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
4
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* The opaque surface option shared by every floating menu surface
|
|
@@ -33,9 +35,6 @@ type PopoverSurface = "default" | "solid";
|
|
|
33
35
|
* Icons are the package's inlined SVGs (C19) — no icon-library dependency.
|
|
34
36
|
*/
|
|
35
37
|
|
|
36
|
-
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
37
|
-
inset?: boolean;
|
|
38
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
39
38
|
/**
|
|
40
39
|
* A SUBMENU OPENS BESIDE ITS PARENT, NEVER ON TOP OF IT (merged-grid review 2, C1: "nested
|
|
41
40
|
* submenus overlap the parent menu"). The submenu was drawn INSIDE the parent's surface, and that
|
|
@@ -58,18 +57,147 @@ interface DropdownMenuContentProps extends React.ComponentPropsWithoutRef<typeof
|
|
|
58
57
|
}
|
|
59
58
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
59
|
|
|
60
|
+
/**
|
|
61
|
+
* ContextMenu — the right-click menu primitive.
|
|
62
|
+
*
|
|
63
|
+
* THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate a
|
|
64
|
+
* matrx-frontend wrapper once carried ("Radix generates dynamic aria-controls
|
|
65
|
+
* ids that differ between SSR and client") was false twice over: a CLOSED
|
|
66
|
+
* `ContextMenuTrigger` renders only `data-state` / `data-disabled` and emits
|
|
67
|
+
* no id at all, so there was never a mismatch to defend against. And the gate
|
|
68
|
+
* was actively harmful: the Trigger wraps ALWAYS-VISIBLE content, so `return
|
|
69
|
+
* null` deleted the wrapped subtree from the server render and the first
|
|
70
|
+
* client render — around a list row, that means the list paints EMPTY and
|
|
71
|
+
* fills in after hydration. Gating the Root would additionally orphan any
|
|
72
|
+
* Trigger rendered beneath it.
|
|
73
|
+
*
|
|
74
|
+
* That history is exactly why this belongs in the package: the same repo had
|
|
75
|
+
* already accumulated two copies of this wrapper, one gated and one not, with
|
|
76
|
+
* the CORRECT one sitting unused beside the defective one.
|
|
77
|
+
*
|
|
78
|
+
* This is the PRIMITIVE only. A host's actual right-click menu SYSTEM — the
|
|
79
|
+
* sections, the copy/export/convert actions, the surface registry — composes
|
|
80
|
+
* these parts and stays host-owned; nothing here knows what an action is.
|
|
81
|
+
*
|
|
82
|
+
* Portalling goes through the package's `usePortalContainer` seam so a menu
|
|
83
|
+
* raised inside a Dialog mounts inside it; an explicit `container` wins.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
/** Portalled like its parent, so it opens BESIDE it — see `DropdownMenuSubContent` for why. */
|
|
87
|
+
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
88
|
+
container?: HTMLElement | null;
|
|
89
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
90
|
+
interface ContextMenuContentProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> {
|
|
91
|
+
/** Explicit portal target; wins over the injected container. */
|
|
92
|
+
container?: HTMLElement | null;
|
|
93
|
+
}
|
|
94
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Popover — ported verbatim from matrx-frontend `components/ui/popover.tsx`.
|
|
98
|
+
*
|
|
99
|
+
* Seam inversion: the host's `useNestedPortalContainer` (dialog/popout aware)
|
|
100
|
+
* becomes the injected `PortalContainerProvider` seam (`portal-container.tsx`);
|
|
101
|
+
* the explicit `container` prop keeps top priority, exactly as before.
|
|
102
|
+
*
|
|
103
|
+
* THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer
|
|
104
|
+
* rendering until after hydration ("Radix generates dynamic aria-controls ids
|
|
105
|
+
* that differ between SSR and client"), and that justification was false:
|
|
106
|
+
* Radix ids come from React's SSR-stable `useId` (verified against
|
|
107
|
+
* @radix-ui/react-popover 1.1.17 / react-id 1.1.2). The gate was actively
|
|
108
|
+
* harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`
|
|
109
|
+
* deleted it from SSR and the first client paint.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
interface PopoverContentProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
|
|
113
|
+
/** Explicit portal target; wins over the injected container. */
|
|
114
|
+
container?: HTMLElement | null;
|
|
115
|
+
/**
|
|
116
|
+
* Package-owned open/close motion. Default `true`. Pass `false` for a
|
|
117
|
+
* surface that must appear instantly — a picker re-anchoring while the user
|
|
118
|
+
* types, a measurement pass. It is NOT the reduced-motion switch;
|
|
119
|
+
* `styles.css` already honors `prefers-reduced-motion`.
|
|
120
|
+
*/
|
|
121
|
+
animated?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* HOW WIDE THE POPOVER IS ALLOWED TO BE, and it is the SYSTEM that decides — never a
|
|
124
|
+
* surface pasting its own `w-64` over the default (lane FIX-14, 2026-09-22).
|
|
125
|
+
*
|
|
126
|
+
* `"fixed"` (default) is the historical `w-72`: right for a menu of short, known
|
|
127
|
+
* labels, where a ragged edge would look broken.
|
|
128
|
+
*
|
|
129
|
+
* `"content"` is for a popover whose whole job is to SHOW SOMETHING THE SYSTEM DID
|
|
130
|
+
* NOT CHOOSE — a person's name, a record's title, a row the user is about to
|
|
131
|
+
* create. The relation picker offered
|
|
132
|
+
*
|
|
133
|
+
* Create “Marisol Okonkwo — 418 Calle Pu
|
|
134
|
+
*
|
|
135
|
+
* inside a 16rem box, cut mid-word, on the one control that exists to show the name
|
|
136
|
+
* being created. A fixed width cannot be right for content of unknown length, so
|
|
137
|
+
* this one grows to its content between an honest floor and an honest ceiling:
|
|
138
|
+
*
|
|
139
|
+
* · at least the trigger's own width, and at least 20rem — the width Airtable's and
|
|
140
|
+
* Notion's link-record pickers settle on, and wide enough that an ordinary
|
|
141
|
+
* "name — street, town" fits on one line;
|
|
142
|
+
* · at most 28rem, and never wider than the viewport less a 1rem gutter each side,
|
|
143
|
+
* so it still fits a 375px phone with nothing running off the screen. The floor is
|
|
144
|
+
* clamped by the same gutter, so on a very narrow screen the ceiling still wins.
|
|
145
|
+
*
|
|
146
|
+
* Beyond that ceiling the CONTENT truncates with an ellipsis and carries a `title`.
|
|
147
|
+
* Growing, then ellipsis — never a mid-word cut.
|
|
148
|
+
*
|
|
149
|
+
* BOTH modes keep the phone gutter (2026-09-26): the box is never wider than the
|
|
150
|
+
* viewport less 1rem each side, and Radix keeps it `collisionPadding` (16px) off every
|
|
151
|
+
* screen edge. Measured at 375px before this: `w-72`/`w-80` callers landed flush on
|
|
152
|
+
* the right edge (55→375) because collision padding was 0.
|
|
153
|
+
*/
|
|
154
|
+
sizing?: "fixed" | "content";
|
|
155
|
+
/**
|
|
156
|
+
* The surface fill. `"default"` is the theme's popover surface (a host may render it
|
|
157
|
+
* translucent / glass). `"solid"` is the OPAQUE surface — the popover token at full
|
|
158
|
+
* alpha, no backdrop blur — for a menu that must read as paper over a cover image or a
|
|
159
|
+
* busy page (a Notion-style ••• menu). Same option on `DropdownMenuContent`.
|
|
160
|
+
*/
|
|
161
|
+
surface?: PopoverSurface;
|
|
162
|
+
/**
|
|
163
|
+
* A NAMED fixed width (0.68.22), for a `sizing="fixed"` popover whose content needs more or
|
|
164
|
+
* less room than the default `md` (18rem) — never a pasted `w-[260px]`. Every width keeps the
|
|
165
|
+
* phone gutter (never wider than the viewport less 1rem each side). Derived from the call
|
|
166
|
+
* sites: `xs` 12rem (a short menu), `sm` 15rem (a ••• menu), `md` 18rem (default),
|
|
167
|
+
* `lg` 20rem (a small form), `xl` 26rem (a picker grid), `2xl` 34rem (a gallery).
|
|
168
|
+
* Ignored when `sizing="content"`.
|
|
169
|
+
*/
|
|
170
|
+
width?: PopoverWidth;
|
|
171
|
+
/**
|
|
172
|
+
* The inner padding, named (0.68.22): `none` (the content draws its own — a command list, a
|
|
173
|
+
* picker), `xs` 4px (a menu of rows), `sm` 8px, `md` 12px, `default` 16px.
|
|
174
|
+
*/
|
|
175
|
+
padding?: PopoverPadding;
|
|
176
|
+
}
|
|
177
|
+
type PopoverWidth = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
178
|
+
type PopoverPadding = "none" | "xs" | "sm" | "md" | "default";
|
|
179
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
180
|
+
|
|
61
181
|
/**
|
|
62
182
|
* `@ai-matrx/design-system/menu-look` — THE ONE MENU LOOK (Arman, 2026-10-23: the header "…", every
|
|
63
183
|
* crumb dropdown and every Alchemy dropdown are "the IDENTICAL dropdown that I use for Alchemy for size
|
|
64
184
|
* and style" — the right-click menu).
|
|
65
185
|
*
|
|
66
|
-
*
|
|
186
|
+
* Four families, one look:
|
|
67
187
|
* - `MENU_LOOK_CLASS` / `MenuLookRowBody` / `MenuLookIconSlot`: the class names and the inside of a row,
|
|
68
188
|
* used by @ai-matrx/context-menu's MenuPanel (its own non-Radix renderer, the right-click menu);
|
|
69
|
-
* - `MenuLookContent` / `MenuLookSubContent` / `MenuLookItem` / `MenuLookSubTrigger` /
|
|
70
|
-
* `MenuLookCheckboxItem` / `
|
|
71
|
-
*
|
|
72
|
-
* frame's "…" and
|
|
189
|
+
* - THE DROPDOWN — `MenuLookContent` / `MenuLookSubContent` / `MenuLookItem` / `MenuLookSubTrigger` /
|
|
190
|
+
* `MenuLookCheckboxItem` / `MenuLookRadioGroup` / `MenuLookRadioItem` / `MenuLookLabel` /
|
|
191
|
+
* `MenuLookSeparator` / `MenuLookSearch` (+ `MenuLookSub`): the panel and rows on the Radix dropdown
|
|
192
|
+
* (keyboard, typeahead, focus return, collision padding) — Alchemy's dropdowns, the frame's "…" and
|
|
193
|
+
* crumb menus, a row's "…" (ItemMenu);
|
|
194
|
+
* - THE RIGHT-CLICK — `MenuLookContext*`: the SAME rows on the Radix context menu (a row's right-click,
|
|
195
|
+
* ItemContextMenu without a host menu);
|
|
196
|
+
* - THE PANEL — `MenuLookPanel` / `MenuLookPopoverContent` / `MenuLookPanelItem` /
|
|
197
|
+
* `MenuLookPanelControlRow` / `MenuLookPanelHeader` / `MenuLookPanelDisclosure` /
|
|
198
|
+
* `MenuLookPanelLabel` / `MenuLookPanelSeparator`: the same panel and rows WITHOUT a Radix menu, for a
|
|
199
|
+
* popover or sheet that also holds controls (a theme switch, a Switch, a search list) — the account
|
|
200
|
+
* rail's Settings, Organization and account menus and the frame's admin menu.
|
|
73
201
|
* Every measurement lives once, in `menu-look.css` (shipped inside `styles.css`): 280px panel, 30px rows,
|
|
74
202
|
* 13px text on a 1.25 line, 16px icons, 4px/8px row padding, 10px corners. No part takes a `className`.
|
|
75
203
|
*
|
|
@@ -83,9 +211,11 @@ declare const MENU_LOOK: {
|
|
|
83
211
|
readonly width: 280;
|
|
84
212
|
readonly largeWidth: 360;
|
|
85
213
|
readonly rowHeight: 30;
|
|
214
|
+
readonly sheetRowHeight: 44;
|
|
86
215
|
readonly fontSize: 13;
|
|
87
216
|
readonly lineHeight: 1.25;
|
|
88
217
|
readonly icon: 16;
|
|
218
|
+
readonly headerMark: 28;
|
|
89
219
|
readonly rowPaddingY: 4;
|
|
90
220
|
readonly rowPaddingX: 8;
|
|
91
221
|
readonly radius: 10;
|
|
@@ -100,11 +230,19 @@ declare const MENU_LOOK_CLASS: {
|
|
|
100
230
|
readonly label: "cm-label";
|
|
101
231
|
readonly hint: "cm-hint";
|
|
102
232
|
readonly current: "cm-current";
|
|
233
|
+
readonly chevron: "cm-chevron";
|
|
103
234
|
readonly search: "cm-search";
|
|
104
235
|
readonly trail: "cm-trail";
|
|
236
|
+
readonly badge: "cm-badge";
|
|
105
237
|
readonly shortcut: "cm-shortcut";
|
|
238
|
+
readonly control: "cm-control";
|
|
106
239
|
readonly divider: "cm-divider";
|
|
107
240
|
readonly sectionLabel: "cm-section-label";
|
|
241
|
+
readonly header: "cm-header";
|
|
242
|
+
readonly headerMark: "cm-header-mark";
|
|
243
|
+
readonly headerText: "cm-header-text";
|
|
244
|
+
readonly headerTitle: "cm-header-title";
|
|
245
|
+
readonly headerSubtitle: "cm-header-subtitle";
|
|
108
246
|
readonly danger: "cm-danger";
|
|
109
247
|
readonly dimmed: "cm-dimmed";
|
|
110
248
|
};
|
|
@@ -118,39 +256,71 @@ interface MenuLookRowBodyProps {
|
|
|
118
256
|
/** The glyph (any 16px svg; the slot sizes it). Omitted → no icon column; the text starts the row. */
|
|
119
257
|
icon?: React.ReactNode | undefined;
|
|
120
258
|
label: React.ReactNode;
|
|
259
|
+
/** Hover text for the label (a long description stays out of the row: no "novels" in menus). */
|
|
260
|
+
labelTitle?: string | undefined;
|
|
121
261
|
/** A muted second line under the label. */
|
|
122
262
|
description?: React.ReactNode | undefined;
|
|
123
263
|
/** A muted end-of-row hint (a trail, a shortcut word). */
|
|
124
264
|
trail?: React.ReactNode | undefined;
|
|
265
|
+
/** A small outlined tag at the row's end ("New", "Beta", a count). */
|
|
266
|
+
badge?: React.ReactNode | undefined;
|
|
267
|
+
/** The row's key, at its end ("⌘C", "R"). */
|
|
268
|
+
shortcut?: React.ReactNode | undefined;
|
|
125
269
|
/** The row the person is on now: medium weight and a check at the row's end (never a left gutter). */
|
|
126
270
|
current?: boolean | undefined;
|
|
127
271
|
}
|
|
128
|
-
/** The inside of a row: icon (when given), label (
|
|
129
|
-
declare function MenuLookRowBody({ icon, label, description, trail, current }: MenuLookRowBodyProps): React.ReactElement;
|
|
272
|
+
/** The inside of a row: icon (when given), label (+ second line), end hint, badge, key, current check. */
|
|
273
|
+
declare function MenuLookRowBody({ icon, label, labelTitle, description, trail, badge, shortcut, current }: MenuLookRowBodyProps): React.ReactElement;
|
|
130
274
|
/** A row's classes: the look's row, plus its danger / dimmed marks. */
|
|
131
275
|
declare function menuLookItemClass({ destructive, dimmed }?: {
|
|
132
276
|
destructive?: boolean | undefined;
|
|
133
277
|
dimmed?: boolean | undefined;
|
|
134
278
|
}): string;
|
|
135
|
-
type
|
|
136
|
-
|
|
279
|
+
type DataAttributes = {
|
|
280
|
+
[dataAttribute: `data-${string}`]: string | undefined;
|
|
281
|
+
};
|
|
282
|
+
interface PanelLookProps {
|
|
137
283
|
/** "standard" (280px, the right-click menu) or "large" (360px, 36px rows). */
|
|
138
284
|
size?: MenuLookSize | undefined;
|
|
139
285
|
density?: MenuLookDensity | undefined;
|
|
140
|
-
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* A submenu panel's fit: `"menu"` (the look's width and padding) or `"content"` — the panel holds a
|
|
289
|
+
* host's own surface (the Alchemy palette): its width, no padding, and the popover height the surface
|
|
290
|
+
* reads mapped to the room this menu measured.
|
|
291
|
+
*/
|
|
292
|
+
type MenuLookSubFit = "menu" | "content";
|
|
293
|
+
type ContentProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuContent>, "className" | "surface">;
|
|
294
|
+
interface MenuLookContentProps extends ContentProps, PanelLookProps, DataAttributes {
|
|
295
|
+
/**
|
|
296
|
+
* A LONG MENU SAYS SO, IN WORDS (FIX-Q13, production `/agents/all` at 1024x768: a record's "…" hid
|
|
297
|
+
* its Delete below the fold and read as dead). Given, the panel is a frame that does not scroll, the
|
|
298
|
+
* rows scroll inside it, and a bar with these words ("More actions below") sits at its bottom edge
|
|
299
|
+
* whenever there is more below — a press scrolls to the end. Measured: a menu that fits shows nothing.
|
|
300
|
+
*/
|
|
301
|
+
moreBelowLabel?: string | undefined;
|
|
141
302
|
}
|
|
142
303
|
/** The menu's panel on the Radix dropdown (portalled, capped at the room Radix measured, scrolls past it). */
|
|
143
304
|
declare const MenuLookContent: React.ForwardRefExoticComponent<MenuLookContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
144
305
|
type SubContentProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuSubContent>, "className" | "surface">;
|
|
145
|
-
interface MenuLookSubContentProps extends SubContentProps {
|
|
146
|
-
|
|
147
|
-
density?: MenuLookDensity | undefined;
|
|
148
|
-
[dataAttribute: `data-${string}`]: string | undefined;
|
|
306
|
+
interface MenuLookSubContentProps extends SubContentProps, PanelLookProps, DataAttributes {
|
|
307
|
+
fit?: MenuLookSubFit | undefined;
|
|
149
308
|
}
|
|
150
309
|
/** A submenu's panel: the same panel, as wide as the menu it opens from. */
|
|
151
310
|
declare const MenuLookSubContent: React.ForwardRefExoticComponent<MenuLookSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
311
|
+
type ContextContentProps = Omit<React.ComponentPropsWithoutRef<typeof ContextMenuContent>, "className">;
|
|
312
|
+
interface MenuLookContextContentProps extends ContextContentProps, PanelLookProps, DataAttributes {
|
|
313
|
+
}
|
|
314
|
+
/** The right-click menu's panel on the Radix context menu: the dropdown's panel, opened at the pointer. */
|
|
315
|
+
declare const MenuLookContextContent: React.ForwardRefExoticComponent<MenuLookContextContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
316
|
+
type ContextSubContentProps = Omit<React.ComponentPropsWithoutRef<typeof ContextMenuSubContent>, "className">;
|
|
317
|
+
interface MenuLookContextSubContentProps extends ContextSubContentProps, PanelLookProps, DataAttributes {
|
|
318
|
+
fit?: MenuLookSubFit | undefined;
|
|
319
|
+
}
|
|
320
|
+
/** A right-click submenu's panel. */
|
|
321
|
+
declare const MenuLookContextSubContent: React.ForwardRefExoticComponent<MenuLookContextSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
152
322
|
type ItemProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>, "className" | "children" | "asChild">;
|
|
153
|
-
interface MenuLookItemProps extends ItemProps, MenuLookRowBodyProps {
|
|
323
|
+
interface MenuLookItemProps extends ItemProps, MenuLookRowBodyProps, DataAttributes {
|
|
154
324
|
destructive?: boolean | undefined;
|
|
155
325
|
/** Drawn dimmed (a greyed verb whose reason is the row's tooltip); still focusable. */
|
|
156
326
|
dimmed?: boolean | undefined;
|
|
@@ -159,29 +329,142 @@ interface MenuLookItemProps extends ItemProps, MenuLookRowBodyProps {
|
|
|
159
329
|
target?: string | undefined;
|
|
160
330
|
/** Props for the `<a>` (aria-current, title, onClick). */
|
|
161
331
|
linkProps?: undefined | Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "className" | "children">;
|
|
162
|
-
[dataAttribute: `data-${string}`]: string | undefined;
|
|
163
332
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
type SubTriggerProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuSubTrigger>, "className" | "children" | "inset">;
|
|
167
|
-
interface MenuLookSubTriggerProps extends SubTriggerProps, MenuLookRowBodyProps {
|
|
168
|
-
[dataAttribute: `data-${string}`]: string | undefined;
|
|
333
|
+
type SubTriggerProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>, "className" | "children" | "asChild">;
|
|
334
|
+
interface MenuLookSubTriggerProps extends SubTriggerProps, MenuLookRowBodyProps, DataAttributes {
|
|
169
335
|
}
|
|
170
|
-
/** A row that opens a submenu (the chevron is the dropdown's own). */
|
|
171
|
-
declare const MenuLookSubTrigger: React.ForwardRefExoticComponent<MenuLookSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
172
336
|
type CheckboxProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>, "className" | "children" | "asChild">;
|
|
173
|
-
interface MenuLookCheckboxItemProps extends CheckboxProps, MenuLookRowBodyProps {
|
|
174
|
-
|
|
337
|
+
interface MenuLookCheckboxItemProps extends CheckboxProps, MenuLookRowBodyProps, DataAttributes {
|
|
338
|
+
}
|
|
339
|
+
type RadioProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>, "className" | "children" | "asChild">;
|
|
340
|
+
interface MenuLookRadioItemProps extends RadioProps, Omit<MenuLookRowBodyProps, "current">, DataAttributes {
|
|
341
|
+
}
|
|
342
|
+
type LabelPrimitiveProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label>, "className">;
|
|
343
|
+
interface MenuLookLabelProps extends LabelPrimitiveProps {
|
|
344
|
+
/** A muted line under the heading (a menu's header: the record it acts on). */
|
|
345
|
+
description?: React.ReactNode | undefined;
|
|
175
346
|
}
|
|
176
|
-
|
|
177
|
-
|
|
347
|
+
type SeparatorProps = Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>, "className">;
|
|
348
|
+
declare const MenuLookItem: React.ForwardRefExoticComponent<MenuLookItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
349
|
+
/** Holds a submenu: `MenuLookSub` > `MenuLookSubTrigger` + `MenuLookSubContent`. */
|
|
350
|
+
declare const MenuLookSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
351
|
+
declare const MenuLookSubTrigger: React.ForwardRefExoticComponent<MenuLookSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
178
352
|
declare const MenuLookCheckboxItem: React.ForwardRefExoticComponent<MenuLookCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
179
|
-
/** A
|
|
180
|
-
declare const
|
|
181
|
-
|
|
182
|
-
declare const
|
|
183
|
-
|
|
184
|
-
|
|
353
|
+
/** A group of one-of rows (`MenuLookRadioItem`); the host owns `value` / `onValueChange`. */
|
|
354
|
+
declare const MenuLookRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
355
|
+
declare const MenuLookRadioItem: React.ForwardRefExoticComponent<MenuLookRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
356
|
+
declare const MenuLookLabel: React.ForwardRefExoticComponent<MenuLookLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
357
|
+
declare const MenuLookSeparator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
358
|
+
/** The right-click twins of the dropdown rows — identical rows, the Radix context menu underneath. */
|
|
359
|
+
declare const MenuLookContextItem: React.ForwardRefExoticComponent<MenuLookItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
360
|
+
declare const MenuLookContextSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
361
|
+
declare const MenuLookContextSubTrigger: React.ForwardRefExoticComponent<MenuLookSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
362
|
+
declare const MenuLookContextCheckboxItem: React.ForwardRefExoticComponent<MenuLookCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
363
|
+
declare const MenuLookContextRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
364
|
+
declare const MenuLookContextRadioItem: React.ForwardRefExoticComponent<MenuLookRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
365
|
+
declare const MenuLookContextLabel: React.ForwardRefExoticComponent<MenuLookLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
366
|
+
declare const MenuLookContextSeparator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
367
|
+
/**
|
|
368
|
+
* Where a panel sits: `"floating"` draws the menu's own box (border, popover fill, shadow, 280px) — a
|
|
369
|
+
* CSS-toggled menu, or a host whose popover draws nothing; `"sheet"` draws no box (a phone's bottom
|
|
370
|
+
* sheet, or a host popover that is already the box) and gives its rows 44px touch height.
|
|
371
|
+
*/
|
|
372
|
+
type MenuLookPanelSurface = "floating" | "sheet";
|
|
373
|
+
interface MenuLookPanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "style">, PanelLookProps, DataAttributes {
|
|
374
|
+
surface?: MenuLookPanelSurface | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* `"lg"`: below the large breakpoint (1024px) the floating panel fills the width its host gives it —
|
|
377
|
+
* a CSS-toggled menu that becomes a bottom-anchored sheet on a phone (AppShell's account menu).
|
|
378
|
+
*/
|
|
379
|
+
fillBelow?: "lg" | undefined;
|
|
380
|
+
}
|
|
381
|
+
/** The menu's panel as a plain element: its rows are `MenuLookPanel*` parts. Role `menu` by default. */
|
|
382
|
+
declare const MenuLookPanel: React.ForwardRefExoticComponent<MenuLookPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
383
|
+
type PopoverProps = Omit<React.ComponentPropsWithoutRef<typeof PopoverContent>, "className" | "surface" | "width" | "padding" | "sizing">;
|
|
384
|
+
interface MenuLookPopoverContentProps extends PopoverProps, PanelLookProps, DataAttributes {
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* The panel IS the popover: a Radix popover (outside click, Esc, focus return, collision padding)
|
|
388
|
+
* wearing the menu's box — one element, never a popover box around a menu box. Role `menu`.
|
|
389
|
+
*/
|
|
390
|
+
declare const MenuLookPopoverContent: React.ForwardRefExoticComponent<MenuLookPopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
391
|
+
type LinkComponent = React.ElementType;
|
|
392
|
+
interface PanelRowMarks {
|
|
393
|
+
destructive?: boolean | undefined;
|
|
394
|
+
/** Drawn dimmed (a greyed verb whose reason is the row's tooltip); still pressable. */
|
|
395
|
+
dimmed?: boolean | undefined;
|
|
396
|
+
}
|
|
397
|
+
interface MenuLookPanelItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style" | "children" | "type">, MenuLookRowBodyProps, PanelRowMarks, DataAttributes {
|
|
398
|
+
/**
|
|
399
|
+
* A toggle row's state (a tool that is showing): `aria-pressed`, and while on it reads like the
|
|
400
|
+
* current row (medium weight, the check at its end).
|
|
401
|
+
*/
|
|
402
|
+
pressed?: boolean | undefined;
|
|
403
|
+
/** A link: the row is an anchor (or `as`, the host's link component — Next's Link, an app link). */
|
|
404
|
+
href?: string | undefined;
|
|
405
|
+
target?: string | undefined;
|
|
406
|
+
rel?: string | undefined;
|
|
407
|
+
/** The link component for `href` (it receives `href`, `className`, `role`, `onClick`, children). */
|
|
408
|
+
as?: LinkComponent | undefined;
|
|
409
|
+
/** Extra props for the link component (`prefetch={false}`, `aria-current`). */
|
|
410
|
+
linkProps?: Record<string, unknown> | undefined;
|
|
411
|
+
}
|
|
412
|
+
/** A panel row: a button, or a link with `href`. Same row as the dropdown's (`cm-item`). */
|
|
413
|
+
declare const MenuLookPanelItem: React.ForwardRefExoticComponent<MenuLookPanelItemProps & React.RefAttributes<HTMLElement>>;
|
|
414
|
+
interface MenuLookPanelControlRowProps extends Omit<React.HTMLAttributes<HTMLElement>, "className" | "style" | "children">, Pick<MenuLookRowBodyProps, "icon" | "label" | "description">, DataAttributes {
|
|
415
|
+
/** The row's own control at its end: a `Switch`, a `SegmentedControl`, a count. */
|
|
416
|
+
control: React.ReactNode;
|
|
417
|
+
/** `"label"` when the whole row should press its control (a Switch); default `"div"`. */
|
|
418
|
+
as?: "div" | "label" | undefined;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* A row that holds a control instead of being one (Theme: Light | Dark | Device; Standard view with its
|
|
422
|
+
* Switch): the same icon slot, label and left edge as every row, the control at its END, and no hover
|
|
423
|
+
* fill (the control answers the pointer, not the row).
|
|
424
|
+
*/
|
|
425
|
+
declare const MenuLookPanelControlRow: React.ForwardRefExoticComponent<MenuLookPanelControlRowProps & React.RefAttributes<HTMLElement>>;
|
|
426
|
+
interface MenuLookPanelHeaderProps extends DataAttributes {
|
|
427
|
+
/** The 28px mark (an avatar, an organization mark, a colored glyph). */
|
|
428
|
+
mark: React.ReactNode;
|
|
429
|
+
title: React.ReactNode;
|
|
430
|
+
/** One muted line under the title. */
|
|
431
|
+
subtitle?: React.ReactNode | undefined;
|
|
432
|
+
/** The header is a door to its own page. */
|
|
433
|
+
href?: string | undefined;
|
|
434
|
+
as?: LinkComponent | undefined;
|
|
435
|
+
linkProps?: Record<string, unknown> | undefined;
|
|
436
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* The row a panel opens with (Settings, the organization, the person): a 28px mark on the rows' left
|
|
440
|
+
* edge, a title, an optional muted subtitle. With `href` it is a link to its page.
|
|
441
|
+
*/
|
|
442
|
+
declare function MenuLookPanelHeader({ mark, title, subtitle, href, as, linkProps, onClick, ...data }: MenuLookPanelHeaderProps): React.ReactElement;
|
|
443
|
+
interface MenuLookPanelDisclosureProps extends Pick<MenuLookRowBodyProps, "icon" | "label">, DataAttributes {
|
|
444
|
+
/** Omitted with `pending`: the group's rows are still on their way. */
|
|
445
|
+
children?: React.ReactNode;
|
|
446
|
+
/**
|
|
447
|
+
* The group's row while its rows load (a lazy chunk): the same row and chevron, inert and hidden
|
|
448
|
+
* from assistive tech, so nothing below it moves when the group arrives (no layout shift).
|
|
449
|
+
*/
|
|
450
|
+
pending?: boolean | undefined;
|
|
451
|
+
defaultOpen?: boolean | undefined;
|
|
452
|
+
open?: boolean | undefined;
|
|
453
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* A folded group of rows ("Quick Access", "Admin"): a row with a down-chevron at its END that opens
|
|
457
|
+
* the group in place. Closed, its rows are ABSENT (hidden: out of the hit-test tree and the tab order),
|
|
458
|
+
* never clipped-but-live. Open, they sit on the same left edge as every row — no indent.
|
|
459
|
+
*/
|
|
460
|
+
declare function MenuLookPanelDisclosure({ icon, label, children, pending, defaultOpen, open: openProp, onOpenChange, ...data }: MenuLookPanelDisclosureProps): React.ReactElement;
|
|
461
|
+
/** A panel's section heading. */
|
|
462
|
+
declare function MenuLookPanelLabel({ children, ...data }: {
|
|
463
|
+
children: React.ReactNode;
|
|
464
|
+
} & DataAttributes): React.ReactElement;
|
|
465
|
+
/** The line between a panel's sections. */
|
|
466
|
+
declare function MenuLookPanelSeparator(): React.ReactElement;
|
|
467
|
+
interface MenuLookSearchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "className" | "style" | "size" | "type">, DataAttributes {
|
|
185
468
|
}
|
|
186
469
|
/**
|
|
187
470
|
* The menu's search: its own header row (full-bleed, a hairline under it, held at the top while the
|
|
@@ -190,4 +473,4 @@ interface MenuLookSearchProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
190
473
|
*/
|
|
191
474
|
declare const MenuLookSearch: React.ForwardRefExoticComponent<MenuLookSearchProps & React.RefAttributes<HTMLInputElement>>;
|
|
192
475
|
|
|
193
|
-
export { MENU_LOOK, MENU_LOOK_CLASS, MenuLookCheckboxItem, type MenuLookCheckboxItemProps, MenuLookContent, type MenuLookContentProps, type MenuLookDensity, MenuLookIconSlot, MenuLookItem, type MenuLookItemProps, MenuLookLabel, MenuLookRowBody, type MenuLookRowBodyProps, MenuLookSearch, type MenuLookSearchProps, MenuLookSeparator, type MenuLookSize, MenuLookSubContent, type MenuLookSubContentProps, MenuLookSubTrigger, type MenuLookSubTriggerProps, menuLookItemClass };
|
|
476
|
+
export { MENU_LOOK, MENU_LOOK_CLASS, MenuLookCheckboxItem, type MenuLookCheckboxItemProps, MenuLookContent, type MenuLookContentProps, MenuLookContextCheckboxItem, MenuLookContextContent, type MenuLookContextContentProps, MenuLookContextItem, MenuLookContextLabel, MenuLookContextRadioGroup, MenuLookContextRadioItem, MenuLookContextSeparator, MenuLookContextSub, MenuLookContextSubContent, type MenuLookContextSubContentProps, MenuLookContextSubTrigger, type MenuLookDensity, MenuLookIconSlot, MenuLookItem, type MenuLookItemProps, MenuLookLabel, type MenuLookLabelProps, MenuLookPanel, MenuLookPanelControlRow, type MenuLookPanelControlRowProps, MenuLookPanelDisclosure, type MenuLookPanelDisclosureProps, MenuLookPanelHeader, type MenuLookPanelHeaderProps, MenuLookPanelItem, type MenuLookPanelItemProps, MenuLookPanelLabel, type MenuLookPanelProps, MenuLookPanelSeparator, type MenuLookPanelSurface, MenuLookPopoverContent, type MenuLookPopoverContentProps, MenuLookRadioGroup, MenuLookRadioItem, type MenuLookRadioItemProps, MenuLookRowBody, type MenuLookRowBodyProps, MenuLookSearch, type MenuLookSearchProps, MenuLookSeparator, type MenuLookSize, MenuLookSub, MenuLookSubContent, type MenuLookSubContentProps, type MenuLookSubFit, MenuLookSubTrigger, type MenuLookSubTriggerProps, menuLookItemClass };
|
package/dist/menu-look.js
CHANGED
|
@@ -1,143 +1,82 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
MENU_LOOK,
|
|
4
|
+
MENU_LOOK_CLASS,
|
|
5
|
+
MenuLookCheckboxItem,
|
|
6
|
+
MenuLookContent,
|
|
7
|
+
MenuLookContextCheckboxItem,
|
|
8
|
+
MenuLookContextContent,
|
|
9
|
+
MenuLookContextItem,
|
|
10
|
+
MenuLookContextLabel,
|
|
11
|
+
MenuLookContextRadioGroup,
|
|
12
|
+
MenuLookContextRadioItem,
|
|
13
|
+
MenuLookContextSeparator,
|
|
14
|
+
MenuLookContextSub,
|
|
15
|
+
MenuLookContextSubContent,
|
|
16
|
+
MenuLookContextSubTrigger,
|
|
17
|
+
MenuLookIconSlot,
|
|
18
|
+
MenuLookItem,
|
|
19
|
+
MenuLookLabel,
|
|
20
|
+
MenuLookPanel,
|
|
21
|
+
MenuLookPanelControlRow,
|
|
22
|
+
MenuLookPanelDisclosure,
|
|
23
|
+
MenuLookPanelHeader,
|
|
24
|
+
MenuLookPanelItem,
|
|
25
|
+
MenuLookPanelLabel,
|
|
26
|
+
MenuLookPanelSeparator,
|
|
27
|
+
MenuLookPopoverContent,
|
|
28
|
+
MenuLookRadioGroup,
|
|
29
|
+
MenuLookRadioItem,
|
|
30
|
+
MenuLookRowBody,
|
|
31
|
+
MenuLookSearch,
|
|
32
|
+
MenuLookSeparator,
|
|
33
|
+
MenuLookSub,
|
|
34
|
+
MenuLookSubContent,
|
|
35
|
+
MenuLookSubTrigger,
|
|
36
|
+
menuLookItemClass
|
|
37
|
+
} from "./chunk-L5OACQXS.js";
|
|
38
|
+
import "./chunk-HEFTQUJ5.js";
|
|
39
|
+
import "./chunk-OPF265PU.js";
|
|
40
|
+
import "./chunk-X6ZRHJQP.js";
|
|
7
41
|
import "./chunk-BNXNIN2S.js";
|
|
8
42
|
import "./chunk-FXXSZNER.js";
|
|
9
43
|
import "./chunk-DGNHZBJY.js";
|
|
10
44
|
import "./chunk-XIUVUL2Y.js";
|
|
11
|
-
import
|
|
12
|
-
RadixCheckIcon
|
|
13
|
-
} from "./chunk-YCUFQCJW.js";
|
|
45
|
+
import "./chunk-YCUFQCJW.js";
|
|
14
46
|
import "./chunk-IMOOQQOO.js";
|
|
15
47
|
import "./chunk-M6KA5EHN.js";
|
|
16
|
-
|
|
17
|
-
// src/menu-look.tsx
|
|
18
|
-
import * as React from "react";
|
|
19
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
20
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
var MENU_LOOK = {
|
|
22
|
-
width: 280,
|
|
23
|
-
largeWidth: 360,
|
|
24
|
-
rowHeight: 30,
|
|
25
|
-
fontSize: 13,
|
|
26
|
-
lineHeight: 1.25,
|
|
27
|
-
icon: 16,
|
|
28
|
-
rowPaddingY: 4,
|
|
29
|
-
rowPaddingX: 8,
|
|
30
|
-
radius: 10
|
|
31
|
-
};
|
|
32
|
-
var MENU_LOOK_CLASS = {
|
|
33
|
-
panel: "cm-menu",
|
|
34
|
-
item: "cm-item",
|
|
35
|
-
iconSlot: "cm-icon-slot",
|
|
36
|
-
icon: "cm-icon",
|
|
37
|
-
text: "cm-text",
|
|
38
|
-
label: "cm-label",
|
|
39
|
-
hint: "cm-hint",
|
|
40
|
-
current: "cm-current",
|
|
41
|
-
search: "cm-search",
|
|
42
|
-
trail: "cm-trail",
|
|
43
|
-
shortcut: "cm-shortcut",
|
|
44
|
-
divider: "cm-divider",
|
|
45
|
-
sectionLabel: "cm-section-label",
|
|
46
|
-
danger: "cm-danger",
|
|
47
|
-
dimmed: "cm-dimmed"
|
|
48
|
-
};
|
|
49
|
-
function MenuLookIconSlot({ children }) {
|
|
50
|
-
return /* @__PURE__ */ jsx("span", { className: MENU_LOOK_CLASS.iconSlot, children });
|
|
51
|
-
}
|
|
52
|
-
function MenuLookRowBody({ icon, label, description, trail, current }) {
|
|
53
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54
|
-
icon ? /* @__PURE__ */ jsx(MenuLookIconSlot, { children: icon }) : null,
|
|
55
|
-
/* @__PURE__ */ jsxs("span", { className: MENU_LOOK_CLASS.text, children: [
|
|
56
|
-
/* @__PURE__ */ jsx("span", { className: MENU_LOOK_CLASS.label, children: label }),
|
|
57
|
-
description ? /* @__PURE__ */ jsx("span", { className: MENU_LOOK_CLASS.hint, children: description }) : null
|
|
58
|
-
] }),
|
|
59
|
-
trail ? /* @__PURE__ */ jsx("span", { className: MENU_LOOK_CLASS.trail, children: trail }) : null,
|
|
60
|
-
current ? /* @__PURE__ */ jsx(RadixCheckIcon, { className: MENU_LOOK_CLASS.current, "aria-hidden": "true", "data-menu-current-mark": "" }) : null
|
|
61
|
-
] });
|
|
62
|
-
}
|
|
63
|
-
function menuLookItemClass({ destructive, dimmed } = {}) {
|
|
64
|
-
return `${MENU_LOOK_CLASS.item}${destructive ? ` ${MENU_LOOK_CLASS.danger}` : ""}${dimmed ? ` ${MENU_LOOK_CLASS.dimmed}` : ""}`;
|
|
65
|
-
}
|
|
66
|
-
var MenuLookContent = React.forwardRef(function MenuLookContent2({ size = "standard", density = "comfortable", ...props }, ref) {
|
|
67
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
-
DropdownMenuContent,
|
|
69
|
-
{
|
|
70
|
-
ref,
|
|
71
|
-
surface: "solid",
|
|
72
|
-
"data-menu-look": "",
|
|
73
|
-
"data-size": size,
|
|
74
|
-
"data-density": density,
|
|
75
|
-
...props,
|
|
76
|
-
className: MENU_LOOK_CLASS.panel
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
});
|
|
80
|
-
var MenuLookSubContent = React.forwardRef(function MenuLookSubContent2({ size = "standard", density = "comfortable", ...props }, ref) {
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
-
DropdownMenuSubContent,
|
|
83
|
-
{
|
|
84
|
-
ref,
|
|
85
|
-
surface: "solid",
|
|
86
|
-
"data-menu-look": "",
|
|
87
|
-
"data-size": size,
|
|
88
|
-
"data-density": density,
|
|
89
|
-
...props,
|
|
90
|
-
className: MENU_LOOK_CLASS.panel
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
});
|
|
94
|
-
var MenuLookItem = React.forwardRef(function MenuLookItem2({ icon, label, description, trail, current, destructive, dimmed, href, target, linkProps, ...props }, ref) {
|
|
95
|
-
const className = menuLookItemClass({ destructive, dimmed });
|
|
96
|
-
const body = /* @__PURE__ */ jsx(MenuLookRowBody, { icon, label, description, trail, current });
|
|
97
|
-
const mark = current ? { "data-current": "" } : {};
|
|
98
|
-
if (href) {
|
|
99
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, { ref, asChild: true, ...props, ...mark, className, children: /* @__PURE__ */ jsx("a", { href, target, rel: target === "_blank" ? "noopener noreferrer" : void 0, ...linkProps, children: body }) });
|
|
100
|
-
}
|
|
101
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, { ref, ...props, ...mark, className, children: body });
|
|
102
|
-
});
|
|
103
|
-
var MenuLookSubTrigger = React.forwardRef(function MenuLookSubTrigger2({ icon, label, description, trail, ...props }, ref) {
|
|
104
|
-
return /* @__PURE__ */ jsx(DropdownMenuSubTrigger, { ref, ...props, className: MENU_LOOK_CLASS.item, children: /* @__PURE__ */ jsx(MenuLookRowBody, { icon, label, description, trail }) });
|
|
105
|
-
});
|
|
106
|
-
var MenuLookCheckboxItem = React.forwardRef(function MenuLookCheckboxItem2({ icon, label, description, trail, checked, ...props }, ref) {
|
|
107
|
-
const on = checked === true;
|
|
108
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.CheckboxItem, { ref, ...checked === void 0 ? {} : { checked }, ...props, className: MENU_LOOK_CLASS.item, children: /* @__PURE__ */ jsx(MenuLookRowBody, { icon: on ? /* @__PURE__ */ jsx(RadixCheckIcon, { className: MENU_LOOK_CLASS.icon }) : icon ?? /* @__PURE__ */ jsx("span", { className: MENU_LOOK_CLASS.icon, "aria-hidden": "true" }), label, description, trail }) });
|
|
109
|
-
});
|
|
110
|
-
var MenuLookLabel = React.forwardRef(function MenuLookLabel2(props, ref) {
|
|
111
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, { ref, ...props, className: MENU_LOOK_CLASS.sectionLabel });
|
|
112
|
-
});
|
|
113
|
-
var MenuLookSeparator = React.forwardRef(function MenuLookSeparator2(props, ref) {
|
|
114
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, { ref, ...props, className: MENU_LOOK_CLASS.divider });
|
|
115
|
-
});
|
|
116
|
-
var MenuLookSearch = React.forwardRef(function MenuLookSearch2({ placeholder = "Search", ...props }, ref) {
|
|
117
|
-
return /* @__PURE__ */ jsx("div", { className: MENU_LOOK_CLASS.search, "data-menu-look-search": "", children: /* @__PURE__ */ jsx(
|
|
118
|
-
"input",
|
|
119
|
-
{
|
|
120
|
-
ref,
|
|
121
|
-
type: "search",
|
|
122
|
-
autoComplete: "off",
|
|
123
|
-
spellCheck: false,
|
|
124
|
-
placeholder,
|
|
125
|
-
"aria-label": props["aria-label"] ?? placeholder,
|
|
126
|
-
...props
|
|
127
|
-
}
|
|
128
|
-
) });
|
|
129
|
-
});
|
|
130
48
|
export {
|
|
131
49
|
MENU_LOOK,
|
|
132
50
|
MENU_LOOK_CLASS,
|
|
133
51
|
MenuLookCheckboxItem,
|
|
134
52
|
MenuLookContent,
|
|
53
|
+
MenuLookContextCheckboxItem,
|
|
54
|
+
MenuLookContextContent,
|
|
55
|
+
MenuLookContextItem,
|
|
56
|
+
MenuLookContextLabel,
|
|
57
|
+
MenuLookContextRadioGroup,
|
|
58
|
+
MenuLookContextRadioItem,
|
|
59
|
+
MenuLookContextSeparator,
|
|
60
|
+
MenuLookContextSub,
|
|
61
|
+
MenuLookContextSubContent,
|
|
62
|
+
MenuLookContextSubTrigger,
|
|
135
63
|
MenuLookIconSlot,
|
|
136
64
|
MenuLookItem,
|
|
137
65
|
MenuLookLabel,
|
|
66
|
+
MenuLookPanel,
|
|
67
|
+
MenuLookPanelControlRow,
|
|
68
|
+
MenuLookPanelDisclosure,
|
|
69
|
+
MenuLookPanelHeader,
|
|
70
|
+
MenuLookPanelItem,
|
|
71
|
+
MenuLookPanelLabel,
|
|
72
|
+
MenuLookPanelSeparator,
|
|
73
|
+
MenuLookPopoverContent,
|
|
74
|
+
MenuLookRadioGroup,
|
|
75
|
+
MenuLookRadioItem,
|
|
138
76
|
MenuLookRowBody,
|
|
139
77
|
MenuLookSearch,
|
|
140
78
|
MenuLookSeparator,
|
|
79
|
+
MenuLookSub,
|
|
141
80
|
MenuLookSubContent,
|
|
142
81
|
MenuLookSubTrigger,
|
|
143
82
|
menuLookItemClass
|