@stackone/malachite 2.129.0 → 2.130.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/COMPONENTS.md CHANGED
@@ -98,7 +98,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
98
98
  - **`Breadcrumbs`** — Breadcrumb trail with caret separators, an optional back button (shown only when there is more than one crumb AND the parent — the second-to-last — carries a `url` to target) and a right-aligned `actions` row. A lone crumb marked `isRoot` switches to title mode: plain emphasised text, no trail chrome, but the `actions` row still renders; `titleElement` renders it as a heading, which `PageLayout.Regular` asks for (`h1`) when no `title` heading is showing. Renders as a `nav`/`ol` with `aria-current="page"` on the last crumb. Pass `renderLink` to route crumbs through the app's own router instead of a plain `<a>`. Used by `PageLayout`, but standalone too. _Key props:_ `links[]` (`name`, `url`, `isRoot`), `actions[]`, `renderLink`, `titleElement`, `className`, `style`.
99
99
  - **`ActionMenu`** — Dropdown menu of actions (kebab/overflow style). The trigger is an icon-only `Button` by default, so `size` draws exactly the square a `Button` of that size draws beside it: `xsmall` is Figma's 20px "Button Element - Square (X-Small)", `small` the 28px rung above it. Both squares are fixed rather than read off the `controlHeights` tokens, so re-theming those does not resize the trigger. A supplied `triggerIcon` is held to the tier's glyph size — 11px at `xsmall`, 16px at `small`. At 20px the `xsmall` trigger meets WCAG 2.5.8 through the *Spacing* exception rather than the 24px minimum, so keep at least 4px between adjacent triggers. `showLabel` draws `label` beside the icon instead of leaving it to the accessible name — for a menu that is the point of its corner rather than an overflow for a row that already says what it acts on — and `variant` puts the trigger on any `Button` variant, so a menu handing work to the assistant can wear the assistant ground rather than the overflow-kebab outline. An item's `icon` leads its label: every caller's names the action itself — copy, open, delete — and an icon that is part of an item's identity belongs where the eye starts rather than right-aligned, where it reads as a status column. The menu is Figma's `Dropdown Component - Options List`: a fixed sized to its widest item between a 180px floor and the 280px Figma draws, by default under the trigger's right edge, 14px below it, flipping above or clamping sideways when the viewport has no room, rounding at the library's 12px and padding wider (8px) than the menu a `Dropdown` opens. Items read in the primary text colour, or the secondary one with `tone="muted"` (e.g. a sidebar's menus); destructive ones in red; `danger: 'hover'` keeps an item in its normal colour and turns it destructive (red text on a light red ground) only on hover or keyboard focus, for an action like signing out. A ceiling rather than a flat width: taken literally it gave a menu of four short verbs 130px of air and made every kebab in an app the same width whatever it held. `minWidth` only raises it above that ceiling, so it is the one way to go past 280px, and a label too long for the box truncates rather than wrapping. An item with `indent` sits under the row above it behind a rule, as a step under its section, and a menu taller than its max height scrolls rather than squeezing its rows. _Key props:_ `ActionMenuItem[]`, `size`, `label`, `triggerIcon`, `minWidth`, `showLabel`, `variant`, `tone` (`default` | `muted`), `trigger` (your own control in place of the kebab, cloned with the menu's ref and aria state), `highlightChoices`, `placement` (`bottom-end` default | `bottom-start` | `right-start` | `top-start` | `top-center`), `offset` (`small` 8px | `medium` 12px | `large` 14px; applies to every placement; without it the default `bottom-end` keeps the options menu's 14px and the others use 8px). An item's `tag` (e.g. an "Early access" `Tag`) follows its label in a lazily loaded shadow host of its own, since the menu renders into `document.body`, and joins its accessible name; `current: true` marks the item for the page the user is on (`aria-current="page"` and the selected row paint; a `danger` item keeps its red text). An item with an `href` is a link: Cmd/Ctrl-click or a middle click opens it in a new tab and closes the menu, while a plain click runs `onClick` in its place when one is given (so a router can navigate in-app); Enter and Space both activate it. `target: '_blank'` opens it in a new tab, adds `noopener noreferrer` and tells screen readers it opens a new tab. An item with `checked` is one of a set of choices: a `menuitemradio` with `aria-checked` and a trailing check while true; picking it still runs `onClick` and closes. Give the choices of one set the same `group` and, where they sit next to each other, they share a `role="group"` named by it, so a screen reader can tell where the set ends; choices with the same `group` split by another item form separate groups. `description` adds a quieter second line under the label, announced as the item's description rather than its name. `intent` colours the label and icon: `warning` (amber) for undoing choices already made, `accent` (green) for a way forward; a disabled item drops it, and `danger` or `current` wins over it. `highlightChoices` styles the menu as a picker: the checked choice of each `group` sits on a light green row (a Dropdown selected option's ground) with a green check (a danger, intent, disabled or current choice keeps its own colours), and a text row whose label is a set's `group` name sits a notch smaller, as its heading. An item with `type: 'text'` is context rather than an action (an account's email above its actions): secondary text the arrow keys skip. Opened from the keyboard, focus lands on the first item, or on the checked choice in a menu of choices; Up/Down/Home/End move through enabled items, Tab closes the menu and moves on as usual; Escape or a picked item returns focus to the trigger.
100
100
  - **`NavItem`** — A row in an app's side navigation. Idle rows read secondary and take the list hover; the `active` row wears the accent tint and sets `aria-current="page"` on a link. `collapsed` shrinks it to a 36px icon tile whose label becomes the accessible name and a right-hand tooltip, with any `badge` pinned to the tile's corner. `variant="subitem"` indents a child row behind a dot instead of an icon; `disclosure` makes a group header button with `aria-expanded` and a rotating chevron, and `hasActiveChild` colours its text while a child is current. Renders an `<a>` with `href`, the element passed with `asChild` (a router `Link`), or a `<button>`, and forwards its ref and extra attributes so it can be a `Popover` or `ActionMenu` trigger. `disabled` keeps the row a tab stop with `aria-disabled`, drops its hover and pointer, and ignores clicks, Enter and Space; a `Popover` or `ActionMenu` it triggers stays shut on press, hover, focus and arrow keys, while other keys still reach a passed `onKeyDown` so arrow navigation through a list keeps working; a disabled `href` row renders as a button so it cannot be followed. `disabledReason` explains it in a right-hand tooltip on hover and focus and is the row's accessible description from the first focus. Not with `asChild`, whose child would still navigate. _Key props:_ `label`, `icon`, `active`, `hasActiveChild`, `collapsed`, `variant` (`item` | `subitem`), `danger`, `trailing`, `badge`, `disclosure` (`expanded` | `collapsed`), `tooltip`, `accessibleLabel` (overrides the accessible name; collapsed it defaults to the tooltip text plus `badgeLabel`), `href`, `target`, `rel`, `onClick`, `asChild` + `children`, `className`, `size` (`medium` | `small`, the tighter row for lists inside a popover), `tag` (beside the label, e.g. early access), `badgeLabel` (read in place of the badge and added to the collapsed name), `disabled`, `disabledReason`. A passed `aria-expanded` (e.g. from a `Popover`) wins over `disclosure`, and a button row forwards a passed `aria-current`.
101
- - **`Sidebar`** — An app's left navigation shell, pinned to the viewport's left edge: 260px wide, 60px `collapsed`, on the sunken page background. Composed from `Sidebar.Header` (a 56px band for `Sidebar.Switcher`, the logo + workspace + parent trigger), `Sidebar.Body` (the part that scrolls), `Sidebar.Notices`, `Sidebar.Search`, `Sidebar.Section` (rows of `NavItem`s at the gutter), `Sidebar.Group` + `Sidebar.GroupItems` (a disclosure header and its sub-items), `Sidebar.Divider`, `Sidebar.Usage` (a `UsageCard` placed at the sidebar's gutter) and `Sidebar.Footer` holding `Sidebar.Account`. Popovers opened from it (with `padding="none"`) wrap their body in `Sidebar.Panel`, sized so the popover comes to `SIDEBAR_POPOVER_WIDTH_PX`, and build it from the `Popover` parts. `onToggleCollapse` adds the edge toggle, shown in CSS while the pointer is over the sidebar or a keyboard focus is inside it, and always on a touch screen, which has no hover to reveal it. A workspace, organization or account name cut off in the expanded sidebar shows in full on hover. Notices, the divider and the usage card hide while collapsed. Render it inside `<MalachiteContext layer="sidebar">`, or the page paints over the edge toggle. On a viewport narrower than `SIDEBAR_OVERLAY_BREAKPOINT_PX` (768px) pass `overlay`, collapse it on entering overlay mode, and keep the page at the collapsed offset. Collapsed, it is the plain rail and takes no focus. Expanded from that rail, it floats over the page as a modal drawer, behind a scrim, with Escape, a focus trap and scroll lock, and a click on the scrim or Escape collapses it through `onToggleCollapse`. Expanded on mount or across the breakpoint it stays a plain sidebar, so it never takes focus from the page, and expanded under an open dialog it becomes the drawer once that dialog closes. _Key props:_ `collapsed`, `onToggleCollapse`, `overlay`, `expandLabel`, `collapseLabel`, `aria-label`; `Sidebar.Switcher`: `logo`, `title`, `subtitle`, `titleTooltip`/`subtitleTooltip` (shown when the name is cut off, the name by default; pass a node to wrap it, e.g. to keep it out of session recordings) + button attributes; `Sidebar.Account`: `avatar` or `initials` (a small chip when there is no photo), `name`, `tooltip` (on the collapsed rail, and expanded when the name is cut off; `name` by default; pass a node to wrap it) + button attributes; `Sidebar.Usage`: the `UsageCard` props; `Sidebar.Notices`: `aria-label` (required); `Sidebar.Panel`: `width` (`SIDEBAR_POPOVER_WIDTH_PX` by default). `useSidebarCollapsed()` reads the state from inside; `SIDEBAR_WIDTH_PX` gives the page its offset beside the sidebar; `SIDEBAR_TOOLTIP_DELAY_S` is the 0.2s delay its name and rail tooltips use, for tooltips a consumer adds inside it.
101
+ - **`Sidebar`** — An app's left navigation shell, pinned to the viewport's left edge: 260px wide, 60px `collapsed`, on the sunken page background. Composed from `Sidebar.Header` (a 56px band for `Sidebar.Switcher`, the logo + workspace + parent trigger), `Sidebar.Body` (the part that scrolls), `Sidebar.Notices`, `Sidebar.Search`, `Sidebar.Section` (rows of `NavItem`s at the gutter), `Sidebar.Group` + `Sidebar.GroupItems` (a disclosure header and its sub-items), `Sidebar.Divider`, `Sidebar.Usage` (a `UsageCard` placed at the sidebar's gutter), `Sidebar.Progress` (a checklist's progress as one link to it: title, a `value/max` count, a caption such as the next step, and a bar; `current`, which only exists alongside `link`, rings it while its page is on screen, `busy` drops the link and count, leaving an empty track, for a skeleton caption; the count is clamped to `0`–`max`; inside the link the count is spoken as text and the bar is hidden from assistive tech) and `Sidebar.Footer` holding `Sidebar.Account`. Popovers opened from it (with `padding="none"`) wrap their body in `Sidebar.Panel`, sized so the popover comes to `SIDEBAR_POPOVER_WIDTH_PX`, and build it from the `Popover` parts. `onToggleCollapse` adds the edge toggle, shown in CSS while the pointer is over the sidebar or a keyboard focus is inside it, and always on a touch screen, which has no hover to reveal it. A workspace, organization or account name cut off in the expanded sidebar shows in full on hover. Notices, the divider, the usage card and the progress card hide while collapsed. Render it inside `<MalachiteContext layer="sidebar">`, or the page paints over the edge toggle. On a viewport narrower than `SIDEBAR_OVERLAY_BREAKPOINT_PX` (768px) pass `overlay`, collapse it on entering overlay mode, and keep the page at the collapsed offset. Collapsed, it is the plain rail and takes no focus. Expanded from that rail, it floats over the page as a modal drawer, behind a scrim, with Escape, a focus trap and scroll lock, and a click on the scrim or Escape collapses it through `onToggleCollapse`. Expanded on mount or across the breakpoint it stays a plain sidebar, so it never takes focus from the page, and expanded under an open dialog it becomes the drawer once that dialog closes. _Key props:_ `collapsed`, `onToggleCollapse`, `overlay`, `expandLabel`, `collapseLabel`, `aria-label`; `Sidebar.Switcher`: `logo`, `title`, `subtitle`, `titleTooltip`/`subtitleTooltip` (shown when the name is cut off, the name by default; pass a node to wrap it, e.g. to keep it out of session recordings) + button attributes; `Sidebar.Account`: `avatar` or `initials` (a small chip when there is no photo), `name`, `tooltip` (on the collapsed rail, and expanded when the name is cut off; `name` by default; pass a node to wrap it) + button attributes; `Sidebar.Usage`: the `UsageCard` props; `Sidebar.Progress`: `title`, `value`, `max`, `caption`, `link` (an empty `<a>` or router `Link` the card becomes), `current`, `busy`, `aria-valuetext`; `Sidebar.Notices`: `aria-label` (required); `Sidebar.Panel`: `width` (`SIDEBAR_POPOVER_WIDTH_PX` by default). `useSidebarCollapsed()` reads the state from inside; `SIDEBAR_WIDTH_PX` gives the page its offset beside the sidebar; `SIDEBAR_TOOLTIP_DELAY_S` is the 0.2s delay its name and rail tooltips use, for tooltips a consumer adds inside it.
102
102
  - **`SearchTrigger`** — A button drawn as a filled search field, for opening a command palette or search dialog from app chrome such as a sidebar. It is not an input — typing happens in what it opens. `shortcut` draws flat `<kbd>` chips at the end (not `Keycap`, whose raised shadow reads as a second button inside a filled field), kept out of the accessible name; `iconOnly` makes a 36px icon tile matching a collapsed `NavItem`, named by `label`. _Key props:_ `label` (default `Search`), `shortcut` (`ReactNode[]`), `iconOnly`, `aria-label`, `className`, plus native button attributes (`onClick`, `aria-haspopup`, `aria-expanded`, `aria-keyshortcuts`).
103
103
  - **`FooterNav`** — Footer navigation bar of links. _Key props:_ `FooterNavLink[]`.
104
104
  - **`FooterLinks`** — Inline list of footer links (e.g. terms, privacy, support).
@@ -1,21 +1,22 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- const w = "w-full overflow-hidden bg-[var(--malachite-card-dimmed-background)]", A = "h-full transition-[width] duration-200 ease-in-out bg-[var(--malachite-text-primary)]", g = "h-full transition-[width] duration-200 ease-in-out", C = {
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ const g = "w-full overflow-hidden bg-[var(--malachite-card-dimmed-background)]", w = "h-full transition-[width] duration-200 ease-in-out bg-[var(--malachite-text-primary)]", A = "h-full transition-[width] duration-200 ease-in-out", C = {
3
3
  default: "var(--malachite-text-primary)",
4
4
  success: "var(--malachite-text-success)",
5
5
  warning: "var(--malachite-text-warning)",
6
6
  error: "var(--malachite-text-error)",
7
- info: "var(--malachite-text-info)"
7
+ info: "var(--malachite-text-info)",
8
+ accent: "var(--malachite-accent-foreground)"
8
9
  }, E = "135deg", v = 2, M = 5, y = "var(--malachite-card-dimmed-background)", H = (t, a) => {
9
- const r = C[t.variant ?? "default"], e = { width: `${a}%`, backgroundColor: r };
10
- return t.fill !== "hatched" ? e : {
11
- ...e,
12
- backgroundImage: `repeating-linear-gradient(${E}, ${r} 0 ${v}px, ${y} ${v}px ${M}px)`
10
+ const e = C[t.variant ?? "default"], r = { width: `${a}%`, backgroundColor: e };
11
+ return t.fill !== "hatched" ? r : {
12
+ ...r,
13
+ backgroundImage: `repeating-linear-gradient(${E}, ${e} 0 ${v}px, ${y} ${v}px ${M}px)`
13
14
  };
14
- }, L = (t) => t.reduce((a, r) => a + Math.max(0, r.value), 0), N = ({
15
+ }, L = (t) => t.reduce((a, e) => a + Math.max(0, e.value), 0), N = ({
15
16
  value: t,
16
17
  segments: a,
17
- max: r,
18
- color: e,
18
+ max: e,
19
+ color: r,
19
20
  trackColor: o,
20
21
  height: d = 4,
21
22
  "aria-label": x,
@@ -24,38 +25,38 @@ const w = "w-full overflow-hidden bg-[var(--malachite-card-dimmed-background)]",
24
25
  className: S = "",
25
26
  style: $ = {}
26
27
  }) => {
27
- const s = Math.max(0, Math.min(100, t ?? 0)), p = Math.max(2, Math.round(d / 2)), u = (a == null ? void 0 : a.filter((i) => i.value > 0)) ?? [], l = a !== void 0, c = l ? L(u) : 0, h = Math.max(r ?? c, c), m = h > 0 ? h : 1;
28
- return /* @__PURE__ */ n(
28
+ const s = Math.max(0, Math.min(100, t ?? 0)), p = Math.max(2, Math.round(d / 2)), u = (a == null ? void 0 : a.filter((i) => i.value > 0)) ?? [], l = a !== void 0, n = l ? L(u) : 0, h = Math.max(e ?? n, n), m = h > 0 ? h : 1;
29
+ return /* @__PURE__ */ c(
29
30
  "div",
30
31
  {
31
32
  role: "progressbar",
32
33
  "aria-valuemin": 0,
33
34
  "aria-valuemax": l ? m : 100,
34
- "aria-valuenow": l ? c : Math.round(s),
35
+ "aria-valuenow": l ? n : Math.round(s),
35
36
  "aria-valuetext": b,
36
37
  "aria-label": x,
37
38
  "aria-labelledby": f,
38
- className: `${w} ${S}`,
39
+ className: `${g} ${S}`,
39
40
  style: {
40
41
  height: `${d}px`,
41
42
  borderRadius: `${p}px`,
42
43
  ...o && !l && { background: o },
43
44
  ...$
44
45
  },
45
- children: l ? /* @__PURE__ */ n("div", { className: "flex h-full w-full", children: u.map((i, _) => /* @__PURE__ */ n(
46
+ children: l ? /* @__PURE__ */ c("div", { className: "flex h-full w-full", children: u.map((i, _) => /* @__PURE__ */ c(
46
47
  "div",
47
48
  {
48
- className: g,
49
+ className: A,
49
50
  style: H(i, i.value / m * 100)
50
51
  },
51
52
  `${i.variant ?? "default"}-${_}`
52
- )) }) : /* @__PURE__ */ n(
53
+ )) }) : /* @__PURE__ */ c(
53
54
  "div",
54
55
  {
55
- className: A,
56
+ className: w,
56
57
  style: {
57
58
  width: `${s}%`,
58
- ...e && { background: e }
59
+ ...r && { background: r }
59
60
  }
60
61
  }
61
62
  )
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","sources":["../../src/components/Progress.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * Semantic colour role for a segment. Colours come from theme tokens by design — unlike\n * `color`/`trackColor`, which predate that rule, there is no free-form colour here. To\n * restyle a role, override its token via `applyTheme` / `applyCustomTheme`.\n */\nexport type ProgressSegmentVariant = 'default' | 'success' | 'warning' | 'error' | 'info';\n\n/** `hatched` reads as claimed-but-unpaid-for — usage past an allowance, not more of it. */\nexport type ProgressSegmentFill = 'solid' | 'hatched';\n\nexport interface ProgressSegment {\n /** Portion of `max` this segment covers, in the same units. */\n value: number;\n variant?: ProgressSegmentVariant;\n fill?: ProgressSegmentFill;\n}\n\ninterface ProgressCommonProps {\n height?: number;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** Spoken instead of the range, which reads as 100% once segments fill the track. */\n 'aria-valuetext'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface ProgressValueProps extends ProgressCommonProps {\n value: number;\n color?: string;\n trackColor?: string;\n segments?: never;\n max?: never;\n}\n\ninterface ProgressSegmentsProps extends ProgressCommonProps {\n segments: ProgressSegment[];\n /** Scale the segments measure against. Defaults to their sum, and a larger sum wins. */\n max?: number;\n value?: never;\n color?: never;\n trackColor?: never;\n}\n\n/** One fill or a list of segments, never both — `color`/`trackColor` mean nothing to segments. */\nexport type ProgressProps = ProgressValueProps | ProgressSegmentsProps;\n\nconst TRACK_CLASSES = 'w-full overflow-hidden bg-[var(--malachite-card-dimmed-background)]';\nconst FILL_CLASSES =\n 'h-full transition-[width] duration-200 ease-in-out bg-[var(--malachite-text-primary)]';\nconst SEGMENT_CLASSES = 'h-full transition-[width] duration-200 ease-in-out';\n\nconst SEGMENT_COLOR: Record<ProgressSegmentVariant, string> = {\n default: 'var(--malachite-text-primary)',\n success: 'var(--malachite-text-success)',\n warning: 'var(--malachite-text-warning)',\n error: 'var(--malachite-text-error)',\n info: 'var(--malachite-text-info)',\n};\n\n// Bands sit perpendicular to the gradient axis, so this draws them bottom-left to top-right.\nconst HATCH_AXIS_ANGLE = '135deg';\nconst HATCH_STRIPE_PX = 2;\nconst HATCH_PERIOD_PX = 5;\nconst HATCH_GAP_COLOR = 'var(--malachite-card-dimmed-background)';\n\nconst segmentStyle = (segment: ProgressSegment, widthPercent: number): React.CSSProperties => {\n const color = SEGMENT_COLOR[segment.variant ?? 'default'];\n const base: React.CSSProperties = { width: `${widthPercent}%`, backgroundColor: color };\n if (segment.fill !== 'hatched') {\n return base;\n }\n return {\n ...base,\n backgroundImage: `repeating-linear-gradient(${HATCH_AXIS_ANGLE}, ${color} 0 ${HATCH_STRIPE_PX}px, ${HATCH_GAP_COLOR} ${HATCH_STRIPE_PX}px ${HATCH_PERIOD_PX}px)`,\n };\n};\n\nconst sumOf = (segments: ProgressSegment[]): number =>\n segments.reduce((total, segment) => total + Math.max(0, segment.value), 0);\n\nconst Progress: React.FC<ProgressProps> = ({\n value,\n segments,\n max,\n color,\n trackColor,\n height = 4,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-valuetext': ariaValueText,\n className = '',\n style = {},\n}) => {\n const clamped = Math.max(0, Math.min(100, value ?? 0));\n const radius = Math.max(2, Math.round(height / 2));\n const drawn = segments?.filter((segment) => segment.value > 0) ?? [];\n const segmented = segments !== undefined;\n const total = segmented ? sumOf(drawn) : 0;\n // Only guards the division: flooring at 1 unconditionally would rescale a sub-1 max.\n const requestedScale = Math.max(max ?? total, total);\n const scale = requestedScale > 0 ? requestedScale : 1;\n\n return (\n <div\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={segmented ? scale : 100}\n // Segment totals are arbitrary, so rounding one side could put it past the other.\n aria-valuenow={segmented ? total : Math.round(clamped)}\n aria-valuetext={ariaValueText}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`${TRACK_CLASSES} ${className}`}\n style={{\n height: `${height}px`,\n borderRadius: `${radius}px`,\n ...(trackColor && !segmented && { background: trackColor }),\n ...style,\n }}\n >\n {segmented ? (\n <div className=\"flex h-full w-full\">\n {drawn.map((segment, index) => (\n <div\n // Segments are a positional list with no identity of their own.\n key={`${segment.variant ?? 'default'}-${index}`}\n className={SEGMENT_CLASSES}\n style={segmentStyle(segment, (segment.value / scale) * 100)}\n />\n ))}\n </div>\n ) : (\n <div\n className={FILL_CLASSES}\n style={{\n width: `${clamped}%`,\n ...(color && { background: color }),\n }}\n />\n )}\n </div>\n );\n};\n\nexport default Progress;\nexport { Progress };\n"],"names":["TRACK_CLASSES","FILL_CLASSES","SEGMENT_CLASSES","SEGMENT_COLOR","HATCH_AXIS_ANGLE","HATCH_STRIPE_PX","HATCH_PERIOD_PX","HATCH_GAP_COLOR","segmentStyle","segment","widthPercent","color","base","sumOf","segments","total","Progress","value","max","trackColor","height","ariaLabel","ariaLabelledBy","ariaValueText","className","style","clamped","radius","drawn","segmented","requestedScale","scale","jsx","index"],"mappings":";AAiDA,MAAMA,IAAgB,uEAChBC,IACF,yFACEC,IAAkB,sDAElBC,IAAwD;AAAA,EAC1D,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AACV,GAGMC,IAAmB,UACnBC,IAAkB,GAClBC,IAAkB,GAClBC,IAAkB,2CAElBC,IAAe,CAACC,GAA0BC,MAA8C;AAC1F,QAAMC,IAAQR,EAAcM,EAAQ,WAAW,SAAS,GAClDG,IAA4B,EAAE,OAAO,GAAGF,CAAY,KAAK,iBAAiBC,EAAA;AAChF,SAAIF,EAAQ,SAAS,YACVG,IAEJ;AAAA,IACH,GAAGA;AAAA,IACH,iBAAiB,6BAA6BR,CAAgB,KAAKO,CAAK,MAAMN,CAAe,OAAOE,CAAe,IAAIF,CAAe,MAAMC,CAAe;AAAA,EAAA;AAEnK,GAEMO,IAAQ,CAACC,MACXA,EAAS,OAAO,CAACC,GAAON,MAAYM,IAAQ,KAAK,IAAI,GAAGN,EAAQ,KAAK,GAAG,CAAC,GAEvEO,IAAoC,CAAC;AAAA,EACvC,OAAAC;AAAA,EACA,UAAAH;AAAA,EACA,KAAAI;AAAA,EACA,OAAAP;AAAA,EACA,YAAAQ;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,kBAAkBC;AAAA,EAClB,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ,CAAA;AACZ,MAAM;AACF,QAAMC,IAA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EAAE,YAAYA,EAAA;AAAA,UAAM;AAAA,QACrC;AAAA,MAAA;AAAA,IACJ;AAAA,EAAA;AAIhB;"}
1
+ {"version":3,"file":"Progress.js","sources":["../../src/components/Progress.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * Semantic colour role for a segment. Colours come from theme tokens by design — unlike\n * `color`/`trackColor`, which predate that rule, there is no free-form colour here. To\n * restyle a role, override its token via `applyTheme` / `applyCustomTheme`. `accent` is the\n * brand's interaction colour, for progress through a flow rather than a status.\n */\nexport type ProgressSegmentVariant =\n | 'default'\n | 'success'\n | 'warning'\n | 'error'\n | 'info'\n | 'accent';\n\n/** `hatched` reads as claimed-but-unpaid-for — usage past an allowance, not more of it. */\nexport type ProgressSegmentFill = 'solid' | 'hatched';\n\nexport interface ProgressSegment {\n /** Portion of `max` this segment covers, in the same units. */\n value: number;\n variant?: ProgressSegmentVariant;\n fill?: ProgressSegmentFill;\n}\n\ninterface ProgressCommonProps {\n height?: number;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** Spoken instead of the range, which reads as 100% once segments fill the track. */\n 'aria-valuetext'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface ProgressValueProps extends ProgressCommonProps {\n value: number;\n color?: string;\n trackColor?: string;\n segments?: never;\n max?: never;\n}\n\ninterface ProgressSegmentsProps extends ProgressCommonProps {\n segments: ProgressSegment[];\n /** Scale the segments measure against. Defaults to their sum, and a larger sum wins. */\n max?: number;\n value?: never;\n color?: never;\n trackColor?: never;\n}\n\n/** One fill or a list of segments, never both — `color`/`trackColor` mean nothing to segments. */\nexport type ProgressProps = ProgressValueProps | ProgressSegmentsProps;\n\nconst TRACK_CLASSES = 'w-full overflow-hidden bg-[var(--malachite-card-dimmed-background)]';\nconst FILL_CLASSES =\n 'h-full transition-[width] duration-200 ease-in-out bg-[var(--malachite-text-primary)]';\nconst SEGMENT_CLASSES = 'h-full transition-[width] duration-200 ease-in-out';\n\nconst SEGMENT_COLOR: Record<ProgressSegmentVariant, string> = {\n default: 'var(--malachite-text-primary)',\n success: 'var(--malachite-text-success)',\n warning: 'var(--malachite-text-warning)',\n error: 'var(--malachite-text-error)',\n info: 'var(--malachite-text-info)',\n accent: 'var(--malachite-accent-foreground)',\n};\n\n// Bands sit perpendicular to the gradient axis, so this draws them bottom-left to top-right.\nconst HATCH_AXIS_ANGLE = '135deg';\nconst HATCH_STRIPE_PX = 2;\nconst HATCH_PERIOD_PX = 5;\nconst HATCH_GAP_COLOR = 'var(--malachite-card-dimmed-background)';\n\nconst segmentStyle = (segment: ProgressSegment, widthPercent: number): React.CSSProperties => {\n const color = SEGMENT_COLOR[segment.variant ?? 'default'];\n const base: React.CSSProperties = { width: `${widthPercent}%`, backgroundColor: color };\n if (segment.fill !== 'hatched') {\n return base;\n }\n return {\n ...base,\n backgroundImage: `repeating-linear-gradient(${HATCH_AXIS_ANGLE}, ${color} 0 ${HATCH_STRIPE_PX}px, ${HATCH_GAP_COLOR} ${HATCH_STRIPE_PX}px ${HATCH_PERIOD_PX}px)`,\n };\n};\n\nconst sumOf = (segments: ProgressSegment[]): number =>\n segments.reduce((total, segment) => total + Math.max(0, segment.value), 0);\n\nconst Progress: React.FC<ProgressProps> = ({\n value,\n segments,\n max,\n color,\n trackColor,\n height = 4,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-valuetext': ariaValueText,\n className = '',\n style = {},\n}) => {\n const clamped = Math.max(0, Math.min(100, value ?? 0));\n const radius = Math.max(2, Math.round(height / 2));\n const drawn = segments?.filter((segment) => segment.value > 0) ?? [];\n const segmented = segments !== undefined;\n const total = segmented ? sumOf(drawn) : 0;\n // Only guards the division: flooring at 1 unconditionally would rescale a sub-1 max.\n const requestedScale = Math.max(max ?? total, total);\n const scale = requestedScale > 0 ? requestedScale : 1;\n\n return (\n <div\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={segmented ? scale : 100}\n // Segment totals are arbitrary, so rounding one side could put it past the other.\n aria-valuenow={segmented ? total : Math.round(clamped)}\n aria-valuetext={ariaValueText}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`${TRACK_CLASSES} ${className}`}\n style={{\n height: `${height}px`,\n borderRadius: `${radius}px`,\n ...(trackColor && !segmented && { background: trackColor }),\n ...style,\n }}\n >\n {segmented ? (\n <div className=\"flex h-full w-full\">\n {drawn.map((segment, index) => (\n <div\n // Segments are a positional list with no identity of their own.\n key={`${segment.variant ?? 'default'}-${index}`}\n className={SEGMENT_CLASSES}\n style={segmentStyle(segment, (segment.value / scale) * 100)}\n />\n ))}\n </div>\n ) : (\n <div\n className={FILL_CLASSES}\n style={{\n width: `${clamped}%`,\n ...(color && { background: color }),\n }}\n />\n )}\n </div>\n );\n};\n\nexport default Progress;\nexport { Progress };\n"],"names":["TRACK_CLASSES","FILL_CLASSES","SEGMENT_CLASSES","SEGMENT_COLOR","HATCH_AXIS_ANGLE","HATCH_STRIPE_PX","HATCH_PERIOD_PX","HATCH_GAP_COLOR","segmentStyle","segment","widthPercent","color","base","sumOf","segments","total","Progress","value","max","trackColor","height","ariaLabel","ariaLabelledBy","ariaValueText","className","style","clamped","radius","drawn","segmented","requestedScale","scale","jsx","index"],"mappings":";AAwDA,MAAMA,IAAgB,uEAChBC,IACF,yFACEC,IAAkB,sDAElBC,IAAwD;AAAA,EAC1D,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AACZ,GAGMC,IAAmB,UACnBC,IAAkB,GAClBC,IAAkB,GAClBC,IAAkB,2CAElBC,IAAe,CAACC,GAA0BC,MAA8C;AAC1F,QAAMC,IAAQR,EAAcM,EAAQ,WAAW,SAAS,GAClDG,IAA4B,EAAE,OAAO,GAAGF,CAAY,KAAK,iBAAiBC,EAAA;AAChF,SAAIF,EAAQ,SAAS,YACVG,IAEJ;AAAA,IACH,GAAGA;AAAA,IACH,iBAAiB,6BAA6BR,CAAgB,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a,EAAE,YAAYV,EAAA;AAAA,QAC9C,GAAGM;AAAA,MAAA;AAAA,MAGN,UAAAI,sBACI,OAAA,EAAI,WAAU,sBACV,UAAAD,EAAM,IAAI,CAACnB,GAASwB,MACjB,gBAAAD;AAAA,QAAC;AAAA,QAAA;AAAA,UAGG,WAAW9B;AAAA,UACX,OAAOM,EAAaC,GAAUA,EAAQ,QAAQsB,IAAS,GAAG;AAAA,QAAA;AAAA,QAFrD,GAAGtB,EAAQ,WAAW,SAAS,IAAIwB,CAAK;AAAA,MAAA,CAIpD,GACL,IAEA,gBAAAD;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAW/B;AAAA,UACX,OAAO;AAAA,YACH,OAAO,GAAGyB,CAAO;AAAA,YACjB,GAAIf,KAAS,EAAE,YAAYA,EAAA;AAAA,UAAM;AAAA,QACrC;AAAA,MAAA;AAAA,IACJ;AAAA,EAAA;AAIhB;"}
@@ -1,20 +1,21 @@
1
1
  import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
- import { useMemo as P, useState as C, useCallback as B, forwardRef as O } from "react";
2
+ import { useMemo as z, useState as C, useCallback as B, forwardRef as O } from "react";
3
3
  import L from "./CustomIcons/CaretLeftIcon.js";
4
4
  import G from "./CustomIcons/CaretRightIcon.js";
5
5
  import R from "./CustomIcons/ChevronsUpDownIcon.js";
6
+ import { SidebarProgress as H } from "./SidebarProgress.js";
6
7
  import k from "./Tooltip.js";
7
8
  import g from "./TruncatedTooltip.js";
8
- import { UsageCard as H } from "./UsageCard.js";
9
+ import { UsageCard as U } from "./UsageCard.js";
9
10
  import { isExpanded as v } from "./ariaState.js";
10
- import { BORDER as u, NO_SCROLLBAR as U } from "./chromeStyles.js";
11
+ import { BORDER as u, NO_SCROLLBAR as X } from "./chromeStyles.js";
11
12
  import { FOCUS_RING as y } from "./focusRing.js";
12
- import { useHasOpenOverlay as X, useOverlayBehaviour as V } from "./overlayBehaviour.js";
13
- import { SIDEBAR_WIDTH_PX as S, SidebarContext as F, SIDEBAR_Z_INDEX as h, SIDEBAR_POPOVER_WIDTH_PX as M, SIDEBAR_TOOLTIP_DELAY_S as f, useSidebarCollapsed as Y } from "./sidebarContext.js";
14
- const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14 }, q = "fixed top-[25px] opacity-0 [will-change:opacity] transition-[left,opacity] duration-200 ease-in-out group-hover/sidebar:opacity-100 group-has-[:focus-visible]/sidebar:opacity-100 [@media(hover:none)]:opacity-100", J = {
13
+ import { useHasOpenOverlay as V, useOverlayBehaviour as F } from "./overlayBehaviour.js";
14
+ import { SIDEBAR_WIDTH_PX as S, SidebarContext as M, SIDEBAR_Z_INDEX as h, SIDEBAR_POPOVER_WIDTH_PX as Y, SIDEBAR_TOOLTIP_DELAY_S as f, useSidebarCollapsed as W } from "./sidebarContext.js";
15
+ const s = () => ({ collapsed: W() }), Z = 1, q = 24, E = { width: 8, height: 14 }, J = "fixed top-[25px] opacity-0 [will-change:opacity] transition-[left,opacity] duration-200 ease-in-out group-hover/sidebar:opacity-100 group-has-[:focus-visible]/sidebar:opacity-100 [@media(hover:none)]:opacity-100", K = {
15
16
  "--malachite-ctx-navitem-ground": "var(--malachite-card-sunken-background, rgb(250,250,250))"
16
- }, K = () => {
17
- }, I = (e, { overlay: t, collapsed: a, canToggle: n, blocked: c }) => t ? a ? "rail" : n ? e === "off" || e === "drawer" ? e : c ? "waiting" : "drawer" : "off" : "off", Q = ({
17
+ }, Q = () => {
18
+ }, I = (e, { overlay: t, collapsed: a, canToggle: n, blocked: c }) => t ? a ? "rail" : n ? e === "off" || e === "drawer" ? e : c ? "waiting" : "drawer" : "off" : "off", ee = ({
18
19
  collapsed: e = !1,
19
20
  overlay: t = !1,
20
21
  onToggleCollapse: a,
@@ -23,20 +24,20 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
23
24
  "aria-label": l = "Main",
24
25
  children: p
25
26
  }) => {
26
- const i = e ? n : c, o = P(() => ({ collapsed: e }), [e]), x = e ? S.collapsed : S.expanded, A = X(), N = {
27
+ const o = e ? n : c, i = z(() => ({ collapsed: e }), [e]), x = e ? S.collapsed : S.expanded, A = V(), N = {
27
28
  overlay: t,
28
29
  collapsed: e,
29
30
  canToggle: a !== void 0,
30
31
  blocked: A
31
32
  }, [w, _] = C(() => I("off", N)), b = I(w, N);
32
33
  b !== w && _(b);
33
- const m = b === "drawer", T = B(() => _("waiting"), []), { ref: j, isTopmost: z } = V({
34
+ const m = b === "drawer", T = B(() => _("waiting"), []), { ref: j, isTopmost: P } = F({
34
35
  open: m,
35
- onClose: a ?? K,
36
+ onClose: a ?? Q,
36
37
  initialFocus: "content",
37
38
  onYield: T
38
39
  });
39
- return /* @__PURE__ */ d(F.Provider, { value: o, children: [
40
+ return /* @__PURE__ */ d(M.Provider, { value: i, children: [
40
41
  t && /* @__PURE__ */ r(
41
42
  "div",
42
43
  {
@@ -51,22 +52,22 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
51
52
  {
52
53
  ref: j,
53
54
  role: m ? "dialog" : void 0,
54
- "aria-modal": m && z ? "true" : void 0,
55
+ "aria-modal": m && P ? "true" : void 0,
55
56
  "aria-label": m ? l : void 0,
56
57
  className: "group/sidebar fixed top-0 bottom-0 left-0 box-border pt-[9px] bg-[var(--malachite-card-sunken-background,rgb(250,250,250))] transition-[width] duration-200 ease-in-out",
57
- style: { width: x, zIndex: h, ...J },
58
+ style: { width: x, zIndex: h, ...K },
58
59
  children: [
59
60
  /* @__PURE__ */ r("nav", { "aria-label": l, className: "flex h-full flex-col", children: p }),
60
61
  a && /* @__PURE__ */ r(
61
62
  "div",
62
63
  {
63
- className: q,
64
- style: { left: x - Z / 2, zIndex: h + 1 },
65
- children: /* @__PURE__ */ r(k, { text: i, placement: "right", describesTrigger: !1, children: /* @__PURE__ */ r(
64
+ className: J,
65
+ style: { left: x - q / 2, zIndex: h + 1 },
66
+ children: /* @__PURE__ */ r(k, { text: o, placement: "right", describesTrigger: !1, children: /* @__PURE__ */ r(
66
67
  "button",
67
68
  {
68
69
  type: "button",
69
- "aria-label": i,
70
+ "aria-label": o,
70
71
  onClick: a,
71
72
  className: `m-0 inline-flex size-6 cursor-pointer items-center justify-center rounded-lg border border-solid p-0 ${u} bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-secondary,rgb(123,123,123))] [box-shadow:var(--malachite-shadow-default,0px_1px_0px_0px_rgba(0,0,0,0.15))] transition-colors duration-200 hover:border-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] ${y}`,
72
73
  children: e ? /* @__PURE__ */ r(G, { size: 12 }) : /* @__PURE__ */ r(L, { size: 12 })
@@ -78,7 +79,7 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
78
79
  }
79
80
  )
80
81
  ] });
81
- }, ee = ({ children: e }) => {
82
+ }, re = ({ children: e }) => {
82
83
  const { collapsed: t } = s();
83
84
  return /* @__PURE__ */ r(
84
85
  "div",
@@ -87,7 +88,7 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
87
88
  children: e
88
89
  }
89
90
  );
90
- }, re = ({ children: e }) => /* @__PURE__ */ r("div", { className: `min-h-0 flex-1 overflow-x-hidden overflow-y-auto ${U}`, children: e }), te = ({ children: e }) => {
91
+ }, te = ({ children: e }) => /* @__PURE__ */ r("div", { className: `min-h-0 flex-1 overflow-x-hidden overflow-y-auto ${X}`, children: e }), ae = ({ children: e }) => {
91
92
  const { collapsed: t } = s();
92
93
  return /* @__PURE__ */ r(
93
94
  "div",
@@ -96,19 +97,19 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
96
97
  children: e
97
98
  }
98
99
  );
99
- }, ae = ({ children: e }) => /* @__PURE__ */ r("div", { className: "my-[2px] flex flex-col gap-[6px]", children: e }), ie = ({ children: e }) => /* @__PURE__ */ r("div", { className: "flex flex-col gap-[6px]", children: e }), oe = ({ children: e }) => {
100
+ }, oe = ({ children: e }) => /* @__PURE__ */ r("div", { className: "my-[2px] flex flex-col gap-[6px]", children: e }), ie = ({ children: e }) => /* @__PURE__ */ r("div", { className: "flex flex-col gap-[6px]", children: e }), se = ({ children: e }) => {
100
101
  const { collapsed: t } = s();
101
102
  return /* @__PURE__ */ r("div", { className: `flex pt-5 pb-[18px] ${t ? "justify-center px-3" : "px-4"}`, children: e });
102
- }, se = ({
103
+ }, ne = ({
103
104
  children: e,
104
105
  "aria-label": t
105
106
  }) => {
106
107
  const { collapsed: a } = s();
107
108
  return a ? null : /* @__PURE__ */ r("div", { role: "status", "aria-label": t, className: "flex flex-col gap-2 px-3 pt-4", children: e });
108
- }, ne = () => {
109
+ }, le = () => {
109
110
  const { collapsed: e } = s();
110
111
  return e ? null : /* @__PURE__ */ r("hr", { className: `m-0 my-2 h-0 shrink-0 border-0 border-t border-solid ${u}` });
111
- }, le = ({ children: e }) => {
112
+ }, ce = ({ children: e }) => {
112
113
  const { collapsed: t } = s();
113
114
  return /* @__PURE__ */ r(
114
115
  "div",
@@ -118,16 +119,16 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
118
119
  }
119
120
  );
120
121
  }, $ = O(
121
- ({ logo: e, title: t, subtitle: a, titleTooltip: n, subtitleTooltip: c, className: l = "", ...p }, i) => {
122
- const { collapsed: o } = s(), x = v(p["aria-expanded"]);
122
+ ({ logo: e, title: t, subtitle: a, titleTooltip: n, subtitleTooltip: c, className: l = "", ...p }, o) => {
123
+ const { collapsed: i } = s(), x = v(p["aria-expanded"]);
123
124
  return /* @__PURE__ */ d(
124
125
  "button",
125
126
  {
126
- ref: i,
127
+ ref: o,
127
128
  type: "button",
128
- "aria-label": o ? t : void 0,
129
+ "aria-label": i ? t : void 0,
129
130
  ...p,
130
- className: `group/switcher m-0 box-border flex h-full w-full min-w-0 cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans text-left ${o ? "justify-center p-1" : "justify-between px-4 py-[6px]"} ${y} ${l}`.trim(),
131
+ className: `group/switcher m-0 box-border flex h-full w-full min-w-0 cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans text-left ${i ? "justify-center p-1" : "justify-between px-4 py-[6px]"} ${y} ${l}`.trim(),
131
132
  children: [
132
133
  /* @__PURE__ */ d("span", { className: "flex min-w-0 items-center gap-4", children: [
133
134
  /* @__PURE__ */ r(
@@ -138,7 +139,7 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
138
139
  children: e
139
140
  }
140
141
  ),
141
- !o && /* @__PURE__ */ d("span", { className: "flex min-w-0 flex-col gap-1", children: [
142
+ !i && /* @__PURE__ */ d("span", { className: "flex min-w-0 flex-col gap-1", children: [
142
143
  /* @__PURE__ */ r(
143
144
  g,
144
145
  {
@@ -167,27 +168,27 @@ const s = () => ({ collapsed: Y() }), W = 1, Z = 24, E = { width: 8, height: 14
167
168
  )
168
169
  ] })
169
170
  ] }),
170
- !o && /* @__PURE__ */ r("span", { className: "flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/switcher:text-[var(--malachite-text-primary,rgb(10,10,10))]", children: /* @__PURE__ */ r(R, { style: E }) })
171
+ !i && /* @__PURE__ */ r("span", { className: "flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/switcher:text-[var(--malachite-text-primary,rgb(10,10,10))]", children: /* @__PURE__ */ r(R, { style: E }) })
171
172
  ]
172
173
  }
173
174
  );
174
175
  }
175
176
  );
176
177
  $.displayName = "Sidebar.Switcher";
177
- const ce = `inline-flex items-center justify-center rounded-[var(--malachite-radius-md,6px)] border border-solid ${u} bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] supports-[color:color-mix(in_srgb,red,red)]:border-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_20%,transparent)] supports-[color:color-mix(in_srgb,red,red)]:bg-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_10%,transparent)] px-1 py-[3px] text-[length:var(--malachite-font-size-small,13px)] leading-[12px] font-semibold text-[var(--malachite-text-secondary,rgb(123,123,123))]`, D = O(
178
+ const de = `inline-flex items-center justify-center rounded-[var(--malachite-radius-md,6px)] border border-solid ${u} bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] supports-[color:color-mix(in_srgb,red,red)]:border-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_20%,transparent)] supports-[color:color-mix(in_srgb,red,red)]:bg-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_10%,transparent)] px-1 py-[3px] text-[length:var(--malachite-font-size-small,13px)] leading-[12px] font-semibold text-[var(--malachite-text-secondary,rgb(123,123,123))]`, D = O(
178
179
  ({ avatar: e, initials: t, name: a, tooltip: n, className: c = "", ...l }, p) => {
179
- const { collapsed: i } = s(), o = /* @__PURE__ */ d(
180
+ const { collapsed: o } = s(), i = /* @__PURE__ */ d(
180
181
  "button",
181
182
  {
182
183
  ref: p,
183
184
  type: "button",
184
- "aria-label": i ? a : void 0,
185
+ "aria-label": o ? a : void 0,
185
186
  ...l,
186
- className: `group/account m-0 box-border flex min-h-8 w-full cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans ${i ? "justify-center p-0" : "justify-between px-2"} ${y} ${c}`.trim(),
187
+ className: `group/account m-0 box-border flex min-h-8 w-full cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans ${o ? "justify-center p-0" : "justify-between px-2"} ${y} ${c}`.trim(),
187
188
  children: [
188
189
  /* @__PURE__ */ d("span", { className: "flex min-w-0 items-center gap-3", children: [
189
- /* @__PURE__ */ r("span", { "aria-hidden": i ? void 0 : !0, className: "flex shrink-0", children: e ?? (t ? /* @__PURE__ */ r("span", { className: ce, children: t }) : null) }),
190
- !i && /* @__PURE__ */ r(
190
+ /* @__PURE__ */ r("span", { "aria-hidden": o ? void 0 : !0, className: "flex shrink-0", children: e ?? (t ? /* @__PURE__ */ r("span", { className: de, children: t }) : null) }),
191
+ !o && /* @__PURE__ */ r(
191
192
  g,
192
193
  {
193
194
  text: a ? n ?? a : void 0,
@@ -201,11 +202,11 @@ const ce = `inline-flex items-center justify-center rounded-[var(--malachite-rad
201
202
  }
202
203
  )
203
204
  ] }),
204
- !i && /* @__PURE__ */ r("span", { className: "flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/account:text-[var(--malachite-text-primary,rgb(10,10,10))]", children: /* @__PURE__ */ r(R, { style: E }) })
205
+ !o && /* @__PURE__ */ r("span", { className: "flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/account:text-[var(--malachite-text-primary,rgb(10,10,10))]", children: /* @__PURE__ */ r(R, { style: E }) })
205
206
  ]
206
207
  }
207
208
  );
208
- return i ? /* @__PURE__ */ r(
209
+ return o ? /* @__PURE__ */ r(
209
210
  k,
210
211
  {
211
212
  text: a ? n ?? a : void 0,
@@ -213,35 +214,36 @@ const ce = `inline-flex items-center justify-center rounded-[var(--malachite-rad
213
214
  delay: f,
214
215
  describesTrigger: !1,
215
216
  suppressed: v(l["aria-expanded"]),
216
- children: o
217
+ children: i
217
218
  }
218
- ) : o;
219
+ ) : i;
219
220
  }
220
221
  );
221
222
  D.displayName = "Sidebar.Account";
222
- const de = (e) => {
223
+ const pe = (e) => {
223
224
  const { collapsed: t } = s();
224
- return t ? null : /* @__PURE__ */ r("div", { className: "shrink-0 px-3 pt-3 pb-4", children: /* @__PURE__ */ r(H, { ...e }) });
225
- }, pe = ({
225
+ return t ? null : /* @__PURE__ */ r("div", { className: "shrink-0 px-3 pt-3 pb-4", children: /* @__PURE__ */ r(U, { ...e }) });
226
+ }, me = ({
226
227
  children: e,
227
- width: t = M
228
- }) => /* @__PURE__ */ r("div", { className: "flex flex-col", style: { width: t - 2 * W }, children: e }), Ie = Object.assign(Q, {
229
- Header: ee,
230
- Body: re,
231
- Section: te,
232
- Group: ae,
228
+ width: t = Y
229
+ }) => /* @__PURE__ */ r("div", { className: "flex flex-col", style: { width: t - 2 * Z }, children: e }), Re = Object.assign(ee, {
230
+ Header: re,
231
+ Body: te,
232
+ Section: ae,
233
+ Group: oe,
233
234
  GroupItems: ie,
234
- Search: oe,
235
- Notices: se,
236
- Divider: ne,
237
- Footer: le,
235
+ Search: se,
236
+ Notices: ne,
237
+ Divider: le,
238
+ Footer: ce,
238
239
  Switcher: $,
239
240
  Account: D,
240
- Usage: de,
241
- Panel: pe
241
+ Usage: pe,
242
+ Progress: H,
243
+ Panel: me
242
244
  });
243
245
  export {
244
- Ie as Sidebar,
245
- Ie as default
246
+ Re as Sidebar,
247
+ Re as default
246
248
  };
247
249
  //# sourceMappingURL=Sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.js","sources":["../../src/components/Sidebar.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState } from 'react';\nimport CaretLeftIcon from './CustomIcons/CaretLeftIcon';\nimport CaretRightIcon from './CustomIcons/CaretRightIcon';\nimport ChevronsUpDownIcon from './CustomIcons/ChevronsUpDownIcon';\nimport Tooltip from './Tooltip';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport UsageCard, { type UsageCardProps } from './UsageCard';\nimport { isExpanded } from './ariaState';\nimport { BORDER, NO_SCROLLBAR } from './chromeStyles';\nimport { FOCUS_RING } from './focusRing';\nimport { useHasOpenOverlay, useOverlayBehaviour } from './overlayBehaviour';\nimport {\n SIDEBAR_POPOVER_WIDTH_PX,\n SIDEBAR_TOOLTIP_DELAY_S,\n SIDEBAR_WIDTH_PX,\n SIDEBAR_Z_INDEX,\n SidebarContext,\n useSidebarCollapsed,\n} from './sidebarContext';\n\nconst useSidebar = () => ({ collapsed: useSidebarCollapsed() });\n\nconst POPOVER_BORDER_PX = 1;\nconst TOGGLE_SIZE_PX = 24;\nconst CHEVRONS = { width: 8, height: 14 } as const;\n\nexport interface SidebarProps {\n collapsed?: boolean;\n /** Expanded from its rail, the sidebar floats over the page as a modal drawer: a scrim, Escape\n * and a focus trap, each of which collapses it through `onToggleCollapse`. For viewports\n * under `SIDEBAR_OVERLAY_BREAKPOINT_PX`; collapse it on entering, as a drawer starts shut. */\n overlay?: boolean;\n onToggleCollapse?: () => void;\n expandLabel?: string;\n collapseLabel?: string;\n 'aria-label'?: string;\n children: React.ReactNode;\n}\n\n// Hidden by opacity, not visibility, so the half over the page can be hovered; touch always shows it.\nconst TOGGLE_LAYER =\n 'fixed top-[25px] opacity-0 [will-change:opacity] transition-[left,opacity] duration-200 ease-in-out group-hover/sidebar:opacity-100 group-has-[:focus-visible]/sidebar:opacity-100 [@media(hover:none)]:opacity-100';\n\n// The rows' ground, which a `NavItem` puts under its tag. A context channel, not a theme token.\nconst NAVITEM_GROUND = {\n '--malachite-ctx-navitem-ground': 'var(--malachite-card-sunken-background, rgb(250,250,250))',\n} as React.CSSProperties;\n\nconst noop = () => undefined;\n\ntype DrawerState = 'off' | 'rail' | 'waiting' | 'drawer';\ntype DrawerInputs = Record<'overlay' | 'collapsed' | 'canToggle' | 'blocked', boolean>;\n\n// A drawer only once expanded from the rail: expanded on mount or across the breakpoint it would\n// take focus from the page. Expanded under another dialog, it waits for that dialog to close.\nconst nextDrawerState = (\n previous: DrawerState,\n { overlay, collapsed, canToggle, blocked }: DrawerInputs,\n): DrawerState => {\n if (!overlay) return 'off';\n if (collapsed) return 'rail';\n if (!canToggle) return 'off';\n if (previous === 'off' || previous === 'drawer') return previous;\n return blocked ? 'waiting' : 'drawer';\n};\n\nconst SidebarRoot: React.FC<SidebarProps> = ({\n collapsed = false,\n overlay = false,\n onToggleCollapse,\n expandLabel = 'Expand menu',\n collapseLabel = 'Collapse menu',\n 'aria-label': ariaLabel = 'Main',\n children,\n}) => {\n const toggleLabel = collapsed ? expandLabel : collapseLabel;\n const context = useMemo(() => ({ collapsed }), [collapsed]);\n const width = collapsed ? SIDEBAR_WIDTH_PX.collapsed : SIDEBAR_WIDTH_PX.expanded;\n const otherOverlayOpen = useHasOpenOverlay();\n const inputs = {\n overlay,\n collapsed,\n canToggle: onToggleCollapse !== undefined,\n blocked: otherOverlayOpen,\n };\n const [drawerState, setDrawerState] = useState(() => nextDrawerState('off', inputs));\n const nextState = nextDrawerState(drawerState, inputs);\n if (nextState !== drawerState) {\n setDrawerState(nextState);\n }\n const open = nextState === 'drawer';\n const yieldDrawer = useCallback(() => setDrawerState('waiting'), []);\n const { ref: overlayRef, isTopmost } = useOverlayBehaviour({\n open,\n onClose: onToggleCollapse ?? noop,\n initialFocus: 'content',\n onYield: yieldDrawer,\n });\n\n return (\n <SidebarContext.Provider value={context}>\n {overlay && (\n <div\n aria-hidden=\"true\"\n onClick={open ? onToggleCollapse : undefined}\n className={`fixed inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${open ? 'opacity-100' : 'pointer-events-none opacity-0'}`}\n style={{ zIndex: SIDEBAR_Z_INDEX - 1 }}\n />\n )}\n <aside\n ref={overlayRef}\n role={open ? 'dialog' : undefined}\n aria-modal={open && isTopmost ? 'true' : undefined}\n aria-label={open ? ariaLabel : undefined}\n className=\"group/sidebar fixed top-0 bottom-0 left-0 box-border pt-[9px] bg-[var(--malachite-card-sunken-background,rgb(250,250,250))] transition-[width] duration-200 ease-in-out\"\n style={{ width, zIndex: SIDEBAR_Z_INDEX, ...NAVITEM_GROUND }}\n >\n <nav aria-label={ariaLabel} className=\"flex h-full flex-col\">\n {children}\n </nav>\n {onToggleCollapse && (\n <div\n className={TOGGLE_LAYER}\n style={{ left: width - TOGGLE_SIZE_PX / 2, zIndex: SIDEBAR_Z_INDEX + 1 }}\n >\n <Tooltip text={toggleLabel} placement=\"right\" describesTrigger={false}>\n <button\n type=\"button\"\n aria-label={toggleLabel}\n onClick={onToggleCollapse}\n className={`m-0 inline-flex size-6 cursor-pointer items-center justify-center rounded-lg border border-solid p-0 ${BORDER} bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-secondary,rgb(123,123,123))] [box-shadow:var(--malachite-shadow-default,0px_1px_0px_0px_rgba(0,0,0,0.15))] transition-colors duration-200 hover:border-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] ${FOCUS_RING}`}\n >\n {collapsed ? (\n <CaretRightIcon size={12} />\n ) : (\n <CaretLeftIcon size={12} />\n )}\n </button>\n </Tooltip>\n </div>\n )}\n </aside>\n </SidebarContext.Provider>\n );\n};\n\nconst Header: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div\n className={`box-border flex h-14 shrink-0 items-center border-0 border-b border-solid ${BORDER} py-[6px] ${collapsed ? 'px-1' : 'px-2'}`}\n >\n {children}\n </div>\n );\n};\n\nconst Body: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className={`min-h-0 flex-1 overflow-x-hidden overflow-y-auto ${NO_SCROLLBAR}`}>\n {children}\n </div>\n);\n\nconst Section: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div\n className={`flex flex-col gap-[2px] py-[2px] ${collapsed ? 'items-center px-3' : 'px-4'}`}\n >\n {children}\n </div>\n );\n};\n\nconst Group: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"my-[2px] flex flex-col gap-[6px]\">{children}</div>\n);\n\nconst GroupItems: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"flex flex-col gap-[6px]\">{children}</div>\n);\n\nconst Search: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div className={`flex pt-5 pb-[18px] ${collapsed ? 'justify-center px-3' : 'px-4'}`}>\n {children}\n </div>\n );\n};\n\nconst Notices: React.FC<{ children: React.ReactNode; 'aria-label': string }> = ({\n children,\n 'aria-label': ariaLabel,\n}) => {\n const { collapsed } = useSidebar();\n if (collapsed) {\n return null;\n }\n return (\n <div role=\"status\" aria-label={ariaLabel} className=\"flex flex-col gap-2 px-3 pt-4\">\n {children}\n </div>\n );\n};\n\nconst Divider: React.FC = () => {\n const { collapsed } = useSidebar();\n if (collapsed) {\n return null;\n }\n return <hr className={`m-0 my-2 h-0 shrink-0 border-0 border-t border-solid ${BORDER}`} />;\n};\n\nconst Footer: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div\n className={`mt-1 flex shrink-0 border-0 border-t border-solid ${BORDER} py-3 ${collapsed ? 'justify-center px-2' : 'px-4'}`}\n >\n {children}\n </div>\n );\n};\n\ntype SidebarButtonAttributes = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'style' | 'color' | 'children' | 'title' | 'name'\n>;\n\nexport interface SidebarSwitcherProps extends SidebarButtonAttributes {\n logo: React.ReactNode;\n title: string;\n subtitle?: string;\n /** Shown when `title` is cut off; a node so it can be wrapped. Defaults to `title`. */\n titleTooltip?: React.ReactNode;\n /** As `titleTooltip`, for `subtitle`. */\n subtitleTooltip?: React.ReactNode;\n}\n\nconst Switcher = forwardRef<HTMLButtonElement, SidebarSwitcherProps>(\n ({ logo, title, subtitle, titleTooltip, subtitleTooltip, className = '', ...rest }, ref) => {\n const { collapsed } = useSidebar();\n const open = isExpanded(rest['aria-expanded']);\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-label={collapsed ? title : undefined}\n {...rest}\n className={`group/switcher m-0 box-border flex h-full w-full min-w-0 cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans text-left ${collapsed ? 'justify-center p-1' : 'justify-between px-4 py-[6px]'} ${FOCUS_RING} ${className}`.trim()}\n >\n <span className=\"flex min-w-0 items-center gap-4\">\n <span\n aria-hidden=\"true\"\n className=\"relative top-[-2.5px] flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-md [&_img]:size-6 [&_img]:object-contain\"\n >\n {logo}\n </span>\n {!collapsed && (\n <span className=\"flex min-w-0 flex-col gap-1\">\n <TruncatedTooltip\n text={titleTooltip ?? title}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={open}\n className=\"text-[length:var(--malachite-font-size-medium,14px)] leading-[14px] font-medium text-[var(--malachite-text-primary,rgb(10,10,10))]\"\n >\n {title}\n </TruncatedTooltip>\n {subtitle && (\n <TruncatedTooltip\n text={subtitleTooltip ?? subtitle}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={open}\n className=\"text-[12px] leading-[12px] font-normal text-[var(--malachite-text-secondary,rgb(123,123,123))]\"\n >\n {subtitle}\n </TruncatedTooltip>\n )}\n </span>\n )}\n </span>\n {!collapsed && (\n <span className=\"flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/switcher:text-[var(--malachite-text-primary,rgb(10,10,10))]\">\n <ChevronsUpDownIcon style={CHEVRONS} />\n </span>\n )}\n </button>\n );\n },\n);\nSwitcher.displayName = 'Sidebar.Switcher';\n\nexport interface SidebarAccountProps extends SidebarButtonAttributes {\n avatar?: React.ReactNode;\n initials?: string;\n name: string;\n /** Collapsed-rail tooltip, and expanded when `name` is cut off; a node so `name` can be wrapped.\n * Should read as `name`. Defaults to `name`, `false` hides it; none when `name` is empty. */\n tooltip?: React.ReactNode;\n}\n\nconst INITIALS = `inline-flex items-center justify-center rounded-[var(--malachite-radius-md,6px)] border border-solid ${BORDER} bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] supports-[color:color-mix(in_srgb,red,red)]:border-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_20%,transparent)] supports-[color:color-mix(in_srgb,red,red)]:bg-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_10%,transparent)] px-1 py-[3px] text-[length:var(--malachite-font-size-small,13px)] leading-[12px] font-semibold text-[var(--malachite-text-secondary,rgb(123,123,123))]`;\n\nconst Account = forwardRef<HTMLButtonElement, SidebarAccountProps>(\n ({ avatar, initials, name, tooltip, className = '', ...rest }, ref) => {\n const { collapsed } = useSidebar();\n const button = (\n <button\n ref={ref}\n type=\"button\"\n aria-label={collapsed ? name : undefined}\n {...rest}\n className={`group/account m-0 box-border flex min-h-8 w-full cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans ${collapsed ? 'justify-center p-0' : 'justify-between px-2'} ${FOCUS_RING} ${className}`.trim()}\n >\n <span className=\"flex min-w-0 items-center gap-3\">\n <span aria-hidden={collapsed ? undefined : true} className=\"flex shrink-0\">\n {avatar ?? (initials ? <span className={INITIALS}>{initials}</span> : null)}\n </span>\n {!collapsed && (\n <TruncatedTooltip\n text={name ? (tooltip ?? name) : undefined}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={isExpanded(rest['aria-expanded'])}\n className=\"min-w-0 text-[length:var(--malachite-font-size-medium,14px)] leading-[22px] font-semibold text-[var(--malachite-text-primary,rgb(10,10,10))]\"\n >\n {name}\n </TruncatedTooltip>\n )}\n </span>\n {!collapsed && (\n <span className=\"flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/account:text-[var(--malachite-text-primary,rgb(10,10,10))]\">\n <ChevronsUpDownIcon style={CHEVRONS} />\n </span>\n )}\n </button>\n );\n return collapsed ? (\n <Tooltip\n text={name ? (tooltip ?? name) : undefined}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n describesTrigger={false}\n suppressed={isExpanded(rest['aria-expanded'])}\n >\n {button}\n </Tooltip>\n ) : (\n button\n );\n },\n);\nAccount.displayName = 'Sidebar.Account';\n\nconst Usage: React.FC<UsageCardProps> = (props) => {\n const { collapsed } = useSidebar();\n if (collapsed) {\n return null;\n }\n return (\n <div className=\"shrink-0 px-3 pt-3 pb-4\">\n <UsageCard {...props} />\n </div>\n );\n};\n\n/** `width` widens a popover past the sidebar's, for a menu wider than the control it opens from. */\nconst Panel: React.FC<{ children: React.ReactNode; width?: number }> = ({\n children,\n width = SIDEBAR_POPOVER_WIDTH_PX,\n}) => (\n <div className=\"flex flex-col\" style={{ width: width - 2 * POPOVER_BORDER_PX }}>\n {children}\n </div>\n);\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header,\n Body,\n Section,\n Group,\n GroupItems,\n Search,\n Notices,\n Divider,\n Footer,\n Switcher,\n Account,\n Usage,\n Panel,\n});\n\nexport default Sidebar;\n"],"names":["useSidebar","useSidebarCollapsed","POPOVER_BORDER_PX","TOGGLE_SIZE_PX","CHEVRONS","TOGGLE_LAYER","NAVITEM_GROUND","noop","nextDrawerState","previous","overlay","collapsed","canToggle","blocked","SidebarRoot","onToggleCollapse","expandLabel","collapseLabel","ariaLabel","children","toggleLabel","context","useMemo","width","SIDEBAR_WIDTH_PX","otherOverlayOpen","useHasOpenOverlay","inputs","drawerState","setDrawerState","useState","nextState","open","yieldDrawer","useCallback","overlayRef","isTopmost","useOverlayBehaviour","jsxs","SidebarContext","jsx","SIDEBAR_Z_INDEX","Tooltip","BORDER","FOCUS_RING","CaretRightIcon","CaretLeftIcon","Header","Body","NO_SCROLLBAR","Section","Group","GroupItems","Search","Notices","Divider","Footer","Switcher","forwardRef","logo","title","subtitle","titleTooltip","subtitleTooltip","className","rest","ref","isExpanded","TruncatedTooltip","SIDEBAR_TOOLTIP_DELAY_S","ChevronsUpDownIcon","INITIALS","Account","avatar","initials","name","tooltip","button","Usage","props","UsageCard","Panel","SIDEBAR_POPOVER_WIDTH_PX","Sidebar"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,IAAa,OAAO,EAAE,WAAWC,IAAoB,IAErDC,IAAoB,GACpBC,IAAiB,IACjBC,IAAW,EAAE,OAAO,GAAG,QAAQ,GAAA,GAgB/BC,IACF,uNAGEC,IAAiB;AAAA,EACnB,kCAAkC;AACtC,GAEMC,IAAO,MAAA;AAAA,GAO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AAC;AAAA,EACA,SAAAe;AAAA,EACA,OAAAM;AAAA,EACA,OAAAG;AACJ,CAAC;"}
1
+ {"version":3,"file":"Sidebar.js","sources":["../../src/components/Sidebar.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState } from 'react';\nimport CaretLeftIcon from './CustomIcons/CaretLeftIcon';\nimport CaretRightIcon from './CustomIcons/CaretRightIcon';\nimport ChevronsUpDownIcon from './CustomIcons/ChevronsUpDownIcon';\nimport SidebarProgress from './SidebarProgress';\nimport Tooltip from './Tooltip';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport UsageCard, { type UsageCardProps } from './UsageCard';\nimport { isExpanded } from './ariaState';\nimport { BORDER, NO_SCROLLBAR } from './chromeStyles';\nimport { FOCUS_RING } from './focusRing';\nimport { useHasOpenOverlay, useOverlayBehaviour } from './overlayBehaviour';\nimport {\n SIDEBAR_POPOVER_WIDTH_PX,\n SIDEBAR_TOOLTIP_DELAY_S,\n SIDEBAR_WIDTH_PX,\n SIDEBAR_Z_INDEX,\n SidebarContext,\n useSidebarCollapsed,\n} from './sidebarContext';\n\nconst useSidebar = () => ({ collapsed: useSidebarCollapsed() });\n\nconst POPOVER_BORDER_PX = 1;\nconst TOGGLE_SIZE_PX = 24;\nconst CHEVRONS = { width: 8, height: 14 } as const;\n\nexport interface SidebarProps {\n collapsed?: boolean;\n /** Expanded from its rail, the sidebar floats over the page as a modal drawer: a scrim, Escape\n * and a focus trap, each of which collapses it through `onToggleCollapse`. For viewports\n * under `SIDEBAR_OVERLAY_BREAKPOINT_PX`; collapse it on entering, as a drawer starts shut. */\n overlay?: boolean;\n onToggleCollapse?: () => void;\n expandLabel?: string;\n collapseLabel?: string;\n 'aria-label'?: string;\n children: React.ReactNode;\n}\n\n// Hidden by opacity, not visibility, so the half over the page can be hovered; touch always shows it.\nconst TOGGLE_LAYER =\n 'fixed top-[25px] opacity-0 [will-change:opacity] transition-[left,opacity] duration-200 ease-in-out group-hover/sidebar:opacity-100 group-has-[:focus-visible]/sidebar:opacity-100 [@media(hover:none)]:opacity-100';\n\n// The rows' ground, which a `NavItem` puts under its tag. A context channel, not a theme token.\nconst NAVITEM_GROUND = {\n '--malachite-ctx-navitem-ground': 'var(--malachite-card-sunken-background, rgb(250,250,250))',\n} as React.CSSProperties;\n\nconst noop = () => undefined;\n\ntype DrawerState = 'off' | 'rail' | 'waiting' | 'drawer';\ntype DrawerInputs = Record<'overlay' | 'collapsed' | 'canToggle' | 'blocked', boolean>;\n\n// A drawer only once expanded from the rail: expanded on mount or across the breakpoint it would\n// take focus from the page. Expanded under another dialog, it waits for that dialog to close.\nconst nextDrawerState = (\n previous: DrawerState,\n { overlay, collapsed, canToggle, blocked }: DrawerInputs,\n): DrawerState => {\n if (!overlay) return 'off';\n if (collapsed) return 'rail';\n if (!canToggle) return 'off';\n if (previous === 'off' || previous === 'drawer') return previous;\n return blocked ? 'waiting' : 'drawer';\n};\n\nconst SidebarRoot: React.FC<SidebarProps> = ({\n collapsed = false,\n overlay = false,\n onToggleCollapse,\n expandLabel = 'Expand menu',\n collapseLabel = 'Collapse menu',\n 'aria-label': ariaLabel = 'Main',\n children,\n}) => {\n const toggleLabel = collapsed ? expandLabel : collapseLabel;\n const context = useMemo(() => ({ collapsed }), [collapsed]);\n const width = collapsed ? SIDEBAR_WIDTH_PX.collapsed : SIDEBAR_WIDTH_PX.expanded;\n const otherOverlayOpen = useHasOpenOverlay();\n const inputs = {\n overlay,\n collapsed,\n canToggle: onToggleCollapse !== undefined,\n blocked: otherOverlayOpen,\n };\n const [drawerState, setDrawerState] = useState(() => nextDrawerState('off', inputs));\n const nextState = nextDrawerState(drawerState, inputs);\n if (nextState !== drawerState) {\n setDrawerState(nextState);\n }\n const open = nextState === 'drawer';\n const yieldDrawer = useCallback(() => setDrawerState('waiting'), []);\n const { ref: overlayRef, isTopmost } = useOverlayBehaviour({\n open,\n onClose: onToggleCollapse ?? noop,\n initialFocus: 'content',\n onYield: yieldDrawer,\n });\n\n return (\n <SidebarContext.Provider value={context}>\n {overlay && (\n <div\n aria-hidden=\"true\"\n onClick={open ? onToggleCollapse : undefined}\n className={`fixed inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${open ? 'opacity-100' : 'pointer-events-none opacity-0'}`}\n style={{ zIndex: SIDEBAR_Z_INDEX - 1 }}\n />\n )}\n <aside\n ref={overlayRef}\n role={open ? 'dialog' : undefined}\n aria-modal={open && isTopmost ? 'true' : undefined}\n aria-label={open ? ariaLabel : undefined}\n className=\"group/sidebar fixed top-0 bottom-0 left-0 box-border pt-[9px] bg-[var(--malachite-card-sunken-background,rgb(250,250,250))] transition-[width] duration-200 ease-in-out\"\n style={{ width, zIndex: SIDEBAR_Z_INDEX, ...NAVITEM_GROUND }}\n >\n <nav aria-label={ariaLabel} className=\"flex h-full flex-col\">\n {children}\n </nav>\n {onToggleCollapse && (\n <div\n className={TOGGLE_LAYER}\n style={{ left: width - TOGGLE_SIZE_PX / 2, zIndex: SIDEBAR_Z_INDEX + 1 }}\n >\n <Tooltip text={toggleLabel} placement=\"right\" describesTrigger={false}>\n <button\n type=\"button\"\n aria-label={toggleLabel}\n onClick={onToggleCollapse}\n className={`m-0 inline-flex size-6 cursor-pointer items-center justify-center rounded-lg border border-solid p-0 ${BORDER} bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-secondary,rgb(123,123,123))] [box-shadow:var(--malachite-shadow-default,0px_1px_0px_0px_rgba(0,0,0,0.15))] transition-colors duration-200 hover:border-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] ${FOCUS_RING}`}\n >\n {collapsed ? (\n <CaretRightIcon size={12} />\n ) : (\n <CaretLeftIcon size={12} />\n )}\n </button>\n </Tooltip>\n </div>\n )}\n </aside>\n </SidebarContext.Provider>\n );\n};\n\nconst Header: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div\n className={`box-border flex h-14 shrink-0 items-center border-0 border-b border-solid ${BORDER} py-[6px] ${collapsed ? 'px-1' : 'px-2'}`}\n >\n {children}\n </div>\n );\n};\n\nconst Body: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className={`min-h-0 flex-1 overflow-x-hidden overflow-y-auto ${NO_SCROLLBAR}`}>\n {children}\n </div>\n);\n\nconst Section: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div\n className={`flex flex-col gap-[2px] py-[2px] ${collapsed ? 'items-center px-3' : 'px-4'}`}\n >\n {children}\n </div>\n );\n};\n\nconst Group: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"my-[2px] flex flex-col gap-[6px]\">{children}</div>\n);\n\nconst GroupItems: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"flex flex-col gap-[6px]\">{children}</div>\n);\n\nconst Search: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div className={`flex pt-5 pb-[18px] ${collapsed ? 'justify-center px-3' : 'px-4'}`}>\n {children}\n </div>\n );\n};\n\nconst Notices: React.FC<{ children: React.ReactNode; 'aria-label': string }> = ({\n children,\n 'aria-label': ariaLabel,\n}) => {\n const { collapsed } = useSidebar();\n if (collapsed) {\n return null;\n }\n return (\n <div role=\"status\" aria-label={ariaLabel} className=\"flex flex-col gap-2 px-3 pt-4\">\n {children}\n </div>\n );\n};\n\nconst Divider: React.FC = () => {\n const { collapsed } = useSidebar();\n if (collapsed) {\n return null;\n }\n return <hr className={`m-0 my-2 h-0 shrink-0 border-0 border-t border-solid ${BORDER}`} />;\n};\n\nconst Footer: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { collapsed } = useSidebar();\n return (\n <div\n className={`mt-1 flex shrink-0 border-0 border-t border-solid ${BORDER} py-3 ${collapsed ? 'justify-center px-2' : 'px-4'}`}\n >\n {children}\n </div>\n );\n};\n\ntype SidebarButtonAttributes = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'style' | 'color' | 'children' | 'title' | 'name'\n>;\n\nexport interface SidebarSwitcherProps extends SidebarButtonAttributes {\n logo: React.ReactNode;\n title: string;\n subtitle?: string;\n /** Shown when `title` is cut off; a node so it can be wrapped. Defaults to `title`. */\n titleTooltip?: React.ReactNode;\n /** As `titleTooltip`, for `subtitle`. */\n subtitleTooltip?: React.ReactNode;\n}\n\nconst Switcher = forwardRef<HTMLButtonElement, SidebarSwitcherProps>(\n ({ logo, title, subtitle, titleTooltip, subtitleTooltip, className = '', ...rest }, ref) => {\n const { collapsed } = useSidebar();\n const open = isExpanded(rest['aria-expanded']);\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-label={collapsed ? title : undefined}\n {...rest}\n className={`group/switcher m-0 box-border flex h-full w-full min-w-0 cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans text-left ${collapsed ? 'justify-center p-1' : 'justify-between px-4 py-[6px]'} ${FOCUS_RING} ${className}`.trim()}\n >\n <span className=\"flex min-w-0 items-center gap-4\">\n <span\n aria-hidden=\"true\"\n className=\"relative top-[-2.5px] flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-md [&_img]:size-6 [&_img]:object-contain\"\n >\n {logo}\n </span>\n {!collapsed && (\n <span className=\"flex min-w-0 flex-col gap-1\">\n <TruncatedTooltip\n text={titleTooltip ?? title}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={open}\n className=\"text-[length:var(--malachite-font-size-medium,14px)] leading-[14px] font-medium text-[var(--malachite-text-primary,rgb(10,10,10))]\"\n >\n {title}\n </TruncatedTooltip>\n {subtitle && (\n <TruncatedTooltip\n text={subtitleTooltip ?? subtitle}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={open}\n className=\"text-[12px] leading-[12px] font-normal text-[var(--malachite-text-secondary,rgb(123,123,123))]\"\n >\n {subtitle}\n </TruncatedTooltip>\n )}\n </span>\n )}\n </span>\n {!collapsed && (\n <span className=\"flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/switcher:text-[var(--malachite-text-primary,rgb(10,10,10))]\">\n <ChevronsUpDownIcon style={CHEVRONS} />\n </span>\n )}\n </button>\n );\n },\n);\nSwitcher.displayName = 'Sidebar.Switcher';\n\nexport interface SidebarAccountProps extends SidebarButtonAttributes {\n avatar?: React.ReactNode;\n initials?: string;\n name: string;\n /** Collapsed-rail tooltip, and expanded when `name` is cut off; a node so `name` can be wrapped.\n * Should read as `name`. Defaults to `name`, `false` hides it; none when `name` is empty. */\n tooltip?: React.ReactNode;\n}\n\nconst INITIALS = `inline-flex items-center justify-center rounded-[var(--malachite-radius-md,6px)] border border-solid ${BORDER} bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] supports-[color:color-mix(in_srgb,red,red)]:border-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_20%,transparent)] supports-[color:color-mix(in_srgb,red,red)]:bg-[color-mix(in_srgb,var(--malachite-text-placeholder,rgb(187,187,187))_10%,transparent)] px-1 py-[3px] text-[length:var(--malachite-font-size-small,13px)] leading-[12px] font-semibold text-[var(--malachite-text-secondary,rgb(123,123,123))]`;\n\nconst Account = forwardRef<HTMLButtonElement, SidebarAccountProps>(\n ({ avatar, initials, name, tooltip, className = '', ...rest }, ref) => {\n const { collapsed } = useSidebar();\n const button = (\n <button\n ref={ref}\n type=\"button\"\n aria-label={collapsed ? name : undefined}\n {...rest}\n className={`group/account m-0 box-border flex min-h-8 w-full cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent font-sans ${collapsed ? 'justify-center p-0' : 'justify-between px-2'} ${FOCUS_RING} ${className}`.trim()}\n >\n <span className=\"flex min-w-0 items-center gap-3\">\n <span aria-hidden={collapsed ? undefined : true} className=\"flex shrink-0\">\n {avatar ?? (initials ? <span className={INITIALS}>{initials}</span> : null)}\n </span>\n {!collapsed && (\n <TruncatedTooltip\n text={name ? (tooltip ?? name) : undefined}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={isExpanded(rest['aria-expanded'])}\n className=\"min-w-0 text-[length:var(--malachite-font-size-medium,14px)] leading-[22px] font-semibold text-[var(--malachite-text-primary,rgb(10,10,10))]\"\n >\n {name}\n </TruncatedTooltip>\n )}\n </span>\n {!collapsed && (\n <span className=\"flex shrink-0 text-[var(--malachite-text-secondary,rgb(123,123,123))] transition-colors group-hover/account:text-[var(--malachite-text-primary,rgb(10,10,10))]\">\n <ChevronsUpDownIcon style={CHEVRONS} />\n </span>\n )}\n </button>\n );\n return collapsed ? (\n <Tooltip\n text={name ? (tooltip ?? name) : undefined}\n placement=\"right\"\n delay={SIDEBAR_TOOLTIP_DELAY_S}\n describesTrigger={false}\n suppressed={isExpanded(rest['aria-expanded'])}\n >\n {button}\n </Tooltip>\n ) : (\n button\n );\n },\n);\nAccount.displayName = 'Sidebar.Account';\n\nconst Usage: React.FC<UsageCardProps> = (props) => {\n const { collapsed } = useSidebar();\n if (collapsed) {\n return null;\n }\n return (\n <div className=\"shrink-0 px-3 pt-3 pb-4\">\n <UsageCard {...props} />\n </div>\n );\n};\n\n/** `width` widens a popover past the sidebar's, for a menu wider than the control it opens from. */\nconst Panel: React.FC<{ children: React.ReactNode; width?: number }> = ({\n children,\n width = SIDEBAR_POPOVER_WIDTH_PX,\n}) => (\n <div className=\"flex flex-col\" style={{ width: width - 2 * POPOVER_BORDER_PX }}>\n {children}\n </div>\n);\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header,\n Body,\n Section,\n Group,\n GroupItems,\n Search,\n Notices,\n Divider,\n Footer,\n Switcher,\n Account,\n Usage,\n Progress: SidebarProgress,\n Panel,\n});\n\nexport default Sidebar;\n"],"names":["useSidebar","useSidebarCollapsed","POPOVER_BORDER_PX","TOGGLE_SIZE_PX","CHEVRONS","TOGGLE_LAYER","NAVITEM_GROUND","noop","nextDrawerState","previous","overlay","collapsed","canToggle","blocked","SidebarRoot","onToggleCollapse","expandLabel","collapseLabel","ariaLabel","children","toggleLabel","context","useMemo","width","SIDEBAR_WIDTH_PX","otherOverlayOpen","useHasOpenOverlay","inputs","drawerState","setDrawerState","useState","nextState","open","yieldDrawer","useCallback","overlayRef","isTopmost","useOverlayBehaviour","jsxs","SidebarContext","jsx","SIDEBAR_Z_INDEX","Tooltip","BORDER","FOCUS_RING","CaretRightIcon","CaretLeftIcon","Header","Body","NO_SCROLLBAR","Section","Group","GroupItems","Search","Notices","Divider","Footer","Switcher","forwardRef","logo","title","subtitle","titleTooltip","subtitleTooltip","className","rest","ref","isExpanded","TruncatedTooltip","SIDEBAR_TOOLTIP_DELAY_S","ChevronsUpDownIcon","INITIALS","Account","avatar","initials","name","tooltip","button","Usage","props","UsageCard","Panel","SIDEBAR_POPOVER_WIDTH_PX","Sidebar","SidebarProgress"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAMA,IAAa,OAAO,EAAE,WAAWC,IAAoB,IAErDC,IAAoB,GACpBC,IAAiB,IACjBC,IAAW,EAAE,OAAO,GAAG,QAAQ,GAAA,GAgB/BC,IACF,uNAGEC,IAAiB;AAAA,EACnB,kCAAkC;AACtC,GAEMC,IAAO,MAAA;AAAA,GAOPC,IAAkB,CACpBC,GACA,EAAE,SAAAC,GAAS,WAAAC,GAAW,WAAAC,GAAW,SAAAC,QAE5BH,IACDC,IAAkB,SACjBC,IACDH,MAAa,SAASA,MAAa,WAAiBA,IACjDI,IAAU,YAAY,WAFN,QAFF,OAOnBC,KAAsC,CAAC;AAAA,EACzC,WAAAH,IAAY;AAAA,EACZ,SAAAD,IAAU;AAAA,EACV,kBAAAK;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,eAAAC,IAAgB;AAAA,EAChB,cAAcC,IAAY;AAAA,EAC1B,UAAAC;AACJ,MAAM;AACF,QAAMC,IAAcT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