@orangecheck/app-design 0.5.10 → 0.5.12

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.
@@ -1,4 +1,4 @@
1
- import { forwardRef, createContext, createElement, useRef, useState, useEffect, useContext, Children, isValidElement, cloneElement, useCallback } from 'react';
1
+ import { forwardRef, createContext, createElement, useRef, useState, useEffect, useContext, Children, isValidElement, cloneElement, useCallback, Component } from 'react';
2
2
  import { clsx } from 'clsx';
3
3
  import { extendTailwindMerge } from 'tailwind-merge';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -440,7 +440,19 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
440
440
  return () => ro.disconnect();
441
441
  }, [measure]);
442
442
  return /* @__PURE__ */ jsxs("div", { className: cn("relative min-w-0", className), ...props, children: [
443
- /* @__PURE__ */ jsx("div", { ref, onScroll: measure, className: cn("overflow-x-auto overscroll-x-contain", innerClassName), children }),
443
+ /* @__PURE__ */ jsx(
444
+ "div",
445
+ {
446
+ ref,
447
+ onScroll: measure,
448
+ tabIndex: edges.left || edges.right ? 0 : void 0,
449
+ className: cn(
450
+ "overflow-x-auto overscroll-x-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-ring",
451
+ innerClassName
452
+ ),
453
+ children
454
+ }
455
+ ),
444
456
  /* @__PURE__ */ jsx(
445
457
  "span",
446
458
  {
@@ -1390,7 +1402,38 @@ function Monogram({
1390
1402
  }
1391
1403
  );
1392
1404
  }
1405
+ var ErrorBoundary = class extends Component {
1406
+ constructor() {
1407
+ super(...arguments);
1408
+ this.state = { failed: false, key: this.props.resetKey };
1409
+ this.reset = () => this.setState({ failed: false });
1410
+ }
1411
+ static getDerivedStateFromError() {
1412
+ return { failed: true };
1413
+ }
1414
+ static getDerivedStateFromProps(props, state) {
1415
+ return props.resetKey === state.key ? null : { failed: false, key: props.resetKey };
1416
+ }
1417
+ componentDidCatch(error, info) {
1418
+ this.props.onError?.(error, info);
1419
+ }
1420
+ render() {
1421
+ if (!this.state.failed) return this.props.children;
1422
+ if (this.props.fallback) return this.props.fallback(this.reset);
1423
+ return /* @__PURE__ */ jsx("div", { className: "oca-container py-16", children: /* @__PURE__ */ jsx(
1424
+ EmptyState,
1425
+ {
1426
+ title: "Something on this page broke.",
1427
+ action: /* @__PURE__ */ jsxs(Fragment, { children: [
1428
+ /* @__PURE__ */ jsx(Button, { onClick: this.reset, children: "Try again" }),
1429
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => window.location.reload(), children: "Reload the page" })
1430
+ ] }),
1431
+ children: "Nothing you saved is affected. If it keeps happening, tell us at hello@ochk.io."
1432
+ }
1433
+ ) });
1434
+ }
1435
+ };
1393
1436
 
1394
- export { Accent, ActivityList, BrowserFrame, CodeBlock, Container, CopyButton, DataTable, Display, DocHeader, DocLayout, EmptyLine, EmptyState, Eyebrow, FloatChip, Footnote, HashChip, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PageHeader, PageHero, PhoneFrame, ProgressSteps, Prose, Reveal, Sats, SatsFigure, ScrollStory, Section, SectionIntro, SplitBar, StatCard, StatGrid, StepGrid, Ticker, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView };
1437
+ export { Accent, ActivityList, BrowserFrame, CodeBlock, Container, CopyButton, DataTable, Display, DocHeader, DocLayout, EmptyLine, EmptyState, ErrorBoundary, Eyebrow, FloatChip, Footnote, HashChip, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PageHeader, PageHero, PhoneFrame, ProgressSteps, Prose, Reveal, Sats, SatsFigure, ScrollStory, Section, SectionIntro, SplitBar, StatCard, StatGrid, StepGrid, Ticker, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView };
1395
1438
  //# sourceMappingURL=components.mjs.map
1396
1439
  //# sourceMappingURL=components.mjs.map