pixelize-design-library 2.4.2-beta.59 → 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.
Files changed (157) hide show
  1. package/CHANGELOG.md +110 -13
  2. package/COMPONENT-GOTCHAS.md +159 -21
  3. package/DESIGN-GUIDE.md +26 -7
  4. package/dist/Components/AudioRecorder/AudioRecorder.d.ts +8 -0
  5. package/dist/Components/AudioRecorder/AudioRecorder.js +169 -0
  6. package/dist/Components/AudioRecorder/AudioRecorderProps.d.ts +20 -0
  7. package/dist/Components/AudioRecorder/AudioRecorderProps.js +2 -0
  8. package/dist/Components/BulkSelectionBar/BulkSelectionBar.d.ts +3 -0
  9. package/dist/Components/BulkSelectionBar/BulkSelectionBar.js +43 -0
  10. package/dist/Components/BulkSelectionBar/BulkSelectionBarProps.d.ts +35 -0
  11. package/dist/Components/BulkSelectionBar/BulkSelectionBarProps.js +2 -0
  12. package/dist/Components/BulkSelectionBar/index.d.ts +2 -0
  13. package/dist/Components/BulkSelectionBar/index.js +8 -0
  14. package/dist/Components/CalendarGrid/CalendarGrid.d.ts +3 -0
  15. package/dist/Components/CalendarGrid/CalendarGrid.js +173 -0
  16. package/dist/Components/CalendarGrid/CalendarGridProps.d.ts +54 -0
  17. package/dist/Components/CalendarGrid/CalendarGridProps.js +2 -0
  18. package/dist/Components/CalendarGrid/calendarMath.d.ts +49 -0
  19. package/dist/Components/CalendarGrid/calendarMath.js +178 -0
  20. package/dist/Components/CircularProgress/CircularProgress.d.ts +4 -0
  21. package/dist/Components/CircularProgress/CircularProgress.js +39 -0
  22. package/dist/Components/CircularProgress/CircularProgressProps.d.ts +22 -0
  23. package/dist/Components/CircularProgress/CircularProgressProps.js +2 -0
  24. package/dist/Components/CircularProgress/arc.d.ts +12 -0
  25. package/dist/Components/CircularProgress/arc.js +16 -0
  26. package/dist/Components/Common/fieldStyles.d.ts +1 -0
  27. package/dist/Components/Common/fieldStyles.js +2 -1
  28. package/dist/Components/Drawer/Drawer.d.ts +1 -1
  29. package/dist/Components/Drawer/Drawer.js +4 -2
  30. package/dist/Components/Drawer/DrawerProps.d.ts +3 -1
  31. package/dist/Components/EmptyState/EmptyState.js +2 -1
  32. package/dist/Components/EmptyState/EmptyStateProps.d.ts +2 -2
  33. package/dist/Components/FormDrawer/FormDrawer.d.ts +2 -0
  34. package/dist/Components/FormDrawer/FormDrawer.js +97 -0
  35. package/dist/Components/FormDrawer/FormDrawerProps.d.ts +55 -0
  36. package/dist/Components/FormDrawer/FormDrawerProps.js +2 -0
  37. package/dist/Components/LauncherTrigger/LauncherTrigger.d.ts +1 -1
  38. package/dist/Components/LauncherTrigger/LauncherTrigger.js +8 -1
  39. package/dist/Components/LauncherTrigger/LauncherTriggerProps.d.ts +2 -0
  40. package/dist/Components/Modal/Modal.d.ts +1 -1
  41. package/dist/Components/Modal/Modal.js +4 -2
  42. package/dist/Components/Modal/ModalProps.d.ts +3 -1
  43. package/dist/Components/Modal/warnDroppedSlotChildren.d.ts +2 -0
  44. package/dist/Components/Modal/warnDroppedSlotChildren.js +45 -0
  45. package/dist/Components/NavLauncher/LauncherTabs.d.ts +18 -0
  46. package/dist/Components/NavLauncher/LauncherTabs.js +64 -0
  47. package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
  48. package/dist/Components/NavLauncher/NavLauncher.js +268 -61
  49. package/dist/Components/NavLauncher/NavLauncherProps.d.ts +29 -10
  50. package/dist/Components/NavLauncher/NewTabLink.d.ts +2 -2
  51. package/dist/Components/NavLauncher/NewTabLink.js +7 -3
  52. package/dist/Components/NavLauncher/launcherParts.d.ts +64 -2
  53. package/dist/Components/NavLauncher/launcherParts.js +103 -13
  54. package/dist/Components/NavLauncher/resultNavigation.d.ts +3 -0
  55. package/dist/Components/NavLauncher/resultNavigation.js +65 -0
  56. package/dist/Components/NavLauncher/revealStyles.d.ts +1 -1
  57. package/dist/Components/NavLauncher/revealStyles.js +2 -2
  58. package/dist/Components/NavigationBar/NavigationBar.js +2 -1
  59. package/dist/Components/NavigationBar/NavigationBarProps.d.ts +1 -0
  60. package/dist/Components/OrgSwitcher/OrgSwitcher.js +18 -6
  61. package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +4 -0
  62. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +5 -0
  63. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +1 -1
  64. package/dist/Components/QueryState/QueryStateBoundary.d.ts +2 -2
  65. package/dist/Components/QueryState/QueryStateBoundary.js +9 -3
  66. package/dist/Components/QueryState/QueryStateProps.d.ts +19 -2
  67. package/dist/Components/SectionRail/SectionRail.d.ts +3 -0
  68. package/dist/Components/SectionRail/SectionRail.js +49 -0
  69. package/dist/Components/SectionRail/SectionRailProps.d.ts +23 -0
  70. package/dist/Components/SectionRail/SectionRailProps.js +2 -0
  71. package/dist/Components/SectionRail/index.d.ts +2 -0
  72. package/dist/Components/SectionRail/index.js +8 -0
  73. package/dist/Components/SegmentedControl/SegmentedControl.js +9 -14
  74. package/dist/Components/SegmentedControl/segmentedInk.d.ts +0 -2
  75. package/dist/Components/SegmentedControl/segmentedInk.js +1 -5
  76. package/dist/Components/StatCard/StatCard.d.ts +1 -1
  77. package/dist/Components/StatCard/StatCard.js +6 -2
  78. package/dist/Components/StatCard/StatCardProps.d.ts +3 -0
  79. package/dist/Components/StatusTag/StatusTag.d.ts +4 -0
  80. package/dist/Components/StatusTag/StatusTag.js +24 -0
  81. package/dist/Components/StatusTag/StatusTagProps.d.ts +20 -0
  82. package/dist/Components/StatusTag/StatusTagProps.js +2 -0
  83. package/dist/Components/Table/Table.d.ts +1 -1
  84. package/dist/Components/Table/Table.js +6 -2
  85. package/dist/Components/Table/TableProps.d.ts +20 -0
  86. package/dist/Components/Table/components/TableBody.d.ts +1 -1
  87. package/dist/Components/Table/components/TableBody.js +43 -18
  88. package/dist/Components/Table/components/TableHeader.d.ts +1 -1
  89. package/dist/Components/Table/components/TableHeader.js +7 -5
  90. package/dist/Components/Table/components/rowDetail.d.ts +32 -0
  91. package/dist/Components/Table/components/rowDetail.js +20 -0
  92. package/dist/Components/Table/hooks/useRowExpansion.d.ts +7 -0
  93. package/dist/Components/Table/hooks/useRowExpansion.js +27 -0
  94. package/dist/Components/Tabs/Tabs.d.ts +1 -1
  95. package/dist/Components/Tabs/Tabs.js +15 -2
  96. package/dist/Components/Tabs/TabsProps.d.ts +6 -2
  97. package/dist/Components/Tabs/components/Tab.js +4 -33
  98. package/dist/Components/Tabs/components/TabLinkList.d.ts +7 -0
  99. package/dist/Components/Tabs/components/TabLinkList.js +34 -0
  100. package/dist/Components/Tabs/useTabAppearance.d.ts +17 -0
  101. package/dist/Components/Tabs/useTabAppearance.js +67 -0
  102. package/dist/Components/Tag/Tag.js +11 -1
  103. package/dist/Components/Tag/TagProps.d.ts +4 -0
  104. package/dist/Components/Tag/tagDot.d.ts +3 -0
  105. package/dist/Components/Tag/tagDot.js +21 -0
  106. package/dist/esm/Components/AudioRecorder/AudioRecorder.js +161 -0
  107. package/dist/esm/Components/AudioRecorder/AudioRecorderProps.js +1 -0
  108. package/dist/esm/Components/BulkSelectionBar/BulkSelectionBar.js +38 -0
  109. package/dist/esm/Components/BulkSelectionBar/BulkSelectionBarProps.js +1 -0
  110. package/dist/esm/Components/BulkSelectionBar/index.js +1 -0
  111. package/dist/esm/Components/CalendarGrid/CalendarGrid.js +168 -0
  112. package/dist/esm/Components/CalendarGrid/CalendarGridProps.js +1 -0
  113. package/dist/esm/Components/CalendarGrid/calendarMath.js +155 -0
  114. package/dist/esm/Components/CircularProgress/CircularProgress.js +37 -0
  115. package/dist/esm/Components/CircularProgress/CircularProgressProps.js +1 -0
  116. package/dist/esm/Components/CircularProgress/arc.js +11 -0
  117. package/dist/esm/Components/Common/fieldStyles.js +2 -1
  118. package/dist/esm/Components/Drawer/Drawer.js +4 -2
  119. package/dist/esm/Components/EmptyState/EmptyState.js +2 -1
  120. package/dist/esm/Components/FormDrawer/FormDrawer.js +58 -0
  121. package/dist/esm/Components/FormDrawer/FormDrawerProps.js +1 -0
  122. package/dist/esm/Components/LauncherTrigger/LauncherTrigger.js +5 -1
  123. package/dist/esm/Components/Modal/Modal.js +4 -2
  124. package/dist/esm/Components/Modal/warnDroppedSlotChildren.js +38 -0
  125. package/dist/esm/Components/NavLauncher/LauncherTabs.js +58 -0
  126. package/dist/esm/Components/NavLauncher/NavLauncher.js +270 -63
  127. package/dist/esm/Components/NavLauncher/NewTabLink.js +4 -3
  128. package/dist/esm/Components/NavLauncher/launcherParts.js +98 -14
  129. package/dist/esm/Components/NavLauncher/resultNavigation.js +61 -0
  130. package/dist/esm/Components/NavLauncher/revealStyles.js +2 -2
  131. package/dist/esm/Components/NavigationBar/NavigationBar.js +2 -1
  132. package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +16 -7
  133. package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +5 -0
  134. package/dist/esm/Components/QueryState/QueryStateBoundary.js +10 -4
  135. package/dist/esm/Components/SectionRail/SectionRail.js +44 -0
  136. package/dist/esm/Components/SectionRail/SectionRailProps.js +1 -0
  137. package/dist/esm/Components/SectionRail/index.js +1 -0
  138. package/dist/esm/Components/SegmentedControl/SegmentedControl.js +11 -16
  139. package/dist/esm/Components/SegmentedControl/segmentedInk.js +0 -3
  140. package/dist/esm/Components/StatCard/StatCard.js +6 -2
  141. package/dist/esm/Components/StatusTag/StatusTag.js +19 -0
  142. package/dist/esm/Components/StatusTag/StatusTagProps.js +1 -0
  143. package/dist/esm/Components/Table/Table.js +7 -3
  144. package/dist/esm/Components/Table/components/TableBody.js +43 -18
  145. package/dist/esm/Components/Table/components/TableHeader.js +7 -5
  146. package/dist/esm/Components/Table/components/rowDetail.js +14 -0
  147. package/dist/esm/Components/Table/hooks/useRowExpansion.js +23 -0
  148. package/dist/esm/Components/Tabs/Tabs.js +15 -2
  149. package/dist/esm/Components/Tabs/components/Tab.js +4 -33
  150. package/dist/esm/Components/Tabs/components/TabLinkList.js +29 -0
  151. package/dist/esm/Components/Tabs/useTabAppearance.js +63 -0
  152. package/dist/esm/Components/Tag/Tag.js +12 -2
  153. package/dist/esm/Components/Tag/tagDot.js +17 -0
  154. package/dist/esm/index.js +7 -0
  155. package/dist/index.d.ts +17 -2
  156. package/dist/index.js +18 -4
  157. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { ElementType, KeyboardEvent, MouseEvent } from "react";
1
+ import type { ElementType, KeyboardEvent, MouseEvent, ReactNode } from "react";
2
2
  import type { AppOption } from "../AppSwitcher/AppSwitcherProps";
3
3
  /** Rendered as `<Icon size={16} aria-hidden />`, so any lucide-compatible component works. */
4
4
  export type LauncherIcon = ElementType;
@@ -54,6 +54,7 @@ export type LauncherResultGroup = {
54
54
  };
55
55
  /** Every visible string and accessible name; pass any subset, the rest fall back to English. */
56
56
  export type LauncherLabels = {
57
+ /** Accessible name of the dialog and the results list; no longer drawn as a header pill. */
57
58
  title: string;
58
59
  searchPlaceholder: string;
59
60
  clearSearch: string;
@@ -74,18 +75,32 @@ export type LauncherLabels = {
74
75
  loading: string;
75
76
  /** Heading of the empty state shown when `sections` has nothing to render. */
76
77
  empty: string;
77
- /** Footer hint after the ↑↓←→ key cap. */
78
+ /** Footer hint after the four arrow key caps. */
78
79
  hintMove: string;
79
- /** Footer hint after the ↵ key cap. */
80
+ /** Footer hint after the ENTER key cap. */
80
81
  hintOpen: string;
81
- /** Footer hint after the mod+↵ key cap. */
82
+ /** Footer hint after the mod + ENTER key caps. */
82
83
  hintNewTab: string;
83
84
  /** Footer hint after the P key cap. */
84
85
  hintPin: string;
85
- /** Footer hint after the esc key cap. */
86
+ /** Footer hint after the ESC key cap. */
86
87
  hintClose: string;
87
- /** Footer hint after `openShortcutHint`; only rendered when that prop is set. */
88
+ /** @deprecated No longer rendered: the launcher is already open, so the open chord is not shown. */
88
89
  hintOpenMenu: string;
90
+ /** Footer hint after the mod key cap for a modified click, e.g. "+ click for new tab". */
91
+ hintClickNewTab: string;
92
+ /** Tooltip of the arrow link beside a row. */
93
+ newTabTip: string;
94
+ /** Muted count beside the search field and its polite announcement, e.g. "12 results". */
95
+ resultsCount: (count: number) => string;
96
+ /** Name of the Menu / Quick access / Apps tab list shown below `lg`. */
97
+ tabsLabel: string;
98
+ /** Tab showing every module (below `lg`). */
99
+ tabMenu: string;
100
+ /** Tab showing Pinned, Frequently visited and Recent (below `lg`). */
101
+ tabQuickAccess: string;
102
+ /** Tab showing the suite's apps (below `lg`). */
103
+ tabApps: string;
89
104
  /** Heading and list name of the apps section. */
90
105
  apps: string;
91
106
  /** Per-section count shown while searching, e.g. "3 found". */
@@ -146,11 +161,13 @@ export interface NavLauncherProps {
146
161
  suggestions?: readonly string[];
147
162
  /** Key cap shown at the end of the search field, e.g. "/" when the app opens the launcher with it. */
148
163
  searchHint?: string;
149
- /** Chord that opens the launcher in the host app, e.g. "⌘K or /"; shown as the first footer hint. Omit when the app does not own one. */
164
+ /** @deprecated No longer rendered: the launcher is already open. Cmd/Ctrl+K and "/" now focus the search field while it is open. */
150
165
  openShortcutHint?: string;
151
- /** Printed on the mod+Enter hint; defaults to "⌘" on Apple platforms, "Ctrl" elsewhere. */
166
+ /** Replaces the modifier cap of the mod+Enter hint; defaults to "⌘" on Apple platforms, "Ctrl" elsewhere. */
152
167
  modKeyLabel?: string;
153
- /** Panel width at `lg`+; always full width below `lg`. Defaults to "1180px". */
168
+ /** Rendered between the search field and the close button, e.g. a help or customise icon button; use icon-only buttons so the dialog name stays "Menu". */
169
+ headerActions?: ReactNode;
170
+ /** Panel width at `lg`+; always full width below `lg`. Defaults to "1080px". */
154
171
  maxWidth?: string;
155
172
  labels?: Partial<LauncherLabels>;
156
173
  /** Other Pixelize apps, shown as an "Apps" section at the bottom of the right rail. Same shape as AppSwitcher. */
@@ -179,8 +196,10 @@ export interface PinToggleProps {
179
196
  /** Props for the small "open in new tab" anchor beside a launcher row. */
180
197
  export interface NewTabLinkProps {
181
198
  href: string;
182
- /** Accessible name and tooltip, e.g. "Open Leave in a new tab". */
199
+ /** Accessible name, e.g. "Open Leave in a new tab". */
183
200
  label: string;
201
+ /** Visible tooltip text; defaults to `label`. */
202
+ tip?: string;
184
203
  /** Anchor-like component receiving `href`, `target`, `rel`; defaults to `"a"`. */
185
204
  linkAs?: ElementType;
186
205
  tabIndex?: number;
@@ -1,3 +1,3 @@
1
1
  import type { NewTabLinkProps } from "./NavLauncherProps";
2
- /** "Open in a new tab" anchor; visible on row hover, focus-within or its own focus only. */
3
- export default function NewTabLink({ href, label, linkAs, tabIndex }: NewTabLinkProps): import("react/jsx-runtime").JSX.Element;
2
+ /** "Open in a new tab" anchor with a tooltip; visible on row hover, keyboard-active or focus-within, or its own focus. */
3
+ export default function NewTabLink({ href, label, tip, linkAs, tabIndex, }: NewTabLinkProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.default = NewTabLink;
4
7
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -6,9 +9,10 @@ const react_1 = require("@chakra-ui/react");
6
9
  const lucide_react_1 = require("lucide-react");
7
10
  const motion_1 = require("../../Theme/tokens/primitives/motion");
8
11
  const useCustomTheme_1 = require("../../Theme/useCustomTheme");
12
+ const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
9
13
  const revealStyles_1 = require("./revealStyles");
10
- /** "Open in a new tab" anchor; visible on row hover, focus-within or its own focus only. */
11
- function NewTabLink({ href, label, linkAs = "a", tabIndex }) {
14
+ /** "Open in a new tab" anchor with a tooltip; visible on row hover, keyboard-active or focus-within, or its own focus. */
15
+ function NewTabLink({ href, label, tip, linkAs = "a", tabIndex, }) {
12
16
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
13
- return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: linkAs, href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, title: label, tabIndex: tabIndex, display: "inline-flex", alignItems: "center", justifyContent: "center", w: "22px", h: "22px", flexShrink: 0, borderRadius: "md", color: colors.textMuted, opacity: 0, transition: (0, motion_1.transitionFor)(["opacity", "background-color"]), sx: (0, revealStyles_1.revealStyles)(colors), _hover: { bg: colors.backgroundColor.subtle }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowUpRight, { size: 13, "aria-hidden": true }) }));
17
+ return ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: tip !== null && tip !== void 0 ? tip : label, placement: "bottom", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: linkAs, href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, tabIndex: tabIndex, display: "inline-flex", alignItems: "center", justifyContent: "center", w: "22px", h: "22px", flexShrink: 0, borderRadius: "md", color: colors.textMuted, opacity: 0, transition: (0, motion_1.transitionFor)(["opacity", "background-color"]), sx: (0, revealStyles_1.revealStyles)(colors), _hover: { bg: colors.backgroundColor.subtle }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowUpRight, { size: 13, "aria-hidden": true }) }) }));
14
18
  }
@@ -1,12 +1,73 @@
1
- import { type ElementType, type KeyboardEvent, type MouseEvent, type ReactNode } from "react";
1
+ import { type ElementType, type FocusEvent, type KeyboardEvent, type MouseEvent, type ReactNode } from "react";
2
+ import type { PaletteProps } from "../../Theme/tokens/types";
2
3
  import type { AppOption } from "../AppSwitcher/AppSwitcherProps";
3
4
  import type { LauncherLabels, LauncherModule, LauncherScreen } from "./NavLauncherProps";
4
5
  export declare const ITEM_SELECTOR = "[data-launcher-item]";
6
+ export declare const TouchDensity: import("react").Provider<boolean>;
7
+ export declare const useTouchDensity: () => boolean;
5
8
  export declare const isPlainClick: (event: MouseEvent) => boolean;
6
9
  export type LinkCtx = {
7
10
  linkAs: ElementType;
8
11
  onPlainClick: (event: MouseEvent) => void;
9
12
  };
13
+ export declare const WIDE_ROW = "@container launcher-row (min-width: 300px)";
14
+ export declare const ROW_CONTAINER: {
15
+ containerType: string;
16
+ containerName: string;
17
+ };
18
+ export declare const activeRowStyle: (colors: PaletteProps) => {
19
+ edge: string;
20
+ fill: string;
21
+ };
22
+ export declare const activeRowSurface: (colors: PaletteProps) => {
23
+ backgroundColor: string;
24
+ boxShadow: string;
25
+ outline: string;
26
+ outlineOffset: string;
27
+ };
28
+ export declare const titleInset: (base: number, open: number, chip?: number) => {
29
+ "@container launcher-row (max-width: 219px)": {
30
+ "[data-group]:hover &, [data-group]:focus-within &, [data-group][data-reveal=true] &": {
31
+ "--row-pr": string;
32
+ };
33
+ };
34
+ "@container launcher-row (min-width: 300px)"?: {
35
+ "[data-group][data-reveal=true] &": {
36
+ "--row-pr": string;
37
+ };
38
+ } | undefined;
39
+ paddingRight: string;
40
+ "--row-pr": string;
41
+ "[data-group]:hover &, [data-group]:focus-within &, [data-group][data-reveal=true] &": {
42
+ "--row-pr": string;
43
+ };
44
+ };
45
+ export declare const useRowFocus: (isBordered?: boolean) => {
46
+ sx: {
47
+ "&[data-row-focus]": {
48
+ backgroundColor: string;
49
+ boxShadow: string;
50
+ outline: string;
51
+ outlineOffset: string;
52
+ } | {
53
+ backgroundColor: string;
54
+ borderColor: string;
55
+ };
56
+ };
57
+ primary: {
58
+ onFocus: (event: FocusEvent<HTMLElement>) => boolean | undefined;
59
+ onBlur: (event: FocusEvent<HTMLElement>) => boolean | undefined;
60
+ };
61
+ };
62
+ export declare const stretchedLink: (radius: string) => {
63
+ outline: string;
64
+ _after: {
65
+ content: string;
66
+ position: string;
67
+ inset: number;
68
+ borderRadius: string;
69
+ };
70
+ };
10
71
  export declare const useRowHover: () => {
11
72
  bg: string;
12
73
  _hover: {
@@ -87,7 +148,8 @@ type AppsSectionProps = {
87
148
  hues: readonly string[];
88
149
  currentAppId?: string;
89
150
  heading: string;
151
+ hideHeading?: boolean;
90
152
  onSelect: (app: AppOption, event: MouseEvent | KeyboardEvent) => void;
91
153
  };
92
- export declare function AppsSection({ apps, hues, currentAppId, heading, onSelect, }: AppsSectionProps): import("react/jsx-runtime").JSX.Element;
154
+ export declare function AppsSection({ apps, hues, currentAppId, heading, hideHeading, onSelect, }: AppsSectionProps): import("react/jsx-runtime").JSX.Element;
93
155
  export {};
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useRowHover = exports.isPlainClick = exports.ITEM_SELECTOR = void 0;
6
+ exports.useRowHover = exports.stretchedLink = exports.useRowFocus = exports.titleInset = exports.activeRowSurface = exports.activeRowStyle = exports.ROW_CONTAINER = exports.WIDE_ROW = exports.isPlainClick = exports.useTouchDensity = exports.TouchDensity = exports.ITEM_SELECTOR = void 0;
7
7
  exports.CountBadge = CountBadge;
8
8
  exports.NewTag = NewTag;
9
9
  exports.SectionHeader = SectionHeader;
@@ -22,21 +22,92 @@ const lucide_react_1 = require("lucide-react");
22
22
  const react_2 = require("react");
23
23
  const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
24
24
  const filledSurface_1 = require("../../Theme/tokens/builders/filledSurface");
25
+ const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
25
26
  const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
26
27
  const motion_1 = require("../../Theme/tokens/primitives/motion");
27
28
  const useCustomTheme_1 = require("../../Theme/useCustomTheme");
29
+ const OverflowToolTip_1 = __importDefault(require("../ToolTip/OverflowToolTip"));
28
30
  const AppMark_1 = __importDefault(require("../AppSwitcher/AppMark"));
29
31
  const match_1 = require("./match");
30
32
  const NewTabLink_1 = __importDefault(require("./NewTabLink"));
31
33
  const PinToggle_1 = __importDefault(require("./PinToggle"));
32
34
  const revealStyles_1 = require("./revealStyles");
33
35
  exports.ITEM_SELECTOR = "[data-launcher-item]";
36
+ const TouchDensityContext = (0, react_2.createContext)(false);
37
+ exports.TouchDensity = TouchDensityContext.Provider;
38
+ const useTouchDensity = () => (0, react_2.useContext)(TouchDensityContext);
39
+ exports.useTouchDensity = useTouchDensity;
34
40
  const isPlainClick = (event) => event.button === 0 &&
35
41
  !event.metaKey &&
36
42
  !event.ctrlKey &&
37
43
  !event.shiftKey &&
38
44
  !event.altKey;
39
45
  exports.isPlainClick = isPlainClick;
46
+ const ROW_FOCUS = "data-row-focus";
47
+ const ROW_PR = "--row-pr";
48
+ const REVEALED = "[data-group]:hover &, [data-group]:focus-within &, [data-group][data-reveal=true] &";
49
+ const NARROW_ROW = "@container launcher-row (max-width: 219px)";
50
+ exports.WIDE_ROW = "@container launcher-row (min-width: 300px)";
51
+ exports.ROW_CONTAINER = {
52
+ containerType: "inline-size",
53
+ containerName: "launcher-row",
54
+ };
55
+ const activeRowStyle = (colors) => {
56
+ const fill = (0, rowStates_1.listRowBackgrounds)(colors).active;
57
+ const edge = (0, outlineRung_1.liftToContrast)((0, outlineRung_1.liftToContrast)(colors.primary[500], fill, outlineRung_1.AA_NON_TEXT), colors.surfaceRaised, outlineRung_1.AA_NON_TEXT);
58
+ return { edge, fill };
59
+ };
60
+ exports.activeRowStyle = activeRowStyle;
61
+ const activeRowSurface = (colors) => {
62
+ const { edge, fill } = (0, exports.activeRowStyle)(colors);
63
+ return {
64
+ backgroundColor: fill,
65
+ boxShadow: `inset 0 0 0 1px ${edge}`,
66
+ outline: "2px solid transparent",
67
+ outlineOffset: "-2px",
68
+ };
69
+ };
70
+ exports.activeRowSurface = activeRowSurface;
71
+ const titleInset = (base, open, chip = 0) => ({
72
+ paddingRight: `var(${ROW_PR})`,
73
+ [ROW_PR]: `${base}px`,
74
+ [REVEALED]: { [ROW_PR]: `${open}px` },
75
+ ...(chip
76
+ ? {
77
+ [exports.WIDE_ROW]: {
78
+ "[data-group][data-reveal=true] &": { [ROW_PR]: `${open + chip}px` },
79
+ },
80
+ }
81
+ : {}),
82
+ [NARROW_ROW]: { [REVEALED]: { [ROW_PR]: `${base}px` } },
83
+ });
84
+ exports.titleInset = titleInset;
85
+ const markRowFocus = (event, isOn) => { var _a; return (_a = event.currentTarget.closest("[data-group]")) === null || _a === void 0 ? void 0 : _a.toggleAttribute(ROW_FOCUS, isOn); };
86
+ const useRowFocus = (isBordered = false) => {
87
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
88
+ const { edge, fill } = (0, exports.activeRowStyle)(colors);
89
+ const lit = isBordered
90
+ ? { backgroundColor: fill, borderColor: edge }
91
+ : (0, exports.activeRowSurface)(colors);
92
+ return {
93
+ sx: { [`&[${ROW_FOCUS}]`]: lit },
94
+ primary: {
95
+ onFocus: (event) => markRowFocus(event, event.currentTarget.matches(":focus-visible")),
96
+ onBlur: (event) => markRowFocus(event, false),
97
+ },
98
+ };
99
+ };
100
+ exports.useRowFocus = useRowFocus;
101
+ const stretchedLink = (radius) => ({
102
+ outline: "none",
103
+ _after: {
104
+ content: '""',
105
+ position: "absolute",
106
+ inset: 0,
107
+ borderRadius: radius,
108
+ },
109
+ });
110
+ exports.stretchedLink = stretchedLink;
40
111
  const useRowHover = () => {
41
112
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
42
113
  const hover = (0, rowStates_1.listRowBackgrounds)(colors).active;
@@ -67,10 +138,20 @@ function RowIcon({ icon: Icon, size, stroke = 1.75, mt }) {
67
138
  }
68
139
  function Highlight({ text, query }) {
69
140
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
70
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, match_1.highlightSegments)(text, query).map((segment, i) => segment.isMatch ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "mark", bg: colors.primary.opacity[24], color: "inherit", borderRadius: "3px", px: "1px", children: segment.text }, i)) : ((0, jsx_runtime_1.jsx)(react_2.Fragment, { children: segment.text }, i))) }));
141
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, match_1.highlightSegments)(text, query).map((segment, i) => segment.isMatch ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "mark", bg: "transparent", color: "inherit", fontWeight: 650, textDecoration: "underline", textDecorationColor: colors.primary.opacity[48], textDecorationThickness: "1.5px", textUnderlineOffset: "2px", children: segment.text }, i)) : ((0, jsx_runtime_1.jsx)(react_2.Fragment, { children: segment.text }, i))) }));
71
142
  }
72
143
  function RowActions({ children }) {
73
- return ((0, jsx_runtime_1.jsx)(react_1.Flex, { position: "absolute", top: "7px", right: "4px", h: "19px", align: "center", gap: "2px", zIndex: 1, children: children }));
144
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
145
+ const isTouch = (0, exports.useTouchDensity)();
146
+ const revealed = REVEALED.replace(/ &/g, " > &");
147
+ return ((0, jsx_runtime_1.jsx)(react_1.Flex, { sx: {
148
+ [NARROW_ROW]: {
149
+ [revealed]: {
150
+ backgroundColor: (0, exports.activeRowStyle)(colors).fill,
151
+ borderRadius: "6px",
152
+ },
153
+ },
154
+ }, position: "absolute", top: isTouch ? "12px" : "7px", right: "4px", h: "19px", align: "center", gap: "2px", zIndex: 1, children: children }));
74
155
  }
75
156
  function RowTip({ text }) {
76
157
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
@@ -79,19 +160,23 @@ function RowTip({ text }) {
79
160
  function ModuleRow({ module, keyScreens, isPinned, onTogglePin, pinId, labels, link, }) {
80
161
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
81
162
  const hover = (0, exports.useRowHover)();
163
+ const focus = (0, exports.useRowFocus)();
82
164
  const ring = (0, focusRing_styles_1.focusVisibleStyles)(colors);
165
+ const isTouch = (0, exports.useTouchDensity)();
83
166
  const base = typeof module.badge === "number" || module.badge ? 24 : 0;
84
167
  const open = base + (onTogglePin ? 46 : 24);
85
- return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "flex-start", gap: "10px", minH: "34px", pl: "8px", pr: "4px", pt: "7px", pb: "5px", borderRadius: "8px", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: hover._hover, _focusWithin: hover._focusWithin, children: [(0, jsx_runtime_1.jsx)(RowIcon, { icon: module.icon, size: 16, mt: "2px" }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "6px", h: "19px", minW: 0, pr: `${base}px`, _groupHover: { pr: `${open}px` }, _groupFocusWithin: { pr: `${open}px` }, children: [(0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: module.href, "data-launcher-item": true, "data-pin-id": onTogglePin ? pinId : undefined, title: module.label, onClick: link.onPlainClick, minW: 0, fontSize: "13.5px", fontWeight: 500, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: ring, children: module.label }), module.isNew ? (0, jsx_runtime_1.jsx)(NewTag, { label: labels.newBadge }) : null] }), keyScreens.length ? ((0, jsx_runtime_1.jsx)(react_1.Box, { role: "group", "aria-label": `${module.label} ${labels.screens}`, fontSize: "11.5px", lineHeight: "15px", color: colors.textMuted, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: keyScreens.map((screen, i) => ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [i > 0 ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "aria-hidden": true, mx: "5px", opacity: 0.7, children: "\u00B7" })) : null, (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, title: `${screen.label} — ${module.label}`, onClick: link.onPlainClick, color: "inherit", borderRadius: "sm", _hover: {
86
- textDecoration: "underline",
87
- textUnderlineOffset: "2px",
88
- }, sx: ring, children: screen.label })] }, screen.id))) })) : null] }), (0, jsx_runtime_1.jsxs)(RowActions, { children: [(0, jsx_runtime_1.jsx)(CountBadge, { value: module.badge }), onTogglePin ? ((0, jsx_runtime_1.jsx)(PinToggle_1.default, { isPinned: isPinned, label: isPinned ? labels.unpin(module.label) : labels.pin(module.label), title: "", onToggle: onTogglePin })) : null, (0, jsx_runtime_1.jsx)(NewTabLink_1.default, { href: module.href, label: labels.openInNewTab(module.label), linkAs: link.linkAs })] }), onTogglePin ? ((0, jsx_runtime_1.jsx)(RowTip, { text: isPinned ? labels.unpinTip : labels.pinTip })) : null] }));
168
+ return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "flex-start", gap: "10px", minH: isTouch ? "44px" : "34px", pl: "8px", pr: "4px", pt: isTouch ? "12px" : "7px", pb: isTouch ? "8px" : "5px", borderRadius: "8px", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: hover._hover, _focusWithin: hover._focusWithin, sx: { ...focus.sx, ...exports.ROW_CONTAINER }, children: [(0, jsx_runtime_1.jsx)(RowIcon, { icon: module.icon, size: 16, mt: "2px" }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "6px", h: "19px", minW: 0, sx: (0, exports.titleInset)(base, open), children: [(0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: module.label, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: module.href, "data-launcher-item": true, ...focus.primary, "data-pin-id": onTogglePin ? pinId : undefined, onClick: link.onPlainClick, minW: 0, fontSize: "13.5px", fontWeight: 500, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, exports.stretchedLink)("8px"), children: module.label }) }), module.isNew ? (0, jsx_runtime_1.jsx)(NewTag, { label: labels.newBadge }) : null] }), keyScreens.length ? ((0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: keyScreens.map((screen) => screen.label).join(" · "), placement: "bottom-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { role: "group", "aria-label": `${module.label} ${labels.screens}`, position: "relative", zIndex: 1, w: "fit-content", maxW: "100%", fontSize: "11.5px", lineHeight: "15px", color: colors.textMuted, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: keyScreens.map((screen, i) => ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [i > 0 ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "aria-hidden": true, mx: "5px", opacity: 0.7, children: "\u00B7" })) : null, (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, onClick: link.onPlainClick, color: "inherit", borderRadius: "sm", position: "relative", zIndex: 1, _hover: {
169
+ textDecoration: "underline",
170
+ textUnderlineOffset: "2px",
171
+ }, sx: ring, children: screen.label })] }, screen.id))) }) })) : null] }), (0, jsx_runtime_1.jsxs)(RowActions, { children: [(0, jsx_runtime_1.jsx)(CountBadge, { value: module.badge }), onTogglePin ? ((0, jsx_runtime_1.jsx)(PinToggle_1.default, { isPinned: isPinned, label: isPinned ? labels.unpin(module.label) : labels.pin(module.label), title: "", onToggle: onTogglePin })) : null, (0, jsx_runtime_1.jsx)(NewTabLink_1.default, { href: module.href, label: labels.openInNewTab(module.label), tip: labels.newTabTip, linkAs: link.linkAs })] }), onTogglePin ? ((0, jsx_runtime_1.jsx)(RowTip, { text: isPinned ? labels.unpinTip : labels.pinTip })) : null] }));
89
172
  }
90
173
  function RailRow({ screen, module, link, isStrong = false, trailing, pinId, }) {
91
174
  var _a;
92
175
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
93
176
  const hover = (0, exports.useRowHover)();
94
- return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, align: "center", gap: "10px", h: "32px", pl: "8px", pr: "4px", borderRadius: "8px", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: hover._hover, _focusWithin: hover._focusWithin, children: [(0, jsx_runtime_1.jsx)(RowIcon, { icon: (_a = screen.icon) !== null && _a !== void 0 ? _a : module.icon, size: 15 }), (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, "data-pin-id": pinId, onClick: link.onPlainClick, flex: 1, minW: 0, fontSize: "13px", fontWeight: isStrong ? 500 : 400, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, focusRing_styles_1.focusVisibleStyles)(colors), children: screen.label }), trailing] }));
177
+ const focus = (0, exports.useRowFocus)();
178
+ const isTouch = (0, exports.useTouchDensity)();
179
+ return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, position: "relative", align: "center", gap: "10px", h: isTouch ? "44px" : "32px", pl: "8px", pr: "4px", borderRadius: "8px", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: hover._hover, _focusWithin: hover._focusWithin, sx: focus.sx, children: [(0, jsx_runtime_1.jsx)(RowIcon, { icon: (_a = screen.icon) !== null && _a !== void 0 ? _a : module.icon, size: 15 }), (0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: screen.label, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, ...focus.primary, "data-pin-id": pinId, onClick: link.onPlainClick, flex: 1, minW: 0, fontSize: "13px", fontWeight: isStrong ? 500 : 400, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, exports.stretchedLink)("8px"), children: screen.label }) }), (0, jsx_runtime_1.jsx)(react_1.Flex, { position: "relative", zIndex: 1, align: "center", gap: "2px", children: trailing })] }));
95
180
  }
96
181
  function PinTextButton({ label, text, onToggle }) {
97
182
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
@@ -105,13 +190,15 @@ function PinnedTile({ screen, module, link, labels, onTogglePin, }) {
105
190
  var _a;
106
191
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
107
192
  const Icon = (_a = screen.icon) !== null && _a !== void 0 ? _a : module.icon;
108
- return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, align: "center", gap: "8px", h: "36px", pl: "9px", pr: "4px", borderRadius: "9px", borderWidth: "1px", borderColor: colors.boxborder[200], bg: colors.surfaceRaised, title: screen.label, transition: (0, motion_1.transitionFor)(["border-color"]), _hover: { borderColor: colors.gray[300] }, children: [Icon ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", display: "inline-flex", flexShrink: 0, color: colors.accentText, children: (0, jsx_runtime_1.jsx)(Icon, { size: 15, strokeWidth: 1.8, "aria-hidden": true }) })) : null, (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, "data-pin-id": onTogglePin ? screen.id : undefined, onClick: link.onPlainClick, flex: 1, minW: 0, fontSize: "13px", fontWeight: 500, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, focusRing_styles_1.focusVisibleStyles)(colors), children: screen.label }), (0, jsx_runtime_1.jsx)(CountBadge, { value: screen.badge, size: "tile" }), onTogglePin ? ((0, jsx_runtime_1.jsx)(react_1.Box, { flexShrink: 0, w: "0", overflow: "hidden", transition: (0, motion_1.transitionFor)(["width"]), _groupHover: { w: "22px" }, _groupFocusWithin: { w: "22px" }, children: (0, jsx_runtime_1.jsx)(PinToggle_1.default, { isPinned: true, size: 12, label: labels.unpin(screen.label), title: labels.unpinTip, onToggle: onTogglePin }) })) : null] }));
193
+ const focus = (0, exports.useRowFocus)(true);
194
+ const isTouch = (0, exports.useTouchDensity)();
195
+ return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "center", gap: "8px", h: isTouch ? "44px" : "36px", pl: "9px", pr: "4px", borderRadius: "9px", borderWidth: "1px", borderColor: colors.boxborder[200], bg: colors.surfaceRaised, transition: (0, motion_1.transitionFor)(["border-color", "background-color"]), _hover: { borderColor: colors.gray[300] }, sx: focus.sx, children: [Icon ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", display: "inline-flex", flexShrink: 0, color: colors.accentText, children: (0, jsx_runtime_1.jsx)(Icon, { size: 15, strokeWidth: 1.8, "aria-hidden": true }) })) : null, (0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: screen.label, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, ...focus.primary, "data-pin-id": onTogglePin ? screen.id : undefined, onClick: link.onPlainClick, flex: 1, minW: 0, fontSize: "13px", fontWeight: 500, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, exports.stretchedLink)("9px"), children: screen.label }) }), (0, jsx_runtime_1.jsx)(CountBadge, { value: screen.badge, size: "tile" }), onTogglePin ? ((0, jsx_runtime_1.jsx)(react_1.Box, { position: "relative", zIndex: 1, flexShrink: 0, w: "0", overflow: "hidden", transition: (0, motion_1.transitionFor)(["width"]), _groupHover: { w: "22px" }, _groupFocusWithin: { w: "22px" }, children: (0, jsx_runtime_1.jsx)(PinToggle_1.default, { isPinned: true, size: 12, label: labels.unpin(screen.label), title: labels.unpinTip, onToggle: onTogglePin }) })) : null] }));
109
196
  }
110
- function AppsSection({ apps, hues, currentAppId, heading, onSelect, }) {
197
+ function AppsSection({ apps, hues, currentAppId, heading, hideHeading = false, onSelect, }) {
111
198
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
112
199
  const rows = (0, rowStates_1.listRowBackgrounds)(colors);
113
- const ring = (0, focusRing_styles_1.focusVisibleStyles)(colors);
114
- return ((0, jsx_runtime_1.jsxs)(react_1.Box, { children: [(0, jsx_runtime_1.jsx)(SectionHeader, { label: heading, isRail: true, hasCount: false }), (0, jsx_runtime_1.jsx)(react_1.Box, { as: "ul", listStyleType: "none", m: 0, p: 0, "aria-label": heading, children: apps.map((app, index) => {
200
+ const rowRing = (0, exports.activeRowSurface)(colors);
201
+ return ((0, jsx_runtime_1.jsxs)(react_1.Box, { children: [hideHeading ? null : (0, jsx_runtime_1.jsx)(SectionHeader, { label: heading, isRail: true, hasCount: false }), (0, jsx_runtime_1.jsx)(react_1.Box, { as: "ul", listStyleType: "none", m: 0, p: 0, "aria-label": heading, children: apps.map((app, index) => {
115
202
  var _a;
116
203
  const isCurrent = app.id === currentAppId;
117
204
  const interactive = !isCurrent && !app.locked;
@@ -125,6 +212,9 @@ function AppsSection({ apps, hues, currentAppId, heading, onSelect, }) {
125
212
  }
126
213
  : {}), "aria-current": isCurrent ? "true" : undefined, title: app.locked
127
214
  ? ((_a = app.lockedReason) !== null && _a !== void 0 ? _a : `${app.name} is not available on your plan`)
128
- : undefined, "data-app-locked": app.locked ? "true" : undefined, align: "center", gap: 3, minH: "44px", px: 2, py: 1, borderRadius: "8px", textDecoration: "none", cursor: interactive ? "pointer" : "default", bg: isCurrent ? rows.selected : "transparent", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: interactive ? { bg: rows.active } : undefined, sx: ring, children: [(0, jsx_runtime_1.jsx)(AppMark_1.default, { app: app, hue: hues[index], boxSize: "28px", iconSize: 15, muted: app.locked }), (0, jsx_runtime_1.jsx)(react_1.Text, { flex: 1, minW: 0, fontSize: "sm", fontWeight: "medium", noOfLines: 1, color: app.locked ? colors.textMuted : colors.text[900], children: app.name }), app.locked ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: lucide_react_1.Lock, size: 14, color: colors.textMuted, flexShrink: 0, "aria-hidden": true })) : null] }) }, app.id || app.name));
215
+ : undefined, "data-app-locked": app.locked ? "true" : undefined, "aria-disabled": app.locked ? "true" : undefined, align: "center", gap: 3, minH: "44px", px: 2, py: 1, borderRadius: "8px", textDecoration: "none", cursor: interactive ? "pointer" : "default", bg: isCurrent ? rows.selected : "transparent", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: interactive ? { bg: rows.active } : undefined, sx: {
216
+ _focusVisible: rowRing,
217
+ [focusRing_styles_1.FOCUS_VISIBLE_OVER_STATE]: rowRing,
218
+ }, children: [(0, jsx_runtime_1.jsx)(AppMark_1.default, { app: app, hue: hues[index], boxSize: "28px", iconSize: 15, muted: app.locked }), (0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: app.name, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Text, { flex: 1, minW: 0, fontSize: "sm", fontWeight: "medium", noOfLines: 1, color: app.locked ? colors.textMuted : colors.text[900], children: app.name }) }), app.locked ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: lucide_react_1.Lock, size: 14, color: colors.textMuted, flexShrink: 0, "aria-hidden": true })) : null] }) }, app.id || app.name));
129
219
  }) })] }));
130
220
  }
@@ -0,0 +1,3 @@
1
+ export type ResultKey = "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "Home" | "End" | "PageUp" | "PageDown";
2
+ /** Next flat result index for a key, following the visual grid: rows by `columns` inside a group, reading order across columns. */
3
+ export declare const moveResult: (sizes: readonly number[], columns: number, index: number, key: ResultKey, pageRows?: number) => number;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.moveResult = void 0;
4
+ const locate = (sizes, index) => {
5
+ let start = 0;
6
+ for (let group = 0; group < sizes.length; group += 1) {
7
+ if (index < start + sizes[group])
8
+ return { group, pos: index - start, start };
9
+ start += sizes[group];
10
+ }
11
+ return {
12
+ group: sizes.length - 1,
13
+ pos: 0,
14
+ start: start - sizes[sizes.length - 1],
15
+ };
16
+ };
17
+ const startOf = (sizes, group) => sizes.slice(0, group).reduce((sum, size) => sum + size, 0);
18
+ const stepVertical = (sizes, columns, index, down, wrap) => {
19
+ const { group, pos, start } = locate(sizes, index);
20
+ const size = sizes[group];
21
+ const column = pos % columns;
22
+ if (down) {
23
+ if (pos + columns < size)
24
+ return index + columns;
25
+ if (Math.floor(pos / columns) < Math.floor((size - 1) / columns))
26
+ return start + size - 1;
27
+ const next = group + 1 < sizes.length ? group + 1 : wrap ? 0 : -1;
28
+ if (next < 0)
29
+ return index;
30
+ return startOf(sizes, next) + Math.min(column, sizes[next] - 1);
31
+ }
32
+ if (pos - columns >= 0)
33
+ return index - columns;
34
+ const prev = group > 0 ? group - 1 : wrap ? sizes.length - 1 : -1;
35
+ if (prev < 0)
36
+ return index;
37
+ const lastRow = Math.floor((sizes[prev] - 1) / columns);
38
+ return (startOf(sizes, prev) + Math.min(sizes[prev] - 1, lastRow * columns + column));
39
+ };
40
+ /** Next flat result index for a key, following the visual grid: rows by `columns` inside a group, reading order across columns. */
41
+ const moveResult = (sizes, columns, index, key, pageRows = 1) => {
42
+ const total = sizes.reduce((sum, size) => sum + size, 0);
43
+ if (total === 0)
44
+ return 0;
45
+ switch (key) {
46
+ case "ArrowDown":
47
+ case "ArrowUp":
48
+ return stepVertical(sizes, columns, index, key === "ArrowDown", true);
49
+ case "ArrowRight":
50
+ return Math.min(total - 1, index + 1);
51
+ case "ArrowLeft":
52
+ return Math.max(0, index - 1);
53
+ case "Home":
54
+ return 0;
55
+ case "End":
56
+ return total - 1;
57
+ default: {
58
+ let next = index;
59
+ for (let i = 0; i < pageRows; i += 1)
60
+ next = stepVertical(sizes, columns, next, key === "PageDown", false);
61
+ return next;
62
+ }
63
+ }
64
+ };
65
+ exports.moveResult = moveResult;
@@ -1,4 +1,4 @@
1
1
  import type { SystemStyleObject } from "@chakra-ui/react";
2
2
  import type { PaletteProps } from "../../Theme/tokens/types";
3
- /** Shows a row affordance on row hover, row focus-within or its own keyboard focus, and always on touch. */
3
+ /** Shows a row affordance on row hover, row focus-within or its own keyboard focus, and always on touch, where it also grows to a 32px hit area. */
4
4
  export declare const revealStyles: (colors: PaletteProps) => SystemStyleObject;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.revealStyles = void 0;
4
4
  const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
5
5
  const motion_1 = require("../../Theme/chakra/motion");
6
- /** Shows a row affordance on row hover, row focus-within or its own keyboard focus, and always on touch. */
6
+ /** Shows a row affordance on row hover, row focus-within or its own keyboard focus, and always on touch, where it also grows to a 32px hit area. */
7
7
  const revealStyles = (colors) => {
8
8
  const ring = (0, focusRing_styles_1.focusVisibleStyles)(colors);
9
9
  return {
@@ -12,7 +12,7 @@ const revealStyles = (colors) => {
12
12
  _groupHover: { opacity: 1 },
13
13
  _groupFocusWithin: { opacity: 1 },
14
14
  "[data-reveal=true] &": { opacity: 1 },
15
- "@media (hover: none)": { opacity: 1 },
15
+ "@media (hover: none)": { opacity: 1, minWidth: "32px", width: "32px", height: "32px" },
16
16
  ...(0, motion_1.reducedMotionSx)(),
17
17
  };
18
18
  };
@@ -12,6 +12,7 @@ const accentText_1 = require("../../Theme/tokens/builders/accentText");
12
12
  const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
13
13
  const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
14
14
  const statusTone_1 = require("../../Theme/tokens/builders/statusTone");
15
+ const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
15
16
  const PersonChip_1 = __importDefault(require("../PersonChip/PersonChip"));
16
17
  const lucide_react_1 = require("lucide-react");
17
18
  // Roomy enough to hover without aiming: the glyph is only 1.25rem.
@@ -52,7 +53,7 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
52
53
  _focus: { bg: menuHoverBg },
53
54
  _active: { bg: rowBackgrounds.selectedActive },
54
55
  };
55
- return ((0, jsx_runtime_1.jsx)(react_1.Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: theme.colors.boxborder[200], children: (0, jsx_runtime_1.jsxs)(react_1.Flex, { h: 16, alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", gap: 1.5, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { as: "button", type: "button", onClick: () => onSideBarToggole === null || onSideBarToggole === void 0 ? void 0 : onSideBarToggole(), onMouseEnter: onSideBarPeek, onFocus: onSideBarPeek, "aria-label": sideBarToggole ? "Close navigation menu" : "Open navigation menu", "aria-expanded": !!sideBarToggole, ...iconButtonStyle, display: forceSideBarToggle ? "flex" : { base: "flex", lg: "none" }, w: SIDEBAR_TOGGLE_HIT, h: SIDEBAR_TOGGLE_HIT, children: sideBarToggole ? ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelLeftClose, { size: "1.25rem" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelRightClose, { size: "1.25rem" })) }), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) && ((0, jsx_runtime_1.jsx)(react_1.Box, { ...iconButtonStyle, as: "button", type: "button", "aria-label": "Go back", display: "flex", onClick: () => { var _a; return (_a = navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) === null || _a === void 0 ? void 0 : _a.call(navigationBarText); }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.CircleArrowLeft, { size: "1.25rem", color: theme.colors.text[500] }) })), leading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [leading, (0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "aria-hidden": "true", mx: 2, w: "1px", h: "1.625rem", bg: theme.colors.boxborder[200] })] })), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text) && ((0, jsx_runtime_1.jsx)(react_1.Text, { color: (0, accentText_1.accentTextOnCanvas)(theme.colors.secondary, theme.colors.backgroundColor.light), fontSize: "1.25rem", fontWeight: 600, fontFamily: "open-sans, sans-serif", letterSpacing: "-0.013rem", children: navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text }))] }), (0, jsx_runtime_1.jsx)(react_1.Flex, { minW: 0, flexShrink: 1, children: (0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", alignItems: "center", spacing: 4, minW: 0, children: [moreIcon && ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", minW: 0, children: moreIcon })), (0, jsx_runtime_1.jsxs)(react_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_1.MenuButton, { as: react_1.Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0, flexShrink: 0, children: (0, jsx_runtime_1.jsx)(Avatar_1.default, { size: "sm", name: userName, src: userAvathar }) }), (0, jsx_runtime_1.jsx)(react_1.MenuList, { alignItems: "center", zIndex: 5, p: 0, py: "0.375rem",
56
+ return ((0, jsx_runtime_1.jsx)(react_1.Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: theme.colors.boxborder[200], children: (0, jsx_runtime_1.jsxs)(react_1.Flex, { h: 16, alignItems: "center", justifyContent: "space-between", gap: 2, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", gap: 1.5, alignItems: "center", flex: "1 1 0%", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { as: "button", type: "button", onClick: () => onSideBarToggole === null || onSideBarToggole === void 0 ? void 0 : onSideBarToggole(), onMouseEnter: onSideBarPeek, onFocus: onSideBarPeek, "aria-label": sideBarToggole ? "Close navigation menu" : "Open navigation menu", "aria-expanded": !!sideBarToggole, ...iconButtonStyle, flexShrink: 0, display: forceSideBarToggle ? "flex" : { base: "flex", lg: "none" }, w: SIDEBAR_TOGGLE_HIT, h: SIDEBAR_TOGGLE_HIT, children: sideBarToggole ? ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelLeftClose, { size: "1.25rem" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelRightClose, { size: "1.25rem" })) }), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) && ((0, jsx_runtime_1.jsx)(react_1.Box, { ...iconButtonStyle, as: "button", type: "button", "aria-label": "Go back", display: "flex", flexShrink: 0, onClick: () => { var _a; return (_a = navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) === null || _a === void 0 ? void 0 : _a.call(navigationBarText); }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.CircleArrowLeft, { size: "1.25rem", color: theme.colors.text[500] }) })), leading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [leading, (0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "aria-hidden": "true", mx: 2, w: "1px", h: "1.625rem", flexShrink: 0, bg: theme.colors.boxborder[200] })] })), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text) && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: typeof navigationBarText.text === "string" ? navigationBarText.text : "", overflowOnly: true, placement: "bottom", children: (0, jsx_runtime_1.jsx)(react_1.Text, { flex: "1 1 0%", w: 0, minW: 0, isTruncated: true, color: (0, accentText_1.accentTextOnCanvas)(theme.colors.secondary, theme.colors.backgroundColor.light), fontSize: "1.25rem", fontWeight: 600, fontFamily: "open-sans, sans-serif", letterSpacing: "-0.013rem", children: navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text }) }))] }), (0, jsx_runtime_1.jsx)(react_1.Flex, { minW: 0, flexShrink: 1, children: (0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", alignItems: "center", spacing: 4, minW: 0, children: [moreIcon && ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", minW: 0, sx: { "& > *": { minW: 0 } }, children: moreIcon })), (0, jsx_runtime_1.jsxs)(react_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_1.MenuButton, { as: react_1.Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0, flexShrink: 0, children: (0, jsx_runtime_1.jsx)(Avatar_1.default, { size: "sm", name: userName, src: userAvathar }) }), (0, jsx_runtime_1.jsx)(react_1.MenuList, { alignItems: "center", zIndex: 5, p: 0, py: "0.375rem",
56
57
  // Without a cap one long title stretches the whole dropdown; titles truncate instead.
57
58
  maxW: "18rem", bg: theme.colors.surfaceRaised,
58
59
  // NOTE: Chakra's MenuItem inherits --menu-bg hardcoded to #fff via dead _dark — set it or items stay white.
@@ -6,6 +6,7 @@ export type NavbarProps = {
6
6
  userName: string;
7
7
  userRole?: string;
8
8
  navMenu: MenuProps[];
9
+ /** Right-cluster slot before the avatar (org switcher, bell, launcher trigger). Its child may shrink; give icon buttons `flexShrink={0}`. */
9
10
  moreIcon?: ReactNode;
10
11
  handleNavOnClick: (url: string) => void;
11
12
  handleLogout: () => void;
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const jsx_runtime_1 = require("react/jsx-runtime");
4
7
  const react_1 = require("react");
@@ -10,12 +13,15 @@ const chartColorsFromTheme_1 = require("../../Theme/tokens/builders/chartColorsF
10
13
  const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
11
14
  const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
12
15
  const useExclusiveOverlay_1 = require("../../Hooks/useExclusiveOverlay");
16
+ const useMatchMedia_1 = require("../../Hooks/useMatchMedia");
17
+ const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
13
18
  const OrgSwitcherProps_1 = require("./OrgSwitcherProps");
14
19
  const sizeMap = {
15
- sm: { h: "32px", avatar: "22px", font: "0.8rem", sub: "0.65rem", px: 2 },
16
- md: { h: "40px", avatar: "28px", font: "0.9rem", sub: "0.7rem", px: 3 },
17
- lg: { h: "48px", avatar: "34px", font: "1rem", sub: "0.78rem", px: 4 },
20
+ sm: { h: "32px", avatarH: "32px", avatar: "22px", font: "0.8rem", sub: "0.65rem", px: 2 },
21
+ md: { h: "40px", avatarH: "36px", avatar: "28px", font: "0.9rem", sub: "0.7rem", px: 3 },
22
+ lg: { h: "48px", avatarH: "48px", avatar: "34px", font: "1rem", sub: "0.78rem", px: 4 },
18
23
  };
24
+ const MD_QUERY = "(min-width: 48em)";
19
25
  const Avatar = ({ org, boxSize, fontSize, }) => {
20
26
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
21
27
  if (org.logoUrl) {
@@ -24,9 +30,11 @@ const Avatar = ({ org, boxSize, fontSize, }) => {
24
30
  const fill = (0, OrgSwitcherProps_1.avatarColor)(org.name, (0, chartColorsFromTheme_1.chartMode)(colors));
25
31
  return ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: boxSize, borderRadius: "lg", flexShrink: 0, bg: fill, color: (0, accentText_1.onFilled)(fill, colors.white, colors.black), fontSize: fontSize, fontWeight: 700, children: (0, OrgSwitcherProps_1.orgInitial)(org.name) }));
26
32
  };
27
- const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSearchable, searchThreshold = 6, triggerVariant = "ghost", size = "md", maxWidth = "200px", menuMinWidth = "280px", placeholder = "Select organization", ariaLabel = "Switch organization", showRole = true, }) => {
28
- var _a;
33
+ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSearchable, searchThreshold = 6, triggerVariant = "ghost", size = "md", maxWidth = "200px", menuMinWidth = "280px", placeholder = "Select organization", ariaLabel = "Switch organization", showRole = true, display = "full", }) => {
34
+ var _a, _b;
29
35
  const theme = (0, useCustomTheme_1.useCustomTheme)();
36
+ const isMd = (0, useMatchMedia_1.useMatchMedia)(MD_QUERY, true);
37
+ const avatarOnly = display === "avatar" || (display === "auto" && !isMd);
30
38
  const rowBackgrounds = (0, react_1.useMemo)(() => (0, rowStates_1.listRowBackgrounds)(theme.colors), [theme.colors]);
31
39
  const s = sizeMap[size];
32
40
  const { isOpen, onOpen, onClose } = (0, react_2.useDisclosure)();
@@ -87,10 +95,14 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
87
95
  if (org.id !== value)
88
96
  onChange(org.id, org);
89
97
  };
98
+ const avatarNode = selected ? ((0, jsx_runtime_1.jsx)(Avatar, { org: selected, boxSize: s.avatar, fontSize: s.sub })) : ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: s.avatar, borderRadius: "lg", bg: theme.colors.gray[100], color: (0, accentText_1.accentTextOnCanvas)(theme.colors.gray, theme.colors.gray[100]), flexShrink: 0, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { size: 14 }) }));
99
+ const labelGap = s.px === 2 ? 8 : 10;
100
+ const squeezedWidth = `calc(${s.px * 8 + labelGap * 2 + 16}px + ${s.avatar})`;
101
+ const trigger = ((0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", type: "button", "aria-label": avatarOnly && selected ? `${ariaLabel}, ${selected.name}` : ariaLabel, align: "center", justify: avatarOnly ? "center" : undefined, gap: avatarOnly ? "4px" : `${labelGap}px`, h: avatarOnly ? s.avatarH : s.h, px: avatarOnly ? "6px" : s.px, minW: avatarOnly ? undefined : squeezedWidth, flexShrink: avatarOnly ? 0 : 1, borderRadius: "lg", cursor: isLoading ? "default" : "pointer", opacity: isLoading ? 0.6 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "background 0.15s ease", _hover: { bg: triggerVariant === "ghost" ? triggerHoverBg : undefined }, ...triggerStyles, children: [avatarNode, !avatarOnly && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.font, fontWeight: 600, color: theme.colors.gray[700], maxW: maxWidth, minW: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left", children: (_a = selected === null || selected === void 0 ? void 0 : selected.name) !== null && _a !== void 0 ? _a : placeholder })), isLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "1.5px", color: theme.colors.accentText, flexShrink: 0 })) : avatarOnly ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.ChevronDown, size: 12, color: theme.colors.textMuted, flexShrink: 0, "aria-hidden": "true" })) : ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.ChevronsUpDown, size: 16, color: theme.colors.textMuted, flexShrink: 0 }))] }));
90
102
  return ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isOpen, onOpen: handlePopoverOpen, onClose: () => {
91
103
  onClose();
92
104
  setQuery("");
93
- }, placement: "bottom-start", initialFocusRef: showSearch ? searchRef : firstOptionRef, isLazy: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", type: "button", "aria-label": ariaLabel, align: "center", gap: s.px === 2 ? "8px" : "10px", h: s.h, px: s.px, borderRadius: "lg", cursor: isLoading ? "default" : "pointer", opacity: isLoading ? 0.6 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "background 0.15s ease", _hover: { bg: triggerVariant === "ghost" ? triggerHoverBg : undefined }, ...triggerStyles, children: [selected ? ((0, jsx_runtime_1.jsx)(Avatar, { org: selected, boxSize: s.avatar, fontSize: s.sub })) : ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: s.avatar, borderRadius: "lg", bg: theme.colors.gray[100], color: (0, accentText_1.accentTextOnCanvas)(theme.colors.gray, theme.colors.gray[100]), flexShrink: 0, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { size: 14 }) })), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.font, fontWeight: 600, color: theme.colors.gray[700], maxW: maxWidth, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left", children: (_a = selected === null || selected === void 0 ? void 0 : selected.name) !== null && _a !== void 0 ? _a : placeholder }), isLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "1.5px", color: theme.colors.accentText, flexShrink: 0 })) : ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.ChevronsUpDown, size: 16, color: theme.colors.textMuted, flexShrink: 0 }))] }) }), (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { minW: menuMinWidth, w: "auto",
105
+ }, placement: "bottom-start", initialFocusRef: showSearch ? searchRef : firstOptionRef, isLazy: true, children: [avatarOnly ? ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: (_b = selected === null || selected === void 0 ? void 0 : selected.name) !== null && _b !== void 0 ? _b : placeholder, placement: "bottom", isDisabled: isOpen, children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", flexShrink: 0, children: (0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: trigger }) }) })) : ((0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: trigger })), (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { minW: menuMinWidth, maxW: "calc(100vw - 32px)", w: "auto",
94
106
  // NOTE: Chakra's --popper-bg is hardcoded white via dead _dark — without an explicit bg the panel stayed white.
95
107
  bg: theme.colors.surfaceRaised, borderRadius: "xl", overflow: "hidden", boxShadow: `0 10px 30px ${theme.colors.boxShadow.default}`, _focus: { outline: "none", boxShadow: `0 10px 30px ${theme.colors.boxShadow.default}` }, children: (0, jsx_runtime_1.jsxs)(react_2.PopoverBody, { p: 0, children: [showSearch && ((0, jsx_runtime_1.jsx)(react_2.Box, { p: 2, borderBottom: "1px solid", borderColor: theme.colors.gray[100], children: (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { size: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.InputLeftElement, { pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { size: 15, color: theme.colors.textMuted }) }), (0, jsx_runtime_1.jsx)(react_2.Input, { ref: searchRef, placeholder: "Search organizations", value: query, onChange: (e) => setQuery(e.target.value), onKeyDown: (e) => {
96
108
  if (e.key === "ArrowDown" && filtered.length > 0) {