@stackone/malachite 2.102.0 → 2.103.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
@@ -31,7 +31,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
31
31
  - **`Modal`** — Centred dialog over a scrim, with header slots (icon/title/subtitle/extra), a scrolling body and a pinned footer. Locks background scroll and dismisses on ESC, the close button, or a scrim click unless `closeOnOverlayClick` is off; `busy` suppresses the two pointer routes while a request is in flight and sets `aria-busy`, so a stray click cannot tear the dialog down mid-write — but never ESC, which is the only guaranteed keyboard exit from a focus trap and so always reaches `onClose`. ESC, the Tab focus trap and `aria-modal` all apply to the topmost overlay only, so these may be stacked — a dialog opened from a panel keeps Tab to itself and the panel stops claiming to be modal. The Tab trap follows focus into a malachite popup portaled out of the dialog’s own tree — a `MultiSelect` listbox or a `Popover` opened from the body — and traps Tab within that popup while it holds focus, so Tab walks and wraps that popup’s own stops rather than being yanked back to the dialog’s first control or escaping the dialog altogether. A `Dropdown` list or an `ActionMenu` is dismissed by Tab rather than trapping it: it closes and focus returns to its trigger, so Tab carries on from there. A consumer’s own portaled popup is not known to the trap and Tab will pull focus out of it. Set `role="alertdialog"` for a consequential choice, which asks assistive tech to announce the body and not just the name, and point `aria-describedby` at whichever element carries it. Width comes from the `size` union (`small` 420px | `medium` 612px | `large` 760px | `fullscreen`, which fills the window in both directions) rather than a raw pixel prop. `titleAdornment` sits immediately after the title behind a hairline divider, for naming the thing being acted on — distinct from `headerExtra`, which pins to the far right. `tray` paints a tinted plate around the card and hangs a `caption` beneath it; the plate is the dialog element itself, so that caption stays inside the `aria-modal` subtree rather than being stranded outside it by the visual nesting, and it is added to `aria-describedby` automatically because it says what the dialog is asking. It takes a tone (`neutral` | `warning` | `error` | `success`) rather than a colour, so no consumer can paint it off-palette — and the tone sets the plate and its caption colour together, so the two cannot disagree. The caption is a `{ label?, message }` pair rather than a node, because its row height, type scale and colour belong to the plate. `size` names the card, and the plate’s 4px ring is added on top. Like `SidePanel` it sits in a z-index band from 1000 — one step per stacked overlay, so what paints on top is what holds the keyboard — and stays out of the browser top layer, so a host app’s own dialogs can still cover it. `callouts` stacks full-bleed `Alert` bands at the top of the body, as on `SidePanel`; they ignore `bodyPadding` and lead `aria-describedby`, ahead of the consumer’s own description and the tray caption. For a confirmation use `ConfirmationDialog`, which is a preset over this. _Key props:_ `open`, `onClose`, `title`, `subtitle`, `icon`, `headerExtra`, `titleAdornment`, `tray`, `callouts`, `renderLink`, `headerDivider`, `footer`, `size`, `showCloseButton`, `closeOnOverlayClick`, `bodyPadding`, `bodyHeight` (`auto` | `tall` — 600px, or the viewport less 160px when smaller, for an embedded iframe at `height: 100%`), `busy`, `role` (`dialog` | `alertdialog`), `aria-label`, `aria-labelledby`, `aria-describedby`.
32
32
  - **`SidePanel`** — Right-hand slide-in overlay panel (drawer) with header slots (back/icon/title/subtitle/extra), scrollable body and optional footer. `subtitlePlacement="below"` stacks the subtitle on its own line under the title row, so neither truncates the other in a narrow panel. `toolbar` pins content between the header and the scrolling body (16px sides, 16px above, 8px below, no divider), such as a Search over the list it filters. Locks background scroll and dismisses on ESC, an overlay click or close. ESC and the Tab focus trap apply to the topmost overlay only, so a `Modal` may be stacked over it. The Tab trap follows focus into a malachite popup portaled out of the panel’s own tree — a `MultiSelect` listbox or a `Popover` opened from the body — and traps Tab within that popup while it holds focus, so Tab walks and wraps that popup’s own stops rather than being yanked back to the panel’s first control or escaping the panel altogether. A `Dropdown` list or an `ActionMenu` is dismissed by Tab rather than trapping it: it closes and focus returns to its trigger, so Tab carries on from there. A consumer’s own portaled popup is not known to the trap and Tab will pull focus out of it. `callouts` stacks full-bleed `Alert` bands at the top of the body, above `children` and unaffected by `bodyPadding` — the same band `ConfirmationDialog` gives its `callout` — and `renderLink` routes their root-relative markdown links through the app’s router. The callouts are announced as the panel’s description, ahead of `description`. `aside` opens a full-height column to the left, as wide again as `maxWidth`, for help that sits beside the content — a setup guide beside a form. The panel’s own header, body and footer keep their width and place, and the aside’s `title` (with an optional `headerExtra`, such as a `Stepper`) and `footer` line up with the panel’s header and footer; `bodyPadding` works as the panel’s does. The aside is never narrower than 360px, so a window too narrow for both columns scrolls the panel sideways. `onSubmit` makes the header, body and footer one `<form>` (`noValidate`, default prevented), so Enter in a field submits through a `type="submit"` footer button, as `FormActions` gives, the way a browser form does: not from a textarea, not mid-composition, and not while that button is disabled. Enter in the `toolbar` never submits, and the submit does not reach a form the panel is rendered inside.
33
33
  - **`useHasOpenOverlay`** — Hook reporting whether any modal-type overlay - `SidePanel` or `Modal` - is open anywhere in the app. For host chrome that has to get out of an overlay’s way, a floating support widget being the case it was added for: overlays render through a portal, so a host has no DOM signal of its own to read, and reading the library’s internal markers would couple it to something it does not own. Dropdowns and tooltips are deliberately not counted - they do not trap focus, and chrome does not need to move for them. _Key props:_ No arguments. Returns a boolean.
34
- - **`SidePanelNavFooter`** — Keyboard-hint footer for SidePanel: up/down keycaps to step between records and an esc-to-close hint, with an optional right-aligned actions slot.
34
+ - **`SidePanelNavFooter`** — Keyboard-hint footer for SidePanel: up/down keycaps to step between records, optional left/right keycaps to switch tabs, and an esc-to-close hint, with an optional right-aligned actions slot.
35
35
 
36
36
  ## Feedback & status
37
37
 
@@ -1,30 +1,57 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import d from "./CustomIcons/CaretDownIcon.js";
3
- import o from "./CustomIcons/CaretUpIcon.js";
2
+ import t from "./CustomIcons/CaretDownIcon.js";
3
+ import h from "./CustomIcons/CaretUpIcon.js";
4
4
  import { Keycap as l } from "./Keycap.js";
5
- const s = "text-[13px] font-medium tracking-[0.14px] text-[var(--malachite-text-secondary)]", N = ({
6
- onNavigateUp: r,
7
- onNavigateDown: t,
8
- canNavigateUp: c = !1,
9
- canNavigateDown: n = !1,
10
- actions: i,
11
- className: m = ""
12
- }) => /* @__PURE__ */ a("div", { className: `flex w-full items-center justify-between ${m}`, children: [
5
+ const N = { transform: "rotate(90deg)" }, v = { transform: "rotate(-90deg)" }, c = "text-[13px] font-medium tracking-[0.14px] text-[var(--malachite-text-secondary)]", u = ({
6
+ onNavigateUp: n,
7
+ onNavigateDown: d,
8
+ canNavigateUp: m = !1,
9
+ canNavigateDown: o = !1,
10
+ onPreviousTab: s,
11
+ onNextTab: i,
12
+ canPreviousTab: p = !1,
13
+ canNextTab: x = !1,
14
+ actions: r,
15
+ className: f = ""
16
+ }) => /* @__PURE__ */ a("div", { className: `flex w-full items-center justify-between ${f}`, children: [
13
17
  /* @__PURE__ */ a("div", { className: "flex items-center gap-[8px]", children: [
14
18
  /* @__PURE__ */ a("div", { className: "flex items-center gap-[4px]", children: [
15
- /* @__PURE__ */ e(l, { "aria-label": "Previous", onClick: r, disabled: !c, children: /* @__PURE__ */ e(o, { size: 11 }) }),
16
- /* @__PURE__ */ e(l, { "aria-label": "Next", onClick: t, disabled: !n, children: /* @__PURE__ */ e(d, { size: 11 }) })
19
+ /* @__PURE__ */ e(l, { "aria-label": "Previous", onClick: n, disabled: !m, children: /* @__PURE__ */ e(h, { size: 11 }) }),
20
+ /* @__PURE__ */ e(l, { "aria-label": "Next", onClick: d, disabled: !o, children: /* @__PURE__ */ e(t, { size: 11 }) })
21
+ ] }),
22
+ /* @__PURE__ */ e("span", { className: c, children: "Navigate" }),
23
+ (s || i) && /* @__PURE__ */ a("div", { className: "ml-[20px] flex items-center gap-[8px]", children: [
24
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-[4px]", children: [
25
+ /* @__PURE__ */ e(
26
+ l,
27
+ {
28
+ "aria-label": "Previous tab",
29
+ onClick: s,
30
+ disabled: !s || !p,
31
+ children: /* @__PURE__ */ e(t, { size: 11, style: N })
32
+ }
33
+ ),
34
+ /* @__PURE__ */ e(
35
+ l,
36
+ {
37
+ "aria-label": "Next tab",
38
+ onClick: i,
39
+ disabled: !i || !x,
40
+ children: /* @__PURE__ */ e(t, { size: 11, style: v })
41
+ }
42
+ )
43
+ ] }),
44
+ /* @__PURE__ */ e("span", { className: c, children: "Switch tabs" })
17
45
  ] }),
18
- /* @__PURE__ */ e("span", { className: s, children: "Navigate" }),
19
46
  /* @__PURE__ */ a("div", { className: "ml-[20px] flex items-center gap-[8px]", children: [
20
47
  /* @__PURE__ */ e(l, { children: "esc" }),
21
- /* @__PURE__ */ e("span", { className: s, children: "Close" })
48
+ /* @__PURE__ */ e("span", { className: c, children: "Close" })
22
49
  ] })
23
50
  ] }),
24
- i ? /* @__PURE__ */ e("div", { className: "flex items-center", children: i }) : null
51
+ r ? /* @__PURE__ */ e("div", { className: "flex items-center", children: r }) : null
25
52
  ] });
26
53
  export {
27
- N as SidePanelNavFooter,
28
- N as default
54
+ u as SidePanelNavFooter,
55
+ u as default
29
56
  };
30
57
  //# sourceMappingURL=SidePanelNavFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SidePanelNavFooter.js","sources":["../../src/components/SidePanelNavFooter.tsx"],"sourcesContent":["import React from 'react';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport Keycap from './Keycap';\n\nexport interface SidePanelNavFooterProps {\n onNavigateUp?: () => void;\n onNavigateDown?: () => void;\n canNavigateUp?: boolean;\n canNavigateDown?: boolean;\n actions?: React.ReactNode;\n className?: string;\n}\n\nconst LABEL = 'text-[13px] font-medium tracking-[0.14px] text-[var(--malachite-text-secondary)]';\n\nconst SidePanelNavFooter: React.FC<SidePanelNavFooterProps> = ({\n onNavigateUp,\n onNavigateDown,\n canNavigateUp = false,\n canNavigateDown = false,\n actions,\n className = '',\n}) => (\n <div className={`flex w-full items-center justify-between ${className}`}>\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"flex items-center gap-[4px]\">\n <Keycap aria-label=\"Previous\" onClick={onNavigateUp} disabled={!canNavigateUp}>\n <CaretUpIcon size={11} />\n </Keycap>\n <Keycap aria-label=\"Next\" onClick={onNavigateDown} disabled={!canNavigateDown}>\n <CaretDownIcon size={11} />\n </Keycap>\n </div>\n <span className={LABEL}>Navigate</span>\n <div className=\"ml-[20px] flex items-center gap-[8px]\">\n <Keycap>esc</Keycap>\n <span className={LABEL}>Close</span>\n </div>\n </div>\n {actions ? <div className=\"flex items-center\">{actions}</div> : null}\n </div>\n);\n\nexport default SidePanelNavFooter;\nexport { SidePanelNavFooter };\n"],"names":["LABEL","SidePanelNavFooter","onNavigateUp","onNavigateDown","canNavigateUp","canNavigateDown","actions","className","jsxs","jsx","Keycap","CaretUpIcon","CaretDownIcon"],"mappings":";;;;AAcA,MAAMA,IAAQ,oFAERC,IAAwD,CAAC;AAAA,EAC3D,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,iBAAAC,IAAkB;AAAA,EAClB,SAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MACI,gBAAAC,EAAC,OAAA,EAAI,WAAW,4CAA4CD,CAAS,IACjE,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,+BACX,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,+BACX,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAO,cAAW,YAAW,SAASR,GAAc,UAAU,CAACE,GAC5D,UAAA,gBAAAK,EAACE,GAAA,EAAY,MAAM,GAAA,CAAI,GAC3B;AAAA,MACA,gBAAAF,EAACC,GAAA,EAAO,cAAW,QAAO,SAASP,GAAgB,UAAU,CAACE,GAC1D,UAAA,gBAAAI,EAACG,GAAA,EAAc,MAAM,IAAI,EAAA,CAC7B;AAAA,IAAA,GACJ;AAAA,IACA,gBAAAH,EAAC,QAAA,EAAK,WAAWT,GAAO,UAAA,YAAQ;AAAA,IAChC,gBAAAQ,EAAC,OAAA,EAAI,WAAU,yCACX,UAAA;AAAA,MAAA,gBAAAC,EAACC,KAAO,UAAA,MAAA,CAAG;AAAA,MACX,gBAAAD,EAAC,QAAA,EAAK,WAAWT,GAAO,UAAA,QAAA,CAAK;AAAA,IAAA,EAAA,CACjC;AAAA,EAAA,GACJ;AAAA,EACCM,IAAU,gBAAAG,EAAC,OAAA,EAAI,WAAU,qBAAqB,aAAQ,IAAS;AAAA,EAAA,CACpE;"}
1
+ {"version":3,"file":"SidePanelNavFooter.js","sources":["../../src/components/SidePanelNavFooter.tsx"],"sourcesContent":["import React from 'react';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport Keycap from './Keycap';\n\nexport interface SidePanelNavFooterProps {\n onNavigateUp?: () => void;\n onNavigateDown?: () => void;\n canNavigateUp?: boolean;\n canNavigateDown?: boolean;\n /** Either tab handler adds the ← → Switch tabs keycaps, for a panel with tabs. */\n onPreviousTab?: () => void;\n onNextTab?: () => void;\n canPreviousTab?: boolean;\n canNextTab?: boolean;\n actions?: React.ReactNode;\n className?: string;\n}\n\n// The left and right carets are the down caret turned, so all four match in size and stroke:\n// the CaretLeft/CaretRight icons sit larger and heavier in their box than CaretUp/CaretDown.\nconst TURNED_LEFT = { transform: 'rotate(90deg)' };\nconst TURNED_RIGHT = { transform: 'rotate(-90deg)' };\n\nconst LABEL = 'text-[13px] font-medium tracking-[0.14px] text-[var(--malachite-text-secondary)]';\n\nconst SidePanelNavFooter: React.FC<SidePanelNavFooterProps> = ({\n onNavigateUp,\n onNavigateDown,\n canNavigateUp = false,\n canNavigateDown = false,\n onPreviousTab,\n onNextTab,\n canPreviousTab = false,\n canNextTab = false,\n actions,\n className = '',\n}) => (\n <div className={`flex w-full items-center justify-between ${className}`}>\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"flex items-center gap-[4px]\">\n <Keycap aria-label=\"Previous\" onClick={onNavigateUp} disabled={!canNavigateUp}>\n <CaretUpIcon size={11} />\n </Keycap>\n <Keycap aria-label=\"Next\" onClick={onNavigateDown} disabled={!canNavigateDown}>\n <CaretDownIcon size={11} />\n </Keycap>\n </div>\n <span className={LABEL}>Navigate</span>\n {(onPreviousTab || onNextTab) && (\n <div className=\"ml-[20px] flex items-center gap-[8px]\">\n <div className=\"flex items-center gap-[4px]\">\n <Keycap\n aria-label=\"Previous tab\"\n onClick={onPreviousTab}\n disabled={!onPreviousTab || !canPreviousTab}\n >\n <CaretDownIcon size={11} style={TURNED_LEFT} />\n </Keycap>\n <Keycap\n aria-label=\"Next tab\"\n onClick={onNextTab}\n disabled={!onNextTab || !canNextTab}\n >\n <CaretDownIcon size={11} style={TURNED_RIGHT} />\n </Keycap>\n </div>\n <span className={LABEL}>Switch tabs</span>\n </div>\n )}\n <div className=\"ml-[20px] flex items-center gap-[8px]\">\n <Keycap>esc</Keycap>\n <span className={LABEL}>Close</span>\n </div>\n </div>\n {actions ? <div className=\"flex items-center\">{actions}</div> : null}\n </div>\n);\n\nexport default SidePanelNavFooter;\nexport { SidePanelNavFooter };\n"],"names":["TURNED_LEFT","TURNED_RIGHT","LABEL","SidePanelNavFooter","onNavigateUp","onNavigateDown","canNavigateUp","canNavigateDown","onPreviousTab","onNextTab","canPreviousTab","canNextTab","actions","className","jsxs","jsx","Keycap","CaretUpIcon","CaretDownIcon"],"mappings":";;;;AAqBA,MAAMA,IAAc,EAAE,WAAW,gBAAA,GAC3BC,IAAe,EAAE,WAAW,iBAAA,GAE5BC,IAAQ,oFAERC,IAAwD,CAAC;AAAA,EAC3D,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,iBAAAC,IAAkB;AAAA,EAClB,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,YAAAC,IAAa;AAAA,EACb,SAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MACI,gBAAAC,EAAC,OAAA,EAAI,WAAW,4CAA4CD,CAAS,IACjE,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,+BACX,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,+B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A,CACjC;AAAA,EAAA,GACJ;AAAA,EACCU,IAAU,gBAAAG,EAAC,OAAA,EAAI,WAAU,qBAAqB,aAAQ,IAAS;AAAA,EAAA,CACpE;"}
package/dist/index.d.ts CHANGED
@@ -5166,6 +5166,11 @@ export declare interface SidePanelNavFooterProps {
5166
5166
  onNavigateDown?: () => void;
5167
5167
  canNavigateUp?: boolean;
5168
5168
  canNavigateDown?: boolean;
5169
+ /** Either tab handler adds the ← → Switch tabs keycaps, for a panel with tabs. */
5170
+ onPreviousTab?: () => void;
5171
+ onNextTab?: () => void;
5172
+ canPreviousTab?: boolean;
5173
+ canNextTab?: boolean;
5169
5174
  actions?: default_2.ReactNode;
5170
5175
  className?: string;
5171
5176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/malachite",
3
- "version": "2.102.0",
3
+ "version": "2.103.0",
4
4
  "description": "StackOne's themeable React component library — Shadow DOM isolated, scoped Tailwind, theme-token driven.",
5
5
  "license": "MIT",
6
6
  "author": "StackOne",