@mechane-ai/elements 0.19.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +15 -4
  2. package/dist/ai.js +4 -4
  3. package/dist/{categorical-values-D-sSI9JB.js → categorical-values-DG0kzYxN.js} +2 -2
  4. package/dist/{chart-frame-vwS7YVgv.js → chart-frame-DxAZ0h_q.js} +50 -51
  5. package/dist/{chart-input-D6Fw2UGV.js → chart-input-Dru0GScv.js} +2 -2
  6. package/dist/charts/cartesian.js +279 -229
  7. package/dist/charts/distribution.js +2 -2
  8. package/dist/charts/graph.js +82 -80
  9. package/dist/charts/hierarchy.js +3 -3
  10. package/dist/charts/matrix.js +136 -134
  11. package/dist/charts/timeline.js +2 -2
  12. package/dist/charts.js +1 -1
  13. package/dist/code-block-DlUwVaPP.js +182 -0
  14. package/dist/collections.js +144 -143
  15. package/dist/{constants.stylex-bbdiv1fD.js → constants.stylex-BILvnwUk.js} +1 -0
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +3 -3
  18. package/dist/content/link.js +1 -1
  19. package/dist/content/markdown.js +108 -102
  20. package/dist/content/tree.js +43 -41
  21. package/dist/{content-link-rdxJ94P8.js → content-link-BIMrgXbz.js} +1 -1
  22. package/dist/content.js +139 -137
  23. package/dist/elements.css +34 -0
  24. package/dist/feedback.js +1 -1
  25. package/dist/forms/dates.js +1 -1
  26. package/dist/forms.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/layout.js +349 -212
  29. package/dist/navigation/commands.js +1 -1
  30. package/dist/navigation.js +0 -1
  31. package/dist/packages/charts/src/chart-cursor.d.ts +7 -0
  32. package/dist/packages/charts/src/chart-theme.d.ts +1 -7
  33. package/dist/packages/feedback/src/async-region.d.ts +3 -1
  34. package/dist/packages/foundations/src/constants.stylex.d.ts +1 -0
  35. package/dist/packages/foundations/src/use-scroll-tab-index.d.ts +6 -0
  36. package/dist/packages/layout/src/app-shell.d.ts +2 -1
  37. package/dist/packages/layout/src/index.d.ts +2 -0
  38. package/dist/packages/layout/src/navigation-rail.d.ts +18 -0
  39. package/dist/packages/layout/src/sidebar.d.ts +2 -1
  40. package/dist/pierre-diff-CHQsoQSZ.js +72 -0
  41. package/dist/{pierre-theme-BUeJim8s.js → pierre-theme-CLgk9v3e.js} +1 -1
  42. package/dist/{pierre-tree-BQBbAhmI.js → pierre-tree-D3XsgEH6.js} +4 -4
  43. package/dist/{src-BVsyKLQ8.js → src-0mocxTaR.js} +64 -43
  44. package/dist/{src-Dven_9lR.js → src-D4zPPr32.js} +1 -1
  45. package/dist/{src-BXh4g2VY.js → src-qU5Z5LRH.js} +1 -0
  46. package/dist/tokens.js +1 -1
  47. package/dist/use-scroll-tab-index-Dxpdh4W7.js +45 -0
  48. package/package.json +1 -1
  49. package/packages/foundations/src/constants.stylex.ts +1 -1
  50. package/dist/code-block-DB42-a0M.js +0 -180
  51. package/dist/pierre-diff-C_j0nxwS.js +0 -71
@@ -1,4 +1,4 @@
1
- import { l as e } from "../src-Dven_9lR.js";
1
+ import { l as e } from "../src-D4zPPr32.js";
2
2
  import { s as t } from "../src-d7EAi61b.js";
3
3
  import { n } from "../navigation-D2_sGy3C.js";
4
4
  import "@stylexjs/stylex";
@@ -22,7 +22,6 @@ function o({ items: e, isEmbedded: t = !1 }) {
22
22
  function s({ items: e, selectedId: t, onNavigate: n, label: r = "Page sections", isEmbedded: a = !1 }) {
23
23
  return /* @__PURE__ */ i("nav", {
24
24
  "aria-label": r,
25
- tabIndex: 0,
26
25
  ...{
27
26
  0: { className: "x78zum5 xxhr3t xeuugli xw2csxc xso031l x1q0q8m5 x1qndepd x1hz01jw xtqrqnz xj57cvi x1778rvt xvmahel x13qnu6 x9v5kkp x19rmrnh x1bqaal" },
28
27
  1: { className: "x78zum5 xxhr3t xeuugli xw2csxc x1q0q8m5 x1qndepd x1hz01jw xtqrqnz xj57cvi x1778rvt xvmahel x13qnu6 x9v5kkp x19rmrnh x1bqaal x1qhh985" }
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare function ChartCursor({ x, top, bottom, width, }: {
3
+ readonly x: number;
4
+ readonly top: number;
5
+ readonly bottom: number;
6
+ readonly width: number;
7
+ }): ReactNode;
@@ -38,13 +38,7 @@ export declare const chartStyles: Readonly<{
38
38
  readonly strokeWidth: stylex.StyleXClassNameFor<"strokeWidth", 2>;
39
39
  readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
40
40
  }>;
41
- readonly focus: Readonly<{
41
+ readonly inspectable: Readonly<{
42
42
  readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none">;
43
- readonly ':focus-visible': stylex.StyleXClassNameFor<":focus-visible", {
44
- readonly outlineColor: stylex.StyleXVar<string>;
45
- readonly outlineStyle: "solid";
46
- readonly outlineWidth: stylex.StyleXVar<string>;
47
- readonly outlineOffset: `calc(-1 * ${stylex.StyleXVar<string>})`;
48
- }>;
49
43
  }>;
50
44
  }>;
@@ -8,13 +8,15 @@ export type LoadingScopeProps = {
8
8
  export declare function LoadingScope({ identity, initialStartedAt, children }: LoadingScopeProps): ReactNode;
9
9
  export type ContentRevealProps = {
10
10
  readonly shouldEnter: boolean;
11
+ readonly presentation?: 'content' | 'image';
11
12
  readonly children: ReactNode;
12
13
  };
13
- export declare function ContentReveal({ shouldEnter, children }: ContentRevealProps): ReactNode;
14
+ export declare function ContentReveal({ shouldEnter, presentation, children }: ContentRevealProps): ReactNode;
14
15
  export type AsyncRegionState = 'pending' | 'ready' | 'failed';
15
16
  export type AsyncRegionProps = {
16
17
  readonly label: string;
17
18
  readonly placeholder: ReactNode;
19
+ readonly presentation?: 'content' | 'image';
18
20
  } & ({
19
21
  readonly state: 'pending';
20
22
  readonly children?: never;
@@ -64,6 +64,7 @@ export declare const darkSyntaxColors: {
64
64
  export declare const loading: {
65
65
  delaySeconds: number;
66
66
  revealMs: number;
67
+ imageRevealMs: number;
67
68
  placeholderMs: number;
68
69
  };
69
70
  export declare const darkShadows: {
@@ -0,0 +1,6 @@
1
+ /** Adds a stop only when scrolling needs a keyboard target of its own. */
2
+ export declare function useScrollTabIndex<Element extends HTMLElement>(): {
3
+ ref: (node: Element | null) => void;
4
+ viewport: import("react").RefObject<Element | null>;
5
+ tabIndex: number;
6
+ };
@@ -1,5 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  type AppShellProps = {
3
+ readonly rail?: ReactNode;
3
4
  readonly sidebarHeader?: ReactNode;
4
5
  readonly sidebar: ReactNode;
5
6
  readonly footer?: ReactNode;
@@ -7,5 +8,5 @@ type AppShellProps = {
7
8
  readonly mainId?: string;
8
9
  readonly shouldFocus?: boolean;
9
10
  };
10
- export declare function AppShell({ sidebarHeader, sidebar, footer, children, mainId, shouldFocus, }: AppShellProps): ReactNode;
11
+ export declare function AppShell({ rail, sidebarHeader, sidebar, footer, children, mainId, shouldFocus, }: AppShellProps): ReactNode;
11
12
  export {};
@@ -1,4 +1,6 @@
1
1
  export { AppShell } from './app-shell.tsx';
2
+ export { NavigationRail } from './navigation-rail.tsx';
3
+ export type { NavigationRailLink, NavigationRailProps } from './navigation-rail.tsx';
2
4
  export { DetailPage } from './detail-page.tsx';
3
5
  export { FocusPage } from './focus-page.tsx';
4
6
  export { Workbench, WorkbenchScroll, WorkbenchFooter } from './workbench.tsx';
@@ -0,0 +1,18 @@
1
+ import type { ComponentProps, MouseEventHandler, ReactNode } from 'react';
2
+ export declare const NavigationRailContext: import("react").Context<boolean>;
3
+ export type NavigationRailLink = Omit<ComponentProps<'a'>, 'children' | 'href' | 'aria-label' | 'aria-current' | 'title'> & {
4
+ readonly label: string;
5
+ readonly icon: ReactNode;
6
+ readonly href: string;
7
+ readonly isCurrent?: boolean;
8
+ };
9
+ export type NavigationRailProps = {
10
+ readonly label: string;
11
+ readonly links: ReadonlyArray<NavigationRailLink>;
12
+ readonly action?: {
13
+ readonly label: string;
14
+ readonly icon: ReactNode;
15
+ readonly onClick: MouseEventHandler<HTMLButtonElement>;
16
+ };
17
+ };
18
+ export declare function NavigationRail({ label, links, action }: NavigationRailProps): ReactNode;
@@ -13,6 +13,7 @@ type SidebarState = {
13
13
  export declare const SidebarContext: import("react").Context<SidebarState | null>;
14
14
  type SidebarProps = {
15
15
  readonly header?: ReactNode;
16
+ readonly navigationHeader?: ReactNode;
16
17
  readonly footer?: ReactNode;
17
18
  readonly close?: ReactNode;
18
19
  readonly children: ReactNode;
@@ -39,7 +40,7 @@ type SidebarFooterProps = {
39
40
  readonly children: ReactNode;
40
41
  readonly layout?: SidebarFooterLayout;
41
42
  };
42
- export declare function Sidebar({ header, footer, close, children }: SidebarProps): ReactNode;
43
+ export declare function Sidebar({ header, navigationHeader, footer, close, children }: SidebarProps): ReactNode;
43
44
  export declare function SidebarClose(): ReactNode;
44
45
  export declare function Navigation({ children, label }: NavigationProps): ReactNode;
45
46
  export declare function NavigationSection({ children, label, }: {
@@ -0,0 +1,72 @@
1
+ import { t as e } from "./use-scroll-tab-index-Dxpdh4W7.js";
2
+ import { n as t, t as n } from "./pierre-theme-CLgk9v3e.js";
3
+ import { t as r } from "./viewer-styles-CpHqp5Qv.js";
4
+ import * as i from "@stylexjs/stylex";
5
+ import { useCallback as a, useState as o } from "react";
6
+ import { jsx as s } from "react/jsx-runtime";
7
+ import { Virtualizer as c, parseDiffFromFile as l, parsePatchFiles as u, registerCustomTheme as d } from "@pierre/diffs";
8
+ import { FileDiff as f, VirtualizerContext as p } from "@pierre/diffs/react";
9
+ // packages/content/src/diff/pierre-diff.tsx
10
+ var m = {
11
+ kVQacm: "xysyzu8",
12
+ $$css: !0
13
+ }, h = { viewport: (e) => [
14
+ m,
15
+ {
16
+ kskxy: e == null ? e : "x1jols5v",
17
+ $$css: !0
18
+ },
19
+ { "--x-maxHeight": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
20
+ ] };
21
+ d("mechane", () => Promise.resolve(n), "zed");
22
+ function g(e) {
23
+ return e === null ? null : {
24
+ name: e.name,
25
+ contents: e.code,
26
+ lang: e.language ?? "text"
27
+ };
28
+ }
29
+ function _(e) {
30
+ return e.patch === void 0 ? [l(g(e.before), g(e.after), {}, !0)] : u(e.patch, { throwOnError: !0 }).flatMap((e) => e.files);
31
+ }
32
+ function v({ files: n, layout: l, shouldWrap: u, showUnchanged: d, annotations: m, maxHeight: g, label: _ }) {
33
+ let [v] = o(() => new c()), y = e(), b = a((e) => {
34
+ y.ref(e), e === null ? v.cleanUp() : v.setup(e);
35
+ }, [v, y.ref]);
36
+ return /* @__PURE__ */ s(p.Provider, {
37
+ value: v,
38
+ children: /* @__PURE__ */ s("div", {
39
+ ref: b,
40
+ role: "region",
41
+ "aria-label": `${_} changes`,
42
+ tabIndex: y.tabIndex,
43
+ ...i.props(r.scrollRegion, h.viewport(g)),
44
+ children: /* @__PURE__ */ s("div", { children: n.map((e) => /* @__PURE__ */ s(f, {
45
+ fileDiff: e,
46
+ disableWorkerPool: !0,
47
+ options: {
48
+ preferredHighlighter: "highlights",
49
+ theme: "mechane",
50
+ themeType: "system",
51
+ unsafeCSS: t,
52
+ diffStyle: l,
53
+ overflow: u ? "wrap" : "scroll",
54
+ hunkSeparators: "metadata",
55
+ expandUnchanged: d,
56
+ tokenizeMaxLength: 2e5,
57
+ tokenizeMaxLineLength: 4096
58
+ },
59
+ lineAnnotations: m.filter((t) => t.file === e.name).map((e) => ({
60
+ side: e.side === "old" ? "deletions" : "additions",
61
+ lineNumber: e.line,
62
+ metadata: e.content
63
+ })),
64
+ renderAnnotation: (e) => /* @__PURE__ */ s("div", {
65
+ className: "x1mvvolr xeuugli x1hz01jw xtqrqnz x1778rvt xj0a0fe",
66
+ children: e.metadata
67
+ })
68
+ }, e.name)) })
69
+ })
70
+ });
71
+ }
72
+ export { v as PierreDiff, _ as prepareDiff };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./constants.stylex-bbdiv1fD.js";
1
+ import { t as e } from "./constants.stylex-BILvnwUk.js";
2
2
  import { d as t, i as n, l as r, r as i, u as a } from "./tokens.stylex-DTHHFbyl.js";
3
3
  // packages/content/src/pierre-theme.ts
4
4
  var o = {
@@ -1,7 +1,7 @@
1
- import { c as e } from "./src-BXh4g2VY.js";
2
- import { l as t } from "./src-Dven_9lR.js";
3
- import { t as n } from "./constants.stylex-bbdiv1fD.js";
4
- import { r } from "./pierre-theme-BUeJim8s.js";
1
+ import { c as e } from "./src-qU5Z5LRH.js";
2
+ import { l as t } from "./src-D4zPPr32.js";
3
+ import { t as n } from "./constants.stylex-BILvnwUk.js";
4
+ import { r } from "./pierre-theme-CLgk9v3e.js";
5
5
  import * as i from "@stylexjs/stylex";
6
6
  import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
7
7
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
- import { O as e, i as t, s as n } from "./src-BXh4g2VY.js";
1
+ import { O as e, i as t, s as n } from "./src-qU5Z5LRH.js";
2
2
  import { i as r, l as i } from "./tokens.stylex-DTHHFbyl.js";
3
3
  import { t as a } from "./accessibility-C-aIZ1Yx.js";
4
- import { c as o, s } from "./constants.stylex-bbdiv1fD.js";
4
+ import { c as o, s } from "./constants.stylex-BILvnwUk.js";
5
5
  import { mergeProps as c } from "@base-ui/react/merge-props";
6
6
  import * as l from "@stylexjs/stylex";
7
7
  import u, { createContext as d, useContext as f, useEffect as p, useRef as m, useState as h } from "react";
@@ -491,7 +491,7 @@ function xe(e) {
491
491
  return t && r.push(t), n && r.push(n), r;
492
492
  }
493
493
  var Se = (e) => {
494
- let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: s, index: c, toasts: l, expanded: d, removeToast: f, defaultRichColors: p, closeButton: m, style: h, cancelButtonStyle: ee, actionButtonStyle: g, className: _ = "", descriptionClassName: v = "", duration: y, position: b, gap: te, expandByDefault: x, classNames: S, icons: C, closeButtonAriaLabel: w = "Close toast" } = e, [T, E] = u.useState(null), [ne, re] = u.useState(null), [D, O] = u.useState(!1), [k, A] = u.useState(!1), [j, M] = u.useState(!1), [N, P] = u.useState(!1), [F, I] = u.useState(!1), [ie, L] = u.useState(0), [oe, ce] = u.useState(0), R = u.useRef(n.duration || y || ve), le = u.useRef(null), z = u.useRef(null), fe = c === 0, pe = c + 1 <= o, B = n.type, V = B ?? "default", H = n.dismissible !== !1, me = n.className || "", he = n.descriptionClassName || "", W = u.useMemo(() => s.findIndex((e) => e.toastId === n.id) || 0, [s, n.id]), ge = u.useMemo(() => n.closeButton ?? m, [n.closeButton, m]), _e = u.useMemo(() => n.duration || y || ve, [n.duration, y]), G = u.useRef(0), K = u.useRef(0), Se = u.useRef(0), J = u.useRef(null), [Ce, we] = b.split("-"), Te = u.useMemo(() => s.reduce((e, t, n) => n >= W ? e : e + t.height, 0), [s, W]), Y = de(), X = u.useMemo(() => e.swipeDirections ?? xe(b), [e.swipeDirections, b]), Z = n.invert || t, Q = B === "loading";
494
+ let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: s, index: c, toasts: l, expanded: d, removeToast: f, defaultRichColors: p, closeButton: m, style: h, cancelButtonStyle: ee, actionButtonStyle: g, className: _ = "", descriptionClassName: v = "", duration: y, position: b, gap: te, expandByDefault: x, classNames: S, icons: C, closeButtonAriaLabel: w = "Close toast" } = e, [T, E] = u.useState(null), [ne, re] = u.useState(null), [D, O] = u.useState(!1), [k, A] = u.useState(!1), [j, M] = u.useState(!1), [N, P] = u.useState(!1), [F, I] = u.useState(!1), [ie, L] = u.useState(0), [oe, ce] = u.useState(0), R = u.useRef(n.duration || y || ve), le = u.useRef(null), z = u.useRef(null), fe = c === 0, pe = c + 1 <= o, B = n.type, V = B ?? "default", H = n.dismissible !== !1, me = n.className || "", he = n.descriptionClassName || "", W = u.useMemo(() => s.findIndex((e) => e.toastId === n.id) || 0, [s, n.id]), ge = u.useMemo(() => n.closeButton ?? m, [n.closeButton, m]), _e = u.useMemo(() => n.duration || y || ve, [n.duration, y]), G = u.useRef(0), K = u.useRef(0), Se = u.useRef(0), J = u.useRef(null), [Ce, we] = b.split("-"), Te = u.useMemo(() => s.reduce((e, t, n) => n >= W ? e : e + t.height, 0), [s, W]), Y = de(), X = u.useMemo(() => e.swipeDirections ?? xe(b), [e.swipeDirections, b]), Ee = n.invert || t, Z = B === "loading";
495
495
  K.current = u.useMemo(() => W * te + Te, [W, Te]), u.useEffect(() => {
496
496
  R.current = _e;
497
497
  }, [_e]), u.useEffect(() => {
@@ -529,7 +529,7 @@ var Se = (e) => {
529
529
  n.action,
530
530
  n.cancel
531
531
  ]);
532
- let $ = u.useCallback(() => {
532
+ let Q = u.useCallback(() => {
533
533
  A(!0), L(K.current), a((e) => e.filter((e) => e.toastId !== n.id)), setTimeout(() => {
534
534
  f(n);
535
535
  }, be);
@@ -549,7 +549,7 @@ var Se = (e) => {
549
549
  }
550
550
  Se.current = (/* @__PURE__ */ new Date()).getTime();
551
551
  })() : R.current !== Infinity && (G.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
552
- n.onAutoClose == null || n.onAutoClose.call(n, n), $();
552
+ n.onAutoClose == null || n.onAutoClose.call(n, n), Q();
553
553
  }, R.current)), () => clearTimeout(e);
554
554
  }, [
555
555
  d,
@@ -557,11 +557,11 @@ var Se = (e) => {
557
557
  n,
558
558
  B,
559
559
  Y,
560
- $
560
+ Q
561
561
  ]), u.useEffect(() => {
562
- n.delete && ($(), n.onDismiss == null || n.onDismiss.call(n, n));
563
- }, [$, n.delete]);
564
- function Ee() {
562
+ n.delete && (Q(), n.onDismiss == null || n.onDismiss.call(n, n));
563
+ }, [Q, n.delete]);
564
+ function De() {
565
565
  return C?.loading ? /*#__PURE__*/ u.createElement("div", {
566
566
  className: q(S?.loader, n?.classNames?.loader, "sonner-loader"),
567
567
  "data-visible": B === "loading"
@@ -570,7 +570,7 @@ var Se = (e) => {
570
570
  visible: B === "loading"
571
571
  });
572
572
  }
573
- let De = n.icon || C?.[B] || ae(B);
573
+ let $ = n.icon || C?.[B] || ae(B);
574
574
  return /*#__PURE__*/ u.createElement("li", {
575
575
  tabIndex: 0,
576
576
  ref: z,
@@ -590,7 +590,7 @@ var Se = (e) => {
590
590
  "data-swiping": j,
591
591
  "data-dismissible": H,
592
592
  "data-type": B,
593
- "data-invert": Z,
593
+ "data-invert": Ee,
594
594
  "data-swipe-out": N,
595
595
  "data-swipe-direction": ne,
596
596
  "data-expanded": !!(d || x && D),
@@ -608,7 +608,7 @@ var Se = (e) => {
608
608
  M(!1), E(null), J.current = null;
609
609
  },
610
610
  onPointerDown: (e) => {
611
- e.button !== 2 && !Q && H && (le.current = /* @__PURE__ */ new Date(), L(K.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (M(!0), J.current = {
611
+ e.button !== 2 && !Z && H && (le.current = /* @__PURE__ */ new Date(), L(K.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (M(!0), J.current = {
612
612
  x: e.clientX,
613
613
  y: e.clientY
614
614
  }));
@@ -617,7 +617,7 @@ var Se = (e) => {
617
617
  if (N || !H) return;
618
618
  J.current = null;
619
619
  let e = Number(z.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), t = Number(z.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), r = (/* @__PURE__ */ new Date()).getTime() - le.current?.getTime(), i = T === "x" ? e : t, a = Math.abs(i) / r;
620
- if ((T === "x" ? X.includes(e > 0 ? "right" : "left") : X.includes(t > 0 ? "bottom" : "top")) && (Math.abs(i) >= ye || a > .11)) L(K.current), n.onDismiss == null || n.onDismiss.call(n, n), re(T === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), P(!0);
620
+ if ((T === "x" ? X.includes(e > 0 ? "right" : "left") : X.includes(t > 0 ? "bottom" : "top")) && (Math.abs(i) >= ye || a > .11)) L(K.current), n.onDismiss == null || n.onDismiss.call(n, n), re(T === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), Q(), P(!0);
621
621
  else {
622
622
  var o, s;
623
623
  (o = z.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = z.current) == null || s.style.setProperty("--swipe-amount-y", "0px"), I(!1), M(!1), E(null);
@@ -651,16 +651,16 @@ var Se = (e) => {
651
651
  }
652
652
  }, ge && !n.jsx && B !== "loading" ? /*#__PURE__*/ u.createElement("button", {
653
653
  "aria-label": w,
654
- "data-disabled": Q,
654
+ "data-disabled": Z,
655
655
  "data-close-button": !0,
656
- onClick: Q || !H ? () => {} : () => {
657
- $(), n.onDismiss == null || n.onDismiss.call(n, n);
656
+ onClick: Z || !H ? () => {} : () => {
657
+ Q(), n.onDismiss == null || n.onDismiss.call(n, n);
658
658
  },
659
659
  className: q(S?.closeButton, n?.classNames?.closeButton)
660
660
  }, C?.close ?? ue) : null, (B || n.icon || n.promise) && n.icon !== null && (C?.[B] !== null || n.icon) ? /*#__PURE__*/ u.createElement("div", {
661
661
  "data-icon": "",
662
662
  className: q(S?.icon, n?.classNames?.icon)
663
- }, B === "loading" ? n.icon || Ee() : n.promise ? Ee() : null, B === "loading" ? null : De) : null, /*#__PURE__*/ u.createElement("div", {
663
+ }, B === "loading" ? n.icon || De() : n.promise ? De() : null, B === "loading" ? null : $) : null, /*#__PURE__*/ u.createElement("div", {
664
664
  "data-content": "",
665
665
  className: q(S?.content, n?.classNames?.content)
666
666
  }, /*#__PURE__*/ u.createElement("div", {
@@ -674,7 +674,7 @@ var Se = (e) => {
674
674
  "data-cancel": !0,
675
675
  style: n.cancelButtonStyle || ee,
676
676
  onClick: (e) => {
677
- U(n.cancel) && H && (n.cancel.onClick == null || n.cancel.onClick.call(n.cancel, e), $());
677
+ U(n.cancel) && H && (n.cancel.onClick == null || n.cancel.onClick.call(n.cancel, e), Q());
678
678
  },
679
679
  className: q(S?.cancelButton, n?.classNames?.cancelButton)
680
680
  }, n.cancel.label) : null, /*#__PURE__*/ u.isValidElement(n.action) ? n.action : n.action && U(n.action) ? /*#__PURE__*/ u.createElement("button", {
@@ -682,7 +682,7 @@ var Se = (e) => {
682
682
  "data-action": !0,
683
683
  style: n.actionButtonStyle || g,
684
684
  onClick: (e) => {
685
- U(n.action) && (n.action.onClick == null || n.action.onClick.call(n.action, e), e.defaultPrevented || $());
685
+ U(n.action) && (n.action.onClick == null || n.action.onClick.call(n.action, e), e.defaultPrevented || Q());
686
686
  },
687
687
  className: q(S?.actionButton, n?.classNames?.actionButton)
688
688
  }, n.action.label) : null);
@@ -908,8 +908,30 @@ function Te({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notificati
908
908
  });
909
909
  }
910
910
  // packages/feedback/src/async-region.tsx
911
- var Y = d(void 0), X = d(!1), Z = o.delaySeconds * 1e3;
912
- function Q({ identity: e, initialStartedAt: t, children: n }) {
911
+ var Y = d(void 0), X = d(!1), Ee = o.delaySeconds * 1e3, Z = {
912
+ content: {
913
+ k7Eaqz: "xeuugli",
914
+ kAzted: "x2lwn1j",
915
+ k1xSpc: "x78zum5",
916
+ kXwgrk: "xdt5ytf",
917
+ kUk6DE: "x98rzlu",
918
+ $$css: !0
919
+ },
920
+ reveal: {
921
+ kKVMdj: "xqcmdr3 x1qme5af",
922
+ k44tkh: "x1irg2zc",
923
+ kyAemX: "x1c3o69q",
924
+ $$css: !0
925
+ },
926
+ imageReveal: {
927
+ k44tkh: "x11hm9ij",
928
+ $$css: !0
929
+ }
930
+ }, Q = {
931
+ content: null,
932
+ image: Z.imageReveal
933
+ };
934
+ function De({ identity: e, initialStartedAt: t, children: n }) {
913
935
  let [r, i] = h(() => ({
914
936
  identity: e,
915
937
  startedAt: t ?? Date.now()
@@ -922,33 +944,30 @@ function Q({ identity: e, initialStartedAt: t, children: n }) {
922
944
  children: n
923
945
  });
924
946
  }
925
- function $({ shouldEnter: e, children: t }) {
926
- let n = f(X), [r, i] = h(e && !n), a = m(null);
947
+ function $({ shouldEnter: e, presentation: t = "content", children: n }) {
948
+ let r = f(X), [i, a] = h(e && !r), o = m(null);
927
949
  return p(() => {
928
- let e = a.current;
929
- if (!r || e === null) return;
950
+ let e = o.current;
951
+ if (!i || e === null) return;
930
952
  let t = !0;
931
953
  return Promise.allSettled(e.getAnimations().map((e) => e.finished)).then(() => {
932
- t && i(!1);
954
+ t && a(!1);
933
955
  }), () => {
934
956
  t = !1;
935
957
  };
936
- }, [r]), /* @__PURE__ */ g("div", {
937
- ref: a,
938
- ...{
939
- 0: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu" },
940
- 1: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xqcmdr3 x1qme5af x1irg2zc x1c3o69q" }
941
- }[!!r | 0],
958
+ }, [i]), /* @__PURE__ */ g("div", {
959
+ ref: o,
960
+ ...l.props(Z.content, i && Z.reveal, Q[t]),
942
961
  children: /* @__PURE__ */ g(X, {
943
- value: n || r,
944
- children: t
962
+ value: r || i,
963
+ children: n
945
964
  })
946
965
  });
947
966
  }
948
- function Ee({ label: e, placeholder: t, startedAt: n }) {
949
- let [r, i] = h(() => Date.now() - n >= Z ? n : void 0), o = r === n;
967
+ function Oe({ label: e, placeholder: t, startedAt: n, presentation: r }) {
968
+ let [i, o] = h(() => Date.now() - n >= Ee ? n : void 0), s = i === n, c = r === "image";
950
969
  return p(() => {
951
- let e = Math.max(0, Z - (Date.now() - n)), t = setTimeout(() => i(n), e);
970
+ let e = Math.max(0, Ee - (Date.now() - n)), t = setTimeout(() => o(n), e);
952
971
  return () => clearTimeout(t);
953
972
  }, [n]), /* @__PURE__ */ _(ee, { children: [/* @__PURE__ */ g("div", {
954
973
  "aria-busy": !0,
@@ -961,16 +980,16 @@ function Ee({ label: e, placeholder: t, startedAt: n }) {
961
980
  2: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z x18usnwx" },
962
981
  1: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xqcmdr3 x1qme5af x1c3o69q x18usnwx" },
963
982
  3: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z xqcmdr3 x1qme5af x1c3o69q x18usnwx" }
964
- }[!o << 1 | !!o],
983
+ }[!(c || s) << 1 | !(c || !s)],
965
984
  children: t
966
985
  })
967
- }), o && /* @__PURE__ */ g("span", {
986
+ }), s && /* @__PURE__ */ g("span", {
968
987
  role: "status",
969
988
  ...l.props(a.hidden),
970
989
  children: e
971
990
  })] });
972
991
  }
973
- function De(e) {
992
+ function ke(e) {
974
993
  let t = f(Y), [n, r] = h(() => ({
975
994
  state: e.state,
976
995
  scope: t,
@@ -988,17 +1007,19 @@ function De(e) {
988
1007
  }
989
1008
  return /* @__PURE__ */ g("div", {
990
1009
  className: "x1n2onr6 xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
991
- children: e.state === "pending" ? /* @__PURE__ */ g(Ee, {
1010
+ children: e.state === "pending" ? /* @__PURE__ */ g(Oe, {
992
1011
  label: e.label,
993
1012
  placeholder: e.placeholder,
994
- startedAt: i.startedAt
1013
+ startedAt: i.startedAt,
1014
+ presentation: e.presentation ?? "content"
995
1015
  }) : e.state === "failed" ? /* @__PURE__ */ g("div", {
996
1016
  className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
997
1017
  children: e.children
998
1018
  }) : /* @__PURE__ */ g($, {
999
1019
  shouldEnter: i.wasPending,
1020
+ presentation: e.presentation ?? "content",
1000
1021
  children: e.children
1001
1022
  })
1002
1023
  });
1003
1024
  }
1004
- export { he as a, F as c, A as d, j as f, Te as i, I as l, re as m, $ as n, L as o, ne as p, Q as r, ie as s, De as t, k as u };
1025
+ export { he as a, F as c, A as d, j as f, Te as i, I as l, re as m, $ as n, L as o, ne as p, De as r, ie as s, ke as t, k as u };
@@ -1,4 +1,4 @@
1
- import { O as e, b as t, i as n, s as r, v as i, x as a } from "./src-BXh4g2VY.js";
1
+ import { O as e, b as t, i as n, s as r, v as i, x as a } from "./src-qU5Z5LRH.js";
2
2
  import { t as o } from "./style-composition-uYlczSsB.js";
3
3
  import { mergeProps as s } from "@base-ui/react/merge-props";
4
4
  import * as c from "@stylexjs/stylex";
@@ -354,6 +354,7 @@ function M({ children: e, xstyle: t, render: n, ref: o, ...s }) {
354
354
  // packages/core/src/avatar.tsx
355
355
  var N = {
356
356
  avatar: {
357
+ kB7OPa: "x9f619",
357
358
  k1xSpc: "x3nfvp2",
358
359
  kmuXW: "x2lah0s",
359
360
  kGNEyG: "x6s0dn4",
package/dist/tokens.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./constants.stylex-bbdiv1fD.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./constants.stylex-BILvnwUk.js";
2
2
  import { a as l, c as u, d, i as f, l as p, n as m, o as h, r as g, s as _, t as v, u as y } from "./tokens.stylex-DTHHFbyl.js";
3
3
  export { v as avatarColors, m as chartColors, g as colors, c as conditions, f as controls, i as darkAvatarColors, o as darkChartColors, n as darkColors, e as darkShadows, a as darkSyntaxColors, s as layers, t as loading, l as motion, h as pageGeometry, _ as radii, u as shadows, p as spacing, y as syntaxColors, r as tableGeometry, d as typography };
@@ -0,0 +1,45 @@
1
+ import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
+ // packages/foundations/src/use-scroll-tab-index.ts
3
+ var i = "a[href],button,input,select,textarea,summary,[contenteditable=\"true\"],[tabindex]";
4
+ function a() {
5
+ let a = n(null), [o, s] = r(null), [c, l] = r(!1), u = e((e) => {
6
+ a.current = e, s(e);
7
+ }, []);
8
+ return t(() => {
9
+ if (o === null) return;
10
+ let e = o;
11
+ function t() {
12
+ let t = getComputedStyle(e), n = /auto|scroll/u.test(t.overflowX) && e.scrollWidth > e.clientWidth + 1, r = /auto|scroll/u.test(t.overflowY) && e.scrollHeight > e.clientHeight + 1, a = Array.from(e.querySelectorAll(i)).some((e) => !e.matches(":disabled") && e.closest("[hidden],[inert]") === null && e.tabIndex >= 0 && e.getClientRects().length > 0);
13
+ l(n || r && !a);
14
+ }
15
+ let n = new ResizeObserver(t);
16
+ function r() {
17
+ n.disconnect(), n.observe(e);
18
+ for (let t of e.children) n.observe(t);
19
+ }
20
+ let a = new MutationObserver(() => {
21
+ r(), t();
22
+ });
23
+ return a.observe(e, {
24
+ childList: !0,
25
+ characterData: !0,
26
+ subtree: !0,
27
+ attributes: !0,
28
+ attributeFilter: [
29
+ "open",
30
+ "hidden",
31
+ "inert",
32
+ "disabled",
33
+ "class",
34
+ "style"
35
+ ]
36
+ }), r(), () => {
37
+ n.disconnect(), a.disconnect();
38
+ };
39
+ }, [o]), {
40
+ ref: u,
41
+ viewport: a,
42
+ tabIndex: c ? 0 : -1
43
+ };
44
+ }
45
+ export { a as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechane-ai/elements",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "description": "Elements by Mechane — React components for applications, AI interfaces, and analytical graphics",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -67,7 +67,7 @@ export const darkSyntaxColors = stylex.defineConsts({
67
67
  type: '#84bce3',
68
68
  });
69
69
 
70
- export const loading = stylex.defineConsts({ delaySeconds: 2, revealMs: 80, placeholderMs: 120 });
70
+ export const loading = stylex.defineConsts({ delaySeconds: 2, revealMs: 80, imageRevealMs: 200, placeholderMs: 120 });
71
71
 
72
72
  export const darkShadows = stylex.defineConsts({ popup: '0 4px 16px #00000066' });
73
73