@commenda/pathfinder 0.1.0 → 0.2.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/accordion/AccordionSection.js +9 -3
  3. package/dist/components/address-input/AddressInput.js +1 -1
  4. package/dist/components/artifact-card/ArtifactCard.js +1 -1
  5. package/dist/components/artifact-panel/ArtifactPanel.js +81 -55
  6. package/dist/components/attachment/Attachment.d.ts +2 -6
  7. package/dist/components/attachment/Attachment.js +59 -36
  8. package/dist/components/attachment/AttachmentCard.d.ts +1 -1
  9. package/dist/components/attachment/AttachmentCard.js +56 -43
  10. package/dist/components/attachment/attachment-class-names.d.ts +1 -1
  11. package/dist/components/attachment/attachment-class-names.js +1 -1
  12. package/dist/components/attachment-group/AttachmentGroup.js +1 -1
  13. package/dist/components/avatar/avatar-helper.d.ts +1 -1
  14. package/dist/components/banner/Banner.js +5 -2
  15. package/dist/components/button/Button.js +1 -1
  16. package/dist/components/calendar/CalendarAgenda.js +1 -1
  17. package/dist/components/calendar/CalendarArtwork.js +16 -22
  18. package/dist/components/calendar/CalendarEventContent.js +2 -2
  19. package/dist/components/calendar/CalendarPopup.js +102 -82
  20. package/dist/components/calendar/CalendarToolbar.js +10 -10
  21. package/dist/components/card/Card.js +47 -41
  22. package/dist/components/checkbox/Checkbox.js +31 -13
  23. package/dist/components/choices/choice-motion.d.ts +12 -0
  24. package/dist/components/choices/choice-motion.js +22 -0
  25. package/dist/components/code-block/CodeBlock.js +3 -2
  26. package/dist/components/controls/control-class-names.d.ts +1 -0
  27. package/dist/components/controls/control-class-names.js +8 -8
  28. package/dist/components/controls/useHoverHighlight.d.ts +12 -0
  29. package/dist/components/controls/useHoverHighlight.js +51 -0
  30. package/dist/components/controls/useSelectionIndicator.d.ts +3 -4
  31. package/dist/components/controls/useSelectionIndicator.js +43 -28
  32. package/dist/components/data-grid/DataGrid.js +7 -7
  33. package/dist/components/data-grid/DataGridHeaders.js +1 -1
  34. package/dist/components/date-picker/DateCalendar.js +3 -3
  35. package/dist/components/date-picker/DatePicker.js +10 -10
  36. package/dist/components/date-picker/field/DateField.js +1 -1
  37. package/dist/components/description-list/DescriptionList.js +2 -2
  38. package/dist/components/dialog/ConfirmDialog.js +1 -1
  39. package/dist/components/dialog/Dialog.js +1 -1
  40. package/dist/components/distribution-bar/DistributionBar.js +45 -35
  41. package/dist/components/drag-handle/DragHandle.d.ts +1 -1
  42. package/dist/components/dropdown/Dropdown.js +27 -26
  43. package/dist/components/dropdown/MenuContent.js +100 -69
  44. package/dist/components/dropdown/dropdown-types.d.ts +1 -0
  45. package/dist/components/dropdown/menu-motion.d.ts +2 -0
  46. package/dist/components/dropdown/menu-motion.js +4 -0
  47. package/dist/components/feedback/FeedbackIcon.d.ts +2 -1
  48. package/dist/components/feedback/FeedbackIcon.js +4 -4
  49. package/dist/components/feedback/FeedbackSurface.d.ts +3 -3
  50. package/dist/components/feedback/FeedbackSurface.js +49 -21
  51. package/dist/components/fields/FieldAction.d.ts +1 -0
  52. package/dist/components/fields/FieldAction.js +2 -2
  53. package/dist/components/icon-button/IconButton.js +37 -37
  54. package/dist/components/icons/index.js +776 -776
  55. package/dist/components/inline-reference/InlineReference.js +1 -8
  56. package/dist/components/list/List.js +2 -2
  57. package/dist/components/list/ListGroup.js +35 -30
  58. package/dist/components/list/ListTask.js +1 -1
  59. package/dist/components/list/SettingRow.js +1 -1
  60. package/dist/components/markdown/Markdown.js +11 -10
  61. package/dist/components/markdown/MarkdownTable.d.ts +1 -1
  62. package/dist/components/markdown/MarkdownTable.js +71 -54
  63. package/dist/components/otp/OTP.js +44 -43
  64. package/dist/components/output-sections/OutputRow.js +2 -3
  65. package/dist/components/overlays/OverlayFrame.js +2 -2
  66. package/dist/components/overlays/overlay-class-names.d.ts +3 -3
  67. package/dist/components/overlays/overlay-class-names.js +1 -1
  68. package/dist/components/phone-input/CountryPicker.js +11 -8
  69. package/dist/components/popover/Popover.js +2 -2
  70. package/dist/components/question-card/QuestionOptions.js +3 -3
  71. package/dist/components/radio-group/RadioGroup.js +59 -50
  72. package/dist/components/search/Search.js +51 -47
  73. package/dist/components/segmented-control/SegmentedControl.js +7 -6
  74. package/dist/components/selection/ChoiceField.js +1 -1
  75. package/dist/components/selection/ChoiceList.js +2 -1
  76. package/dist/components/selection/SearchableChoice.js +129 -114
  77. package/dist/components/selection/SelectedTags.js +1 -1
  78. package/dist/components/selection/SimpleChoice.js +95 -77
  79. package/dist/components/selection/choice-styles.d.ts +2 -2
  80. package/dist/components/selection/choice-styles.js +1 -1
  81. package/dist/components/sheet/Sheet.js +7 -7
  82. package/dist/components/side-nav/SideNav.d.ts +2 -5
  83. package/dist/components/side-nav/SideNav.js +98 -56
  84. package/dist/components/side-nav/SideNavItemView.d.ts +1 -1
  85. package/dist/components/side-nav/SideNavItemView.js +83 -98
  86. package/dist/components/side-nav/index.d.ts +2 -0
  87. package/dist/components/side-nav/index.js +1 -1
  88. package/dist/components/split-button/SplitButton.js +3 -2
  89. package/dist/components/stepper/StepMarker.js +32 -28
  90. package/dist/components/stepper/Stepper.js +30 -22
  91. package/dist/components/suggested-prompt/SuggestedPrompt.js +1 -1
  92. package/dist/components/switch/Switch.d.ts +1 -1
  93. package/dist/components/switch/Switch.js +38 -28
  94. package/dist/components/table/Table.js +134 -110
  95. package/dist/components/table/TableColumnHeader.js +20 -2
  96. package/dist/components/table/TableColumnResize.js +1 -1
  97. package/dist/components/table/TableColumnsMenu.js +1 -0
  98. package/dist/components/table/TableFilterChip.js +1 -1
  99. package/dist/components/table/TableFilterEditor.js +6 -6
  100. package/dist/components/table/TableFilters.js +1 -0
  101. package/dist/components/table/TableOptionMenu.d.ts +1 -1
  102. package/dist/components/table/TableOptionMenu.js +16 -17
  103. package/dist/components/table/TablePagination.js +1 -0
  104. package/dist/components/table/TableSelectionBar.js +4 -1
  105. package/dist/components/table/index.js +6 -6
  106. package/dist/components/table/table-column-style.js +0 -1
  107. package/dist/components/table/table-types.d.ts +5 -0
  108. package/dist/components/table/useTableData.js +2 -2
  109. package/dist/components/tabs/Tabs.js +61 -53
  110. package/dist/components/tabs/tab-class-names.d.ts +1 -1
  111. package/dist/components/tabs/tab-class-names.js +1 -1
  112. package/dist/components/tabular/TableEditCell.js +3 -1
  113. package/dist/components/tabular/tabular-class-names.d.ts +1 -0
  114. package/dist/components/tabular/tabular-class-names.js +1 -0
  115. package/dist/components/tabular/useCellEdit.js +1 -1
  116. package/dist/components/tabular/useTabularPinning.js +7 -6
  117. package/dist/components/tag/Tag.js +1 -1
  118. package/dist/components/tag-input/TagInput.js +64 -53
  119. package/dist/components/tag-input/useTagMotion.d.ts +6 -0
  120. package/dist/components/tag-input/useTagMotion.js +36 -0
  121. package/dist/components/text-area/TextArea.js +2 -1
  122. package/dist/components/thread/ThreadReply.js +10 -7
  123. package/dist/components/tool-call/ToolCall.js +2 -2
  124. package/dist/components/tree/TreeItemView.js +3 -3
  125. package/dist/index.d.ts +2 -2
  126. package/dist/index.js +37 -37
  127. package/dist/styles.css +1 -1
  128. package/package.json +5 -1
  129. package/dist/_virtual/_rolldown/runtime.js +0 -11
  130. package/dist/components/date-picker/date-values.d.ts +0 -23
  131. package/dist/components/date-picker/date-values.js +0 -52
  132. package/dist/components/table/TableHeaderPin.d.ts +0 -6
  133. package/dist/components/table/TableHeaderPin.js +0 -66
@@ -1,38 +1,66 @@
1
1
  "use client";
2
2
  import e from "clsx";
3
- import { useEffect as t, useState as n } from "react";
4
- import { jsx as r } from "react/jsx-runtime";
3
+ import { useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
4
+ import { jsx as a } from "react/jsx-runtime";
5
5
  //#region src/components/feedback/FeedbackSurface.tsx
6
- var i = ({ open: i, defaultOpen: a = !0, onOpenChange: o, dismissConfig: s, children: c }) => {
7
- let [l, u] = n(a), [d, f] = n(!1), [p, m] = n(!1), h = i ?? l, [g, _] = n(h);
8
- g !== h && (_(h), h && f(!1));
9
- let v = s?.onDismiss;
6
+ var o = typeof window > "u" ? t : n, s = ({ open: n, defaultOpen: s = !0, onOpenChange: c, dismissConfig: l, children: u }) => {
7
+ let d = r(null), f = r([]), [p, m] = i(!1), [h, g] = i(s), [_, v] = i(!(n ?? s)), [y, b] = i(!1), x = n ?? h, [S, C] = i(x);
8
+ S !== x && (C(x), x && v(!1));
9
+ let w = l?.onDismiss;
10
10
  return t(() => {
11
- if (h || d) return;
11
+ if (x || _ && !y) return;
12
12
  let e = setTimeout(() => {
13
- f(!0), p && (m(!1), v?.());
14
- }, 200);
13
+ _ ? (b(!1), w?.()) : (f.current = p ? Array.from(d.current?.parentElement?.children ?? []).filter((e) => e instanceof HTMLElement && e !== d.current).map((e) => {
14
+ let t = e.getBoundingClientRect();
15
+ return {
16
+ element: e,
17
+ top: t.top,
18
+ left: t.left
19
+ };
20
+ }) : [], v(!0));
21
+ }, p ? _ ? 180 : 100 : 0);
15
22
  return () => {
16
23
  clearTimeout(e);
17
24
  };
18
25
  }, [
19
- h,
20
- d,
21
- p,
22
- v
23
- ]), !h && d ? null : /* @__PURE__ */ r("div", {
24
- "aria-hidden": !h || void 0,
26
+ x,
27
+ _,
28
+ y,
29
+ w,
30
+ p
31
+ ]), o(() => {
32
+ if (!_ || x || !p) return;
33
+ let e = f.current.flatMap(({ element: e, top: t, left: n }) => {
34
+ let r = e.getBoundingClientRect(), i = n - r.left, a = t - r.top;
35
+ if (!i && !a || typeof e.animate != "function") return [];
36
+ let o = getComputedStyle(e).transform, s = o === "none" ? "" : o;
37
+ return [e.animate([{ transform: `translate(${String(i)}px, ${String(a)}px) ${s}` }, { transform: s || "none" }], {
38
+ duration: 180,
39
+ easing: "cubic-bezier(0.23,1,0.32,1)"
40
+ })];
41
+ });
42
+ return () => {
43
+ e.forEach((e) => {
44
+ e.cancel();
45
+ });
46
+ };
47
+ }, [
48
+ _,
49
+ x,
50
+ p
51
+ ]), !x && _ ? null : /* @__PURE__ */ a("div", {
52
+ "aria-hidden": !x || void 0,
25
53
  ref: (e) => {
26
- e && (e.inert = !h);
54
+ d.current = e, e && (e.inert = !x);
27
55
  },
28
- className: e("pf:grid pf:transition-[grid-template-rows,opacity] pf:duration-200 pf:ease-[ease-out] pf:motion-reduce:transition-none", h ? "pf:grid-rows-[1fr] pf:opacity-100" : "pf:pointer-events-none pf:grid-rows-[0fr] pf:opacity-0"),
29
- children: /* @__PURE__ */ r("div", {
56
+ className: e("pf:motion-reduce:transition-none", p && "pf:transition-opacity pf:duration-100 pf:ease-out", x ? "pf:opacity-100" : "pf:pointer-events-none pf:opacity-0"),
57
+ children: /* @__PURE__ */ a("div", {
30
58
  className: "pf:min-h-0 pf:overflow-hidden",
31
- children: c(() => {
32
- m(!0), f(!1), u(!1), o?.(!1);
59
+ children: u((e) => {
60
+ m(e.detail > 0 && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)), b(!0), v(!1), g(!1), c?.(!1);
33
61
  })
34
62
  })
35
63
  });
36
64
  };
37
65
  //#endregion
38
- export { i as FeedbackSurface };
66
+ export { s as FeedbackSurface };
@@ -1,6 +1,7 @@
1
1
  export type CopyAction = {
2
2
  kind: 'copy';
3
3
  label?: string;
4
+ onCopy?: () => void;
4
5
  onCopyError?: (error: Error) => void;
5
6
  };
6
7
  export type FieldActionConfig = CopyAction | {
@@ -16,7 +16,7 @@ function c({ config: c, value: l, fieldLabel: u, disabled: d, revealed: f, onAct
16
16
  onClick: () => {
17
17
  c.kind === "copy" ? (async () => {
18
18
  try {
19
- await navigator.clipboard.writeText(l), h("Copied");
19
+ await navigator.clipboard.writeText(l), h("Copied"), c.onCopy?.();
20
20
  } catch (e) {
21
21
  h("Could not copy. Select the text and copy it manually."), c.onCopyError?.(e instanceof Error ? e : /* @__PURE__ */ Error("Clipboard unavailable"));
22
22
  }
@@ -24,7 +24,7 @@ function c({ config: c, value: l, fieldLabel: u, disabled: d, revealed: f, onAct
24
24
  h("Could not copy.");
25
25
  }) : p();
26
26
  },
27
- className: "pf:self-stretch pf:shrink-0 pf:w-[28px] pf:flex pf:items-center pf:justify-center pf:border-0 pf:border-s pf:border-solid pf:border-soft-pearl-400 pf:bg-transparent pf:text-soft-pearl-800 pf:rounded-e-sm pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:focus-visible:-outline-offset-2 pf:disabled:opacity-50 pf:disabled:cursor-not-allowed",
27
+ className: "pf:cursor-pointer pf:self-stretch pf:shrink-0 pf:w-[28px] pf:flex pf:items-center pf:justify-center pf:border-0 pf:border-s pf:border-solid pf:border-soft-pearl-400 pf:bg-transparent pf:text-soft-pearl-800 pf:rounded-e-sm pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:focus-visible:-outline-offset-2 pf:disabled:opacity-50 pf:disabled:cursor-not-allowed",
28
28
  children: /* @__PURE__ */ o(_, { size: 16 })
29
29
  }), /* @__PURE__ */ o("span", {
30
30
  role: "status",
@@ -1,46 +1,46 @@
1
1
  "use client";
2
- import { getControlClassNames as e } from "../controls/control-class-names.js";
3
- import { ControlHint as t } from "../controls/ControlHint.js";
4
- import { ControlIcon as n } from "../controls/ControlIcon.js";
5
- import r from "clsx";
6
- import { Button as i } from "@base-ui/react/button";
7
- import { forwardRef as a, useId as o } from "react";
8
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
2
+ import { controlPressClassNames as e, getControlClassNames as t } from "../controls/control-class-names.js";
3
+ import { ControlHint as n } from "../controls/ControlHint.js";
4
+ import { ControlIcon as r } from "../controls/ControlIcon.js";
5
+ import i from "clsx";
6
+ import { Button as a } from "@base-ui/react/button";
7
+ import { forwardRef as o, useId as s } from "react";
8
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
9
9
  //#region src/components/icon-button/IconButton.tsx
10
- var u = a(({ label: a, children: u, variant: d = "tertiary", size: f = "md", destructive: p, disabled: m = !1, disabledReason: h, tooltip: g = !0, className: _, type: v = "button", "aria-describedby": y, focusableWhenDisabled: b, ...x }, S) => {
11
- let C = o(), w = m ? h : void 0;
12
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(t, {
13
- label: g ? w ? `${a}: ${w}` : a : void 0,
14
- children: /* @__PURE__ */ c(i, {
15
- ...x,
16
- type: v,
17
- ref: S,
18
- "aria-label": a,
19
- disabled: m,
20
- focusableWhenDisabled: b ?? !!w,
21
- "aria-describedby": [y, w ? C : void 0].filter(Boolean).join(" ") || void 0,
22
- "data-variant": d,
23
- "data-size": f,
24
- "data-destructive": p || void 0,
25
- "data-unavailable": m || void 0,
26
- className: r("pf-control pf-icon-button", e({
27
- variant: d,
28
- size: f,
29
- destructive: p,
30
- disabled: m,
10
+ var d = o(({ label: o, children: d, variant: f = "tertiary", size: p = "md", destructive: m, disabled: h = !1, disabledReason: g, tooltip: _ = !0, className: v, type: y = "button", "aria-describedby": b, focusableWhenDisabled: x, ...S }, C) => {
11
+ let w = s(), T = h ? g : void 0;
12
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(n, {
13
+ label: _ ? T ? `${o}: ${T}` : o : void 0,
14
+ children: /* @__PURE__ */ l(a, {
15
+ ...S,
16
+ type: y,
17
+ ref: C,
18
+ "aria-label": o,
19
+ disabled: h,
20
+ focusableWhenDisabled: x ?? !!T,
21
+ "aria-describedby": [b, T ? w : void 0].filter(Boolean).join(" ") || void 0,
22
+ "data-variant": f,
23
+ "data-size": p,
24
+ "data-destructive": m || void 0,
25
+ "data-unavailable": h || void 0,
26
+ className: i("pf-control pf-icon-button", t({
27
+ variant: f,
28
+ size: p,
29
+ destructive: m,
30
+ disabled: h,
31
31
  iconOnly: !0
32
- }), _),
33
- children: /* @__PURE__ */ c(n, {
34
- size: f === "lg" ? 20 : 16,
35
- children: u
32
+ }), e, v),
33
+ children: /* @__PURE__ */ l(r, {
34
+ size: p === "lg" ? 20 : 16,
35
+ children: d
36
36
  })
37
37
  })
38
- }), w && /* @__PURE__ */ c("span", {
38
+ }), T && /* @__PURE__ */ l("span", {
39
39
  className: "pf-control-sr pf:sr-only",
40
- id: C,
41
- children: w
40
+ id: w,
41
+ children: T
42
42
  })] });
43
43
  });
44
- u.displayName = "PathfinderIconButton";
44
+ d.displayName = "PathfinderIconButton";
45
45
  //#endregion
46
- export { u as IconButton };
46
+ export { d as IconButton };