pixelize-design-library 2.4.2-beta.60 → 2.4.2-beta.61
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 +38 -10
- package/COMPONENT-GOTCHAS.md +41 -4
- package/DESIGN-GUIDE.md +9 -1
- package/dist/Components/NavLauncher/LauncherTabs.d.ts +18 -0
- package/dist/Components/NavLauncher/LauncherTabs.js +64 -0
- package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
- package/dist/Components/NavLauncher/NavLauncher.js +203 -53
- package/dist/Components/NavLauncher/NavLauncherProps.d.ts +23 -4
- package/dist/Components/NavLauncher/NewTabLink.d.ts +2 -2
- package/dist/Components/NavLauncher/NewTabLink.js +7 -3
- package/dist/Components/NavLauncher/launcherParts.d.ts +4 -1
- package/dist/Components/NavLauncher/launcherParts.js +16 -8
- package/dist/Components/NavLauncher/resultNavigation.d.ts +3 -0
- package/dist/Components/NavLauncher/resultNavigation.js +65 -0
- package/dist/Components/NavLauncher/revealStyles.d.ts +1 -1
- package/dist/Components/NavLauncher/revealStyles.js +2 -2
- package/dist/Components/NavigationBar/NavigationBar.js +2 -1
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +1 -0
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +18 -6
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +4 -0
- package/dist/esm/Components/NavLauncher/LauncherTabs.js +58 -0
- package/dist/esm/Components/NavLauncher/NavLauncher.js +204 -54
- package/dist/esm/Components/NavLauncher/NewTabLink.js +4 -3
- package/dist/esm/Components/NavLauncher/launcherParts.js +15 -8
- package/dist/esm/Components/NavLauncher/resultNavigation.js +61 -0
- package/dist/esm/Components/NavLauncher/revealStyles.js +2 -2
- package/dist/esm/Components/NavigationBar/NavigationBar.js +2 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +16 -7
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -24,24 +24,44 @@ next major.
|
|
|
24
24
|
with actions and remote groups, optional suite-apps section below `md`), with `PinToggle`,
|
|
25
25
|
`NewTabLink`, `searchLauncher`, `searchLauncherSections` (sectioned search: modules, then their
|
|
26
26
|
screens, keyword-only hits get a `· keyword` hint) and `flattenScreens`. The pin control is a
|
|
27
|
-
star, shown with the ↗ link on row hover/focus only (always on touch); pinned rail items are tiles. It binds
|
|
27
|
+
star, shown with the ↗ link on row hover/focus only (always on touch); pinned rail items are tiles. It never opens itself or binds a global chord (Cmd/Ctrl+K and `/` only refocus its field while it is open). `LauncherTrigger`
|
|
28
28
|
is the chip (10px radius, 36px, accent ink, one ⌘K hint) that opens an app-owned launcher (`aria-haspopup="dialog"`, `aria-expanded`,
|
|
29
29
|
`aria-keyshortcuts`); `display="icon"` is a 36px icon-only variant for a nav bar's `moreIcon`
|
|
30
30
|
(label is the accessible name, tooltip "Menu (⌘K)"). Types: `NavLauncherProps`, `LauncherScreen`, `LauncherModule`,
|
|
31
31
|
`LauncherSection`, `LauncherSearchItem`, `LauncherLabels` and friends, `LauncherTriggerProps`.
|
|
32
|
-
`NavLauncher` follows canvas `Launcher.dc.html`: stacked sections with "(n)" counts and a
|
|
33
|
-
grid
|
|
34
|
-
1080px (Pinned tiles, Frequently visited, Recent)
|
|
35
|
-
|
|
32
|
+
`NavLauncher` follows canvas `Launcher.dc.html`: from `lg` up, stacked sections with "(n)" counts and a
|
|
33
|
+
1/2/3-column grid beside a "Quick access" rail of `clamp(20rem, 30%, 26rem)` in a panel whose `maxWidth`
|
|
34
|
+
defaults to 1080px (Pinned tiles, Frequently visited, Recent). Below `lg` (phone and tablet) the body is a
|
|
35
|
+
Menu / Quick access / Apps tab bar (labels `tabsLabel`, `tabMenu`, `tabQuickAccess`, `tabApps`; Apps follows
|
|
36
|
+
`appsVisibility`) above one scrolling panel with only the selected panel mounted, rows are 44px, and search
|
|
37
|
+
keeps the stacked results plus rail with no tab bar. The header is the search field (fills the row; 44px at
|
|
38
|
+
`md`+, 40px below, 16px type), a muted live result count (`labels.resultsCount`, with a separate polite
|
|
39
|
+
announcement), optional `headerActions` (an app's own icon button) and close; there is no "Menu" pill and
|
|
40
|
+
`labels.title` names the dialog and the results list. "Pins follow your account" footer; its key hints
|
|
41
|
+
are key caps (arrows, ENTER, ⌘ ENTER / CTRL ENTER, ⌘ + click, P, ESC) and are hidden on touch devices
|
|
42
|
+
(`labels.hintClickNewTab`; the ↗ link's tooltip is `labels.newTabTip`, `NewTabLink` takes `tip`). New optional props `frequentLimit`, `suggestions` (no-results chips), `searchHint`,
|
|
36
43
|
`LauncherModule.isNew`, and labels `quickAccess`, `newBadge`, `screens`, `pinShort`, `footerNote`,
|
|
37
44
|
`suggestionsHint`, `found`, `pinTip`, `unpinTip`. The rail landmark is named "Quick access".
|
|
38
|
-
Keyboard:
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
Keyboard: in the field, the first result is active as soon as there is a query, ↑/↓ follow the
|
|
46
|
+
visual rows of the result grid, → at the end of the text enters the grid and ←/→/Home/End then move
|
|
47
|
+
through results until the query changes, and PageUp/PageDown page; Esc clears the query first and
|
|
48
|
+
closes only when it is empty; Cmd/Ctrl+K and `/` focus the field. In lists ←/→ and ↑/↓ are grid-aware
|
|
49
|
+
(row-major, ↑/↓ cross sections), Home/End/PageUp/PageDown work, `P` pins or unpins the focused item
|
|
50
|
+
(never while typing) and typing anywhere else in the launcher refocuses the field; ArrowUp from the
|
|
51
|
+
first item returns to the search field (or the selected tab) and pinned tiles are a 2-column grid
|
|
52
|
+
(3 in the tablet Quick access tab). The keyboard-active row highlights as a whole (soft fill plus
|
|
41
53
|
one 1px inset ring, at least 3:1), the whole row is the link target (Cmd/middle-click opens a new
|
|
42
54
|
tab), and truncated titles, rail rows, pinned tiles, app names and search rows show a tooltip with
|
|
43
|
-
the full text. New
|
|
44
|
-
|
|
55
|
+
the full text. New label `hintPin`; hint label defaults are lowercase and follow the canvas order.
|
|
56
|
+
`LauncherLabels` gained required keys (`hintClickNewTab`, `newTabTip`, `resultsCount`, `tabsLabel`,
|
|
57
|
+
`tabMenu`, `tabQuickAccess`, `tabApps`): a consumer that types a full `LauncherLabels` object needs
|
|
58
|
+
them, while the `labels` prop (`Partial<LauncherLabels>`) is unaffected. Consumer tests: below `lg`
|
|
59
|
+
the Quick access and Apps sections are behind their tabs, and the dialog's accessible name now comes
|
|
60
|
+
from a visually hidden "Menu" heading.
|
|
61
|
+
- `OrgSwitcher` `display` (`"full"` default | `"avatar"` | `"auto"`) — `"avatar"` is a 36px avatar plus
|
|
62
|
+
chevron trigger whose accessible name is `Switch organization, <name>` with the name in a tooltip;
|
|
63
|
+
`"auto"` is avatar below `md` and full from `md` up. Types `OrgSwitcherProps`, `OrgSwitcherSize` and
|
|
64
|
+
`OrgSwitcherDisplay` are now exported from the package root.
|
|
45
65
|
- `Kbd` / `KbdShortcut` — a key cap and a chord (`mod+k` renders ⌘ K or Ctrl K), in the
|
|
46
66
|
`AppSwitcher` notation. `Search` and `AppSwitcher` render their shortcut hints with `Kbd`.
|
|
47
67
|
- `NavigationBar` `leading` — a slot between the sidebar toggle/back button and the title, outside
|
|
@@ -250,6 +270,12 @@ next major.
|
|
|
250
270
|
|
|
251
271
|
### Fixed
|
|
252
272
|
|
|
273
|
+
- **`NavigationBar` right cluster no longer overflows onto the avatar at phone widths.** The title
|
|
274
|
+
truncates first (overflow-only tooltip when it is a string); the `moreIcon` cluster can shrink, while
|
|
275
|
+
the sidebar toggle, back button and avatar menu never do. (HRMS, beta.60 launcher trigger overflow)
|
|
276
|
+
- **`OrgSwitcher` trigger shrinks and its menu fits the screen.** The full trigger truncates its label
|
|
277
|
+
(avatar and chevron are kept) when its container is short, and the menu panel is capped at
|
|
278
|
+
`100vw - 32px`, so a long org name no longer causes horizontal page scroll on phones.
|
|
253
279
|
- **`NavLauncher` keyboard and link fixes.** Arrow keys, typing and Backspace were dead on rail and
|
|
254
280
|
apps rows while a search was active; Enter could throw when results shrank; Enter during IME
|
|
255
281
|
composition opened a result; removing the focused row (e.g. an app dropped from `apps`) dropped
|
|
@@ -491,6 +517,8 @@ next major.
|
|
|
491
517
|
|
|
492
518
|
Nothing is removed yet — each of these still ships its full implementation.
|
|
493
519
|
|
|
520
|
+
- `NavLauncher` `openShortcutHint` and `LauncherLabels.hintOpenMenu` — no longer rendered (the launcher
|
|
521
|
+
is already open when its footer shows); bind the open chord in the app only.
|
|
494
522
|
- `SelectV2` — use `Select` with `native={false}`; it is already a thin wrapper over it.
|
|
495
523
|
- `SearchSelect`, `SelectSearch` are **no longer `@deprecated`.** Both now say "prefer `Select`
|
|
496
524
|
for new work" instead: `@deprecated` claimed a migration that loses real capabilities
|
package/COMPONENT-GOTCHAS.md
CHANGED
|
@@ -1061,6 +1061,18 @@ reach it.
|
|
|
1061
1061
|
**Apply:** don't depend on `onChange` firing for a repeat pick. There's no supported way to attach
|
|
1062
1062
|
test hooks or a ref to the trigger.
|
|
1063
1063
|
|
|
1064
|
+
### `OrgSwitcher display="full"` still squeezes the navbar title on phones — use `display="auto"`
|
|
1065
|
+
|
|
1066
|
+
Inside a `NavigationBar` `moreIcon` cluster, a full trigger needs about 88px (avatar + chevron) even
|
|
1067
|
+
when its label truncates to nothing, and the title is the first thing to give way. With a long org name
|
|
1068
|
+
the title is invisible on 320-375px bars, and a smaller `maxWidth` does not change that.
|
|
1069
|
+
|
|
1070
|
+
**Apply:** `display="auto"` (avatar + chevron below `md`, full from `md`) or `"avatar"`. In avatar mode
|
|
1071
|
+
the accessible name is `${ariaLabel}, ${org name}` and the name appears in a tooltip that wraps a
|
|
1072
|
+
`span` around the trigger, so don't pass the trigger a ref. `auto` falls back to `"full"` where
|
|
1073
|
+
`matchMedia` is missing (SSR, jsdom). `NavigationBar`'s `moreIcon` root is `min-width: 0`: give your
|
|
1074
|
+
own icon buttons `flexShrink={0}` and let any label truncate.
|
|
1075
|
+
|
|
1064
1076
|
### `UpgradeButton`'s gold icon accent silently falls back to the label color on low contrast
|
|
1065
1077
|
|
|
1066
1078
|
The gold accent is only used when it clears AA contrast against both gradient stops; a custom
|
|
@@ -1270,7 +1282,8 @@ Each mounted `Search` registers its own `window` Ctrl+K listener, so two on one
|
|
|
1270
1282
|
keypress. **Apply:** pass `shortcut={false}` on all but one. `showShortcutHint={false}` only hides
|
|
1271
1283
|
the hint; the listener stays.
|
|
1272
1284
|
|
|
1273
|
-
The same applies to a launcher: `NavLauncher` and `LauncherTrigger` bind no chord
|
|
1285
|
+
The same applies to a launcher: `NavLauncher` and `LauncherTrigger` bind no chord to *open* (once open,
|
|
1286
|
+
the launcher uses Cmd/Ctrl+K and `/` only to refocus its own field), and the library
|
|
1274
1287
|
reserves `mod+k` for the app's own palette. The app must pass `shortcut={false}` on every page
|
|
1275
1288
|
`Search`, or claim the chord in capture phase (`keydown` on `window` with `capture: true`) before
|
|
1276
1289
|
the `Search` listeners see it — otherwise the first mounted `Search` takes Ctrl+K.
|
|
@@ -1288,12 +1301,36 @@ the `Search` listeners see it — otherwise the first mounted `Search` takes Ctr
|
|
|
1288
1301
|
anchor is an `aria-hidden`, `tabIndex={-1}` overlay (so copy-link and mod-click work) and pin / ↗
|
|
1289
1302
|
are `aria-hidden` siblings. Screen readers use Enter / mod+Enter. Do not nest links inside the
|
|
1290
1303
|
option — axe `nested-interactive` fails.
|
|
1291
|
-
- **The apps section decides "compact" with `matchMedia("(min-width: 48em)")
|
|
1292
|
-
|
|
1293
|
-
|
|
1304
|
+
- **The apps section decides "compact" with `matchMedia("(min-width: 48em)")`, the layout with
|
|
1305
|
+
`(min-width: 62em)`** (`lg`). Both fall back to desktop (apps hidden, two panes) where `matchMedia`
|
|
1306
|
+
is missing (SSR, jsdom), so tests must stub both to see the apps section or the tab bar.
|
|
1307
|
+
- **Below `lg` only the selected tab's panel is mounted.** Pinned / Frequently visited / Recent
|
|
1308
|
+
(Quick access tab) and the apps list (Apps tab) are not in the DOM until their tab is clicked; the
|
|
1309
|
+
Quick access tab is omitted when it would be empty, and a single remaining tab hides the bar. The
|
|
1310
|
+
search view is different: no tab bar, stacked results plus the Quick access rail. A phone or tablet
|
|
1311
|
+
consumer test that looks for an app or a pin must click the tab first.
|
|
1312
|
+
- **`P` on a focused NavLauncher row pins it.** Any other printable key pressed on a row, tab or
|
|
1313
|
+
button (not Space, no modifier) is appended to the query and focuses the field; in the field `P`
|
|
1314
|
+
types the letter.
|
|
1315
|
+
- **Esc is handled by the launcher, not the Drawer** (`closeOnEsc` is off): it clears a non-empty
|
|
1316
|
+
query and keeps focus in the field, and closes only when the query is empty. The keydown is stopped inside
|
|
1317
|
+
the launcher, so a consumer `Escape` listener on `document` never sees it.
|
|
1318
|
+
- **`headerActions` text joins the dialog's accessible name** (header content becomes part of it,
|
|
1319
|
+
as the search value already does: "Menu leave"). Use icon-only buttons with an `aria-label`.
|
|
1320
|
+
- **The result count is `aria-hidden`; the announcement is a separate visually hidden `aria-live="polite"`
|
|
1321
|
+
node, deliberately not `role="status"`**, so `getByRole("status")` still matches only the no-results
|
|
1322
|
+
message and the loading skeleton.
|
|
1323
|
+
- **Left/Right/Home/End in the search field edit the caret** until a result has been navigated by
|
|
1324
|
+
arrow/Page keys (→ at the end of the text enters the grid); any change to the query hands them back
|
|
1325
|
+
to the caret. Do not "fix" this by binding them to results.
|
|
1294
1326
|
- **`NavLauncher` `suggestions` empty falls back to `noResultsHint`** instead of showing chips.
|
|
1295
1327
|
- **`PinToggle` / `NewTabLink` are opacity 0 until row hover or focus-within**, so a consumer's own row must carry `data-group` (or `role="group"`) to reveal them.
|
|
1296
1328
|
- **`LauncherLabels.screensGroup` is unused** by search now (sections replaced the flat group); kept so label objects still type-check.
|
|
1329
|
+
- **`LauncherLabels` gained required keys** (`hintClickNewTab`, `newTabTip`, `resultsCount`, `tabsLabel`,
|
|
1330
|
+
`tabMenu`, `tabQuickAccess`, `tabApps`). The `labels` prop is `Partial<LauncherLabels>` and is fine;
|
|
1331
|
+
a consumer that annotates a *full* `LauncherLabels` object fails to compile.
|
|
1332
|
+
- **`openShortcutHint` and `labels.hintOpenMenu` are deprecated no-ops:** the open chord is no longer
|
|
1333
|
+
shown in the footer. Drop them; the footer's hints are arrows, ENTER, ⌘ ENTER, ⌘ + click, P, ESC.
|
|
1297
1334
|
- **`apps` is data-driven.** Gate by plan by changing the array or setting `locked` / `lockedReason`;
|
|
1298
1335
|
keep `id`s stable (hues and `key` derive from them), and pass `color` on an app whose mark must not
|
|
1299
1336
|
shift when siblings are added or removed. Locked rows are not links, not focusable, `aria-disabled`,
|
package/DESIGN-GUIDE.md
CHANGED
|
@@ -180,12 +180,20 @@ scrim `Box`. `Loading` is the older API and stays on the heavier house scrim by
|
|
|
180
180
|
unknown, `linkAs` for the router link, and `extraResults` + `isSearching` for remote (entity) results.
|
|
181
181
|
- Open the launcher with `<NavigationBar leading={<LauncherTrigger onClick isOpen />} />` — never inside
|
|
182
182
|
`navigationBarText.text`. Neither component binds the chord: the app owns the `mod+k` listener
|
|
183
|
-
(capture phase) and passes `shortcut={false}` to any page `Search`.
|
|
183
|
+
(capture phase) and passes `shortcut={false}` to any page `Search`. Bind it to *open* the launcher only:
|
|
184
|
+
once open, the launcher refocuses its own field on Cmd/Ctrl+K and `/`, and shows no open-chord hint
|
|
185
|
+
(`openShortcutHint` is deprecated).
|
|
184
186
|
- Pins live in the app (server or local). Pass them to `NavLauncher` (`pinnedIds`, `onTogglePin`) *and*
|
|
185
187
|
to `SideBar pinnedItems` + `onUnpin` so the rail shows what the launcher pinned. Persist collapse with
|
|
186
188
|
`useSidebarPrefs`, and pass `autoCollapse={false}` if the app, not the rail, decides.
|
|
187
189
|
- Replacing a 9-dot app switcher in a nav bar: `<LauncherTrigger display="icon" />` (36px) in `moreIcon`;
|
|
188
190
|
keep the chip variant (`leading`) where there is room.
|
|
191
|
+
- In a phone-width app bar use `<OrgSwitcher display="auto" />` (avatar below `md`) next to the bell,
|
|
192
|
+
`LauncherTrigger display="icon"` and the avatar menu; keep every icon control 36px or less and
|
|
193
|
+
`flexShrink={0}`. The title truncates first.
|
|
194
|
+
- Below `lg` the launcher is a Menu / Quick access / Apps tab bar over one panel (search stays a single
|
|
195
|
+
stacked list), so design for phone and tablet with that structure, not a long scroll. Pass
|
|
196
|
+
`headerActions` for the app's own icon button (help, customise) with an `aria-label`.
|
|
189
197
|
- Show the suite's apps with `appsVisibility="always"` and drive plan gating by editing `apps` /
|
|
190
198
|
`locked`.
|
|
191
199
|
- Show shortcut hints with `KbdShortcut`, never a hand-styled `<kbd>`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type LauncherTabId = "menu" | "quick" | "apps";
|
|
2
|
+
export type LauncherTabItem = {
|
|
3
|
+
id: LauncherTabId;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
type LauncherTabsProps = {
|
|
7
|
+
tabs: readonly LauncherTabItem[];
|
|
8
|
+
selected: LauncherTabId;
|
|
9
|
+
onSelect: (id: LauncherTabId) => void;
|
|
10
|
+
idBase: string;
|
|
11
|
+
label: string;
|
|
12
|
+
onLeaveUp: () => void;
|
|
13
|
+
onLeaveDown: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const tabId: (base: string, id: LauncherTabId) => string;
|
|
16
|
+
export declare const panelId: (base: string) => string;
|
|
17
|
+
export declare function LauncherTabs({ tabs, selected, onSelect, idBase, label, onLeaveUp, onLeaveDown, }: LauncherTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.panelId = exports.tabId = void 0;
|
|
4
|
+
exports.LauncherTabs = LauncherTabs;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("@chakra-ui/react");
|
|
7
|
+
const react_2 = require("react");
|
|
8
|
+
const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
|
|
9
|
+
const motion_1 = require("../../Theme/tokens/primitives/motion");
|
|
10
|
+
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
|
+
const tabId = (base, id) => `${base}-tab-${id}`;
|
|
12
|
+
exports.tabId = tabId;
|
|
13
|
+
const panelId = (base) => `${base}-panel`;
|
|
14
|
+
exports.panelId = panelId;
|
|
15
|
+
function LauncherTabs({ tabs, selected, onSelect, idBase, label, onLeaveUp, onLeaveDown, }) {
|
|
16
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
17
|
+
const refs = (0, react_2.useRef)(new Map());
|
|
18
|
+
const ring = (0, focusRing_styles_1.focusVisibleStyles)(colors);
|
|
19
|
+
const choose = (index) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const next = tabs[(index + tabs.length) % tabs.length];
|
|
22
|
+
onSelect(next.id);
|
|
23
|
+
(_a = refs.current.get(next.id)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
24
|
+
};
|
|
25
|
+
const onKeyDown = (event) => {
|
|
26
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
27
|
+
return;
|
|
28
|
+
const current = tabs.findIndex((tab) => tab.id === selected);
|
|
29
|
+
const handlers = {
|
|
30
|
+
ArrowRight: () => choose(current + 1),
|
|
31
|
+
ArrowLeft: () => choose(current - 1),
|
|
32
|
+
Home: () => choose(0),
|
|
33
|
+
End: () => choose(tabs.length - 1),
|
|
34
|
+
ArrowUp: onLeaveUp,
|
|
35
|
+
ArrowDown: onLeaveDown,
|
|
36
|
+
};
|
|
37
|
+
const handle = handlers[event.key];
|
|
38
|
+
if (!handle)
|
|
39
|
+
return;
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
handle();
|
|
43
|
+
};
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { role: "tablist", "aria-label": label, "aria-orientation": "horizontal", flexShrink: 0, px: { base: "10px", md: "16px" }, gap: { base: 0, md: "4px" }, borderBottomWidth: "1px", borderColor: colors.boxborder[200], bg: colors.surfaceRaised, onKeyDown: onKeyDown, children: tabs.map((tab) => {
|
|
45
|
+
const isSelected = tab.id === selected;
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "button", type: "button", role: "tab", id: (0, exports.tabId)(idBase, tab.id), ref: (node) => {
|
|
47
|
+
if (node)
|
|
48
|
+
refs.current.set(tab.id, node);
|
|
49
|
+
else
|
|
50
|
+
refs.current.delete(tab.id);
|
|
51
|
+
}, "aria-selected": isSelected, "aria-controls": isSelected ? (0, exports.panelId)(idBase) : undefined, tabIndex: isSelected ? 0 : -1, onClick: () => onSelect(tab.id), position: "relative", flex: { base: 1, md: "none" }, minW: { md: "112px" }, h: "46px", px: { base: "6px", md: "14px" }, whiteSpace: "nowrap", fontSize: "14px", fontWeight: isSelected ? 600 : 500, color: isSelected ? colors.accentText : colors.textMuted, transition: (0, motion_1.transitionFor)(["color"]), _hover: {
|
|
52
|
+
color: isSelected ? colors.accentText : colors.text[900],
|
|
53
|
+
}, _after: {
|
|
54
|
+
content: '""',
|
|
55
|
+
position: "absolute",
|
|
56
|
+
left: "10px",
|
|
57
|
+
right: "10px",
|
|
58
|
+
bottom: "-1px",
|
|
59
|
+
h: "2px",
|
|
60
|
+
borderRadius: "2px 2px 0 0",
|
|
61
|
+
bg: isSelected ? colors.primary[500] : "transparent",
|
|
62
|
+
}, sx: { ...ring, borderRadius: "8px" }, children: tab.label }, tab.id));
|
|
63
|
+
}) }));
|
|
64
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { NavLauncherProps } from "./NavLauncherProps";
|
|
2
2
|
/** Left-drawer navigation launcher: browse every module, pins, Frequent, Recent, search and (compact) the suite's apps. */
|
|
3
|
-
export default function NavLauncher({ isOpen, onClose, sections: rawSections, pinnedIds, frequentIds, recentIds, onTogglePin, onNavigate, linkAs, actions, extraResults, query: controlledQuery, onQueryChange, isSearching, isLoading, keyScreenLimit, frequentLimit, suggestions, searchHint,
|
|
3
|
+
export default function NavLauncher({ isOpen, onClose, sections: rawSections, pinnedIds, frequentIds, recentIds, onTogglePin, onNavigate, linkAs, actions, extraResults, query: controlledQuery, onQueryChange, isSearching, isLoading, keyScreenLimit, frequentLimit, suggestions, searchHint, modKeyLabel, headerActions, maxWidth, labels: labelOverrides, apps, currentAppId, onAppSelect, appsVisibility, "data-testid": testId, }: NavLauncherProps): import("react/jsx-runtime").JSX.Element;
|