@povio/ui 5.0.0-rc.5 → 5.0.0-rc.6

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.
@@ -8,7 +8,6 @@ import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
8
8
  import { t as ChevronUp } from "./chevron-up-D_Gqpb5M.js";
9
9
  import { t as FileUpload } from "./FileUpload--7ub3EZO.js";
10
10
  import { t as PasswordInput } from "./PasswordInput-DYwUZ4-k.js";
11
- import { t as Table } from "./Table-piX1SWvN.js";
12
11
  import { t as Info } from "./info-iUmX3uDk.js";
13
12
  import { i as Search } from "./selectDesktop.cva-CHAMxhfO.js";
14
13
  import { t as UIOverrides } from "./uiOverrides.context-BTCH9y5a.js";
@@ -46,6 +45,7 @@ import { t as Dialog } from "./Dialog-9manOgMA.js";
46
45
  import { Pagination } from "./components/pagination.js";
47
46
  import { t as Alert } from "./Alert-CnvEb1D_.js";
48
47
  import { t as Toast } from "./Toast-DtG3pA61.js";
48
+ import { t as Table } from "./Table-BN2_J_Ne.js";
49
49
  import { Link } from "./components/link.js";
50
50
  import { Badge } from "./components/badge.js";
51
51
  import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
@@ -482,7 +482,7 @@ function Inspector({ isKnown, describe, onSelect, revision, children }) {
482
482
  const [regions, setRegions] = useState([]);
483
483
  const [outline, setOutline] = useState(null);
484
484
  const [active, setActive] = useState(null);
485
- const tokensOf = useCallback((element) => inspectTokens(typeof element.className === "string" ? element.className : "", isKnown, window.innerWidth, px(getComputedStyle(document.documentElement).fontSize) || 16), [isKnown]);
485
+ const tokensOf = useCallback((element) => inspectTokens(typeof element.className === "string" ? element.className : "", isKnown, element.ownerDocument.defaultView?.innerWidth ?? 0, px(element.ownerDocument.defaultView?.getComputedStyle(element.ownerDocument.documentElement).fontSize ?? "16") || 16), [isKnown]);
486
486
  const measure = useCallback(() => {
487
487
  const stage = stageRef.current;
488
488
  if (!stage || !target || !target.isConnected) {
@@ -493,7 +493,7 @@ function Inspector({ isKnown, describe, onSelect, revision, children }) {
493
493
  const origin = stage.getBoundingClientRect();
494
494
  const box = target.getBoundingClientRect();
495
495
  const scale = target.offsetWidth ? box.width / target.offsetWidth : 1;
496
- const style = getComputedStyle(target);
496
+ const style = target.ownerDocument.defaultView.getComputedStyle(target);
497
497
  const tokens = tokensOf(target);
498
498
  const left = box.left - origin.left;
499
499
  const top = box.top - origin.top;
@@ -566,27 +566,28 @@ function Inspector({ isKnown, describe, onSelect, revision, children }) {
566
566
  useLayoutEffect(measure, [measure, revision]);
567
567
  useEffect(() => {
568
568
  const stage_0 = stageRef.current;
569
- if (!stage_0) return;
569
+ const ownerWindow = stage_0?.ownerDocument.defaultView;
570
+ if (!stage_0 || !ownerWindow) return;
570
571
  let frame = 0;
571
572
  const schedule = () => {
572
- cancelAnimationFrame(frame);
573
- frame = requestAnimationFrame(measure);
573
+ ownerWindow.cancelAnimationFrame(frame);
574
+ frame = ownerWindow.requestAnimationFrame(measure);
574
575
  };
575
576
  const observer = new ResizeObserver(schedule);
576
577
  observer.observe(stage_0);
577
578
  if (target) observer.observe(target);
578
- window.addEventListener("scroll", schedule, true);
579
+ ownerWindow.addEventListener("scroll", schedule, true);
579
580
  return () => {
580
- cancelAnimationFrame(frame);
581
+ ownerWindow.cancelAnimationFrame(frame);
581
582
  observer.disconnect();
582
- window.removeEventListener("scroll", schedule, true);
583
+ ownerWindow.removeEventListener("scroll", schedule, true);
583
584
  };
584
585
  }, [measure, target]);
585
586
  const onPointerMove = (event) => {
586
587
  if (event.target.closest(".studio-inspect-region")) return;
587
588
  const content = contentRef.current;
588
589
  if (!content) return;
589
- const hit = document.elementsFromPoint(event.clientX, event.clientY).find((element_0) => content.contains(element_0) && hasTokens(tokensOf(element_0)));
590
+ const hit = content.ownerDocument.elementsFromPoint(event.clientX, event.clientY).find((element_0) => content.contains(element_0) && hasTokens(tokensOf(element_0)));
590
591
  if (hit && hit !== target) setTarget(hit);
591
592
  };
592
593
  return /* @__PURE__ */ jsxs("div", {
@@ -3561,105 +3562,111 @@ function ZoomedDemo(t0) {
3561
3562
  }
3562
3563
  /** Every Povio UI component in one scrollable list; clicking a card zooms it into the token inspector. */
3563
3564
  function ComponentGallery(t0) {
3564
- const $ = c(12);
3565
+ const $ = c(14);
3565
3566
  const { inspector } = t0;
3567
+ const galleryRef = useRef(null);
3566
3568
  const [zoomed, setZoomed] = useState(null);
3567
3569
  const [zoomedWidth, setZoomedWidth] = useState();
3570
+ const open = (id) => {
3571
+ setZoomedWidth(galleryRef.current?.querySelector(`#gallery-card-${id} .studio-gallery-demo`)?.offsetWidth);
3572
+ setZoomed(id);
3573
+ };
3568
3574
  let t1;
3569
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
3570
- t1 = (id) => {
3571
- setZoomedWidth(document.querySelector(`#gallery-card-${id} .studio-gallery-demo`)?.offsetWidth);
3572
- setZoomed(id);
3573
- };
3574
- $[0] = t1;
3575
- } else t1 = $[0];
3576
- const open = t1;
3577
- let t2;
3578
- if ($[1] !== zoomed) {
3579
- t2 = demos.find((demo) => demo.id === zoomed);
3580
- $[1] = zoomed;
3581
- $[2] = t2;
3582
- } else t2 = $[2];
3583
- const zoomedDemo = t2;
3575
+ if ($[0] !== zoomed) {
3576
+ t1 = demos.find((demo) => demo.id === zoomed);
3577
+ $[0] = zoomed;
3578
+ $[1] = t1;
3579
+ } else t1 = $[1];
3580
+ const zoomedDemo = t1;
3584
3581
  const lastZoomed = useRef(null);
3582
+ let t2;
3585
3583
  let t3;
3586
- let t4;
3587
- if ($[3] !== zoomed) {
3588
- t3 = () => {
3584
+ if ($[2] !== zoomed) {
3585
+ t2 = () => {
3589
3586
  if (zoomed) lastZoomed.current = zoomed;
3590
- else if (lastZoomed.current) document.querySelector(`#gallery-card-${lastZoomed.current} .studio-gallery-card-hit`)?.focus();
3587
+ else if (lastZoomed.current) galleryRef.current?.querySelector(`#gallery-card-${lastZoomed.current} .studio-gallery-card-hit`)?.focus();
3591
3588
  };
3592
- t4 = [zoomed];
3593
- $[3] = zoomed;
3589
+ t3 = [zoomed];
3590
+ $[2] = zoomed;
3591
+ $[3] = t2;
3594
3592
  $[4] = t3;
3595
- $[5] = t4;
3596
3593
  } else {
3594
+ t2 = $[3];
3597
3595
  t3 = $[4];
3598
- t4 = $[5];
3599
3596
  }
3600
- useEffect(t3, t4);
3597
+ useEffect(t2, t3);
3601
3598
  if (zoomedDemo) {
3599
+ let t4;
3600
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
3601
+ t4 = () => setZoomed(null);
3602
+ $[5] = t4;
3603
+ } else t4 = $[5];
3602
3604
  let t5;
3603
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
3604
- t5 = () => setZoomed(null);
3605
- $[6] = t5;
3606
- } else t5 = $[6];
3607
- let t6;
3608
- if ($[7] !== inspector || $[8] !== zoomedDemo || $[9] !== zoomedWidth) {
3609
- t6 = /* @__PURE__ */ jsx(ZoomedDemo, {
3605
+ if ($[6] !== inspector || $[7] !== zoomedDemo || $[8] !== zoomedWidth) {
3606
+ t5 = /* @__PURE__ */ jsx(ZoomedDemo, {
3610
3607
  demo: zoomedDemo,
3611
3608
  width: zoomedWidth,
3612
3609
  inspector,
3613
- onBack: t5
3610
+ onBack: t4
3614
3611
  }, zoomedDemo.id);
3615
- $[7] = inspector;
3616
- $[8] = zoomedDemo;
3617
- $[9] = zoomedWidth;
3618
- $[10] = t6;
3619
- } else t6 = $[10];
3620
- return t6;
3612
+ $[6] = inspector;
3613
+ $[7] = zoomedDemo;
3614
+ $[8] = zoomedWidth;
3615
+ $[9] = t5;
3616
+ } else t5 = $[9];
3617
+ return t5;
3621
3618
  }
3619
+ const t4 = "studio-gallery";
3622
3620
  let t5;
3623
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
3624
- t5 = /* @__PURE__ */ jsxs("div", {
3625
- className: "studio-gallery",
3626
- children: [/* @__PURE__ */ jsx(LayoutPreview, {}), galleryGroups.map((group) => {
3627
- const items = demos.filter((demo_0) => demo_0.group === group);
3628
- if (!items.length) return null;
3629
- return /* @__PURE__ */ jsxs("section", {
3630
- className: "studio-gallery-group",
3631
- "aria-label": group,
3632
- children: [/* @__PURE__ */ jsx("h3", { children: group }), /* @__PURE__ */ jsx("div", {
3633
- className: "studio-gallery-grid",
3634
- children: items.map((demo_1) => /* @__PURE__ */ jsxs("div", {
3635
- id: `gallery-card-${demo_1.id}`,
3636
- className: `studio-gallery-card ${demo_1.wide ? "is-wide" : ""}`,
3637
- children: [
3638
- /* @__PURE__ */ jsx("button", {
3639
- type: "button",
3640
- className: "studio-gallery-card-hit",
3641
- "aria-label": `Inspect ${demo_1.title}`,
3642
- onClick: () => open(demo_1.id)
3643
- }),
3644
- /* @__PURE__ */ jsx("span", {
3645
- className: "studio-gallery-card-title",
3646
- children: demo_1.title
3647
- }),
3648
- /* @__PURE__ */ jsx(PortalHere, { children: (portalRef) => /* @__PURE__ */ jsx("div", {
3649
- ref: portalRef,
3650
- className: "studio-gallery-demo",
3651
- inert: true,
3652
- children: demo_1.render()
3653
- }) })
3654
- ]
3655
- }, demo_1.id))
3656
- })]
3657
- }, group);
3621
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
3622
+ t5 = /* @__PURE__ */ jsx(LayoutPreview, {});
3623
+ $[10] = t5;
3624
+ } else t5 = $[10];
3625
+ const t6 = galleryGroups.map((group) => {
3626
+ const items = demos.filter((demo_0) => demo_0.group === group);
3627
+ if (!items.length) return null;
3628
+ return /* @__PURE__ */ jsxs("section", {
3629
+ className: "studio-gallery-group",
3630
+ "aria-label": group,
3631
+ children: [/* @__PURE__ */ jsx("h3", { children: group }), /* @__PURE__ */ jsx("div", {
3632
+ className: "studio-gallery-grid",
3633
+ children: items.map((demo_1) => /* @__PURE__ */ jsxs("div", {
3634
+ id: `gallery-card-${demo_1.id}`,
3635
+ className: `studio-gallery-card ${demo_1.wide ? "is-wide" : ""}`,
3636
+ children: [
3637
+ /* @__PURE__ */ jsx("button", {
3638
+ type: "button",
3639
+ className: "studio-gallery-card-hit",
3640
+ "aria-label": `Inspect ${demo_1.title}`,
3641
+ onClick: () => open(demo_1.id)
3642
+ }),
3643
+ /* @__PURE__ */ jsx("span", {
3644
+ className: "studio-gallery-card-title",
3645
+ children: demo_1.title
3646
+ }),
3647
+ /* @__PURE__ */ jsx(PortalHere, { children: (portalRef) => /* @__PURE__ */ jsx("div", {
3648
+ ref: portalRef,
3649
+ className: "studio-gallery-demo",
3650
+ inert: true,
3651
+ children: demo_1.render()
3652
+ }) })
3653
+ ]
3654
+ }, demo_1.id))
3658
3655
  })]
3656
+ }, group);
3657
+ });
3658
+ let t7;
3659
+ if ($[11] !== t5 || $[12] !== t6) {
3660
+ t7 = /* @__PURE__ */ jsxs("div", {
3661
+ ref: galleryRef,
3662
+ className: t4,
3663
+ children: [t5, t6]
3659
3664
  });
3660
3665
  $[11] = t5;
3661
- } else t5 = $[11];
3662
- return t5;
3666
+ $[12] = t6;
3667
+ $[13] = t7;
3668
+ } else t7 = $[13];
3669
+ return t7;
3663
3670
  }
3664
3671
  //#endregion
3665
3672
  export { ComponentGallery as default };
@@ -1,71 +1,18 @@
1
1
  import { t as logger } from "./logger-CqZjM-sn.js";
2
- import { t as createLucideIcon } from "./createLucideIcon-LcezOE4z.js";
3
2
  import { t as UIConfig } from "./uiConfig.context-BS3r_kTS.js";
4
3
  import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
5
4
  import { t as ChevronUp } from "./chevron-up-D_Gqpb5M.js";
5
+ import { a as tableHeaderTextDefinition, c as GripVertical, i as tableHeadRowDefinition, n as tableDataDefinition, o as tableRowDefinition, r as tableHeadDataDefinition, s as theadDefinition, t as tableCellTextDefinition } from "./table.cva-D5oQ-QvA.js";
6
6
  import { t as clsx } from "./clsx-CnD0nOiA.js";
7
7
  import { t as UIOverrides } from "./uiOverrides.context-BTCH9y5a.js";
8
8
  import { t as IconSlot } from "./IconSlot-DSK7qNxc.js";
9
9
  import { t as Typography } from "./Typography-LU4z2pR1.js";
10
10
  import { InlineIconButton } from "./components/inline-icon-button.js";
11
11
  import { t as useIntersectionObserver } from "./useIntersectionObserver-DYfHnGGU.js";
12
- import { a as tableHeaderTextDefinition, i as tableHeadRowDefinition, n as tableDataDefinition, o as tableRowDefinition, r as tableHeadDataDefinition, s as theadDefinition, t as tableCellTextDefinition } from "./table.cva-DlMT-zLD.js";
13
12
  import { Suspense, lazy, useCallback, useMemo, useRef, useState } from "react";
14
13
  import { jsx, jsxs } from "react/jsx-runtime";
15
14
  import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
16
15
  import i18next from "i18next";
17
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/grip-vertical.mjs
18
- /**
19
- * @license lucide-react v1.43.0 - ISC
20
- *
21
- * This source code is licensed under the ISC license.
22
- * See the LICENSE file in the root directory of this source tree.
23
- */
24
- const __iconData = {
25
- name: "grip-vertical",
26
- size: 24,
27
- node: [
28
- ["circle", {
29
- cx: "9",
30
- cy: "12",
31
- r: "1",
32
- key: "1vctgf"
33
- }],
34
- ["circle", {
35
- cx: "9",
36
- cy: "5",
37
- r: "1",
38
- key: "hp0tcf"
39
- }],
40
- ["circle", {
41
- cx: "9",
42
- cy: "19",
43
- r: "1",
44
- key: "fkjjf6"
45
- }],
46
- ["circle", {
47
- cx: "15",
48
- cy: "12",
49
- r: "1",
50
- key: "1tmaij"
51
- }],
52
- ["circle", {
53
- cx: "15",
54
- cy: "5",
55
- r: "1",
56
- key: "19l28e"
57
- }],
58
- ["circle", {
59
- cx: "15",
60
- cy: "19",
61
- r: "1",
62
- key: "f4zoj3"
63
- }]
64
- ]
65
- };
66
- __iconData.node;
67
- const GripVertical = createLucideIcon(__iconData);
68
- //#endregion
69
16
  //#region src/components/table/CellText.tsx
70
17
  const CellText = (props) => {
71
18
  const uiConfig = UIConfig.useConfig();