@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.
- package/CHANGELOG.md +12 -0
- package/dist/components/accordion/AccordionSection.js +9 -3
- package/dist/components/address-input/AddressInput.js +1 -1
- package/dist/components/artifact-card/ArtifactCard.js +1 -1
- package/dist/components/artifact-panel/ArtifactPanel.js +81 -55
- package/dist/components/attachment/Attachment.d.ts +2 -6
- package/dist/components/attachment/Attachment.js +59 -36
- package/dist/components/attachment/AttachmentCard.d.ts +1 -1
- package/dist/components/attachment/AttachmentCard.js +56 -43
- package/dist/components/attachment/attachment-class-names.d.ts +1 -1
- package/dist/components/attachment/attachment-class-names.js +1 -1
- package/dist/components/attachment-group/AttachmentGroup.js +1 -1
- package/dist/components/avatar/avatar-helper.d.ts +1 -1
- package/dist/components/banner/Banner.js +5 -2
- package/dist/components/button/Button.js +1 -1
- package/dist/components/calendar/CalendarAgenda.js +1 -1
- package/dist/components/calendar/CalendarArtwork.js +16 -22
- package/dist/components/calendar/CalendarEventContent.js +2 -2
- package/dist/components/calendar/CalendarPopup.js +102 -82
- package/dist/components/calendar/CalendarToolbar.js +10 -10
- package/dist/components/card/Card.js +47 -41
- package/dist/components/checkbox/Checkbox.js +31 -13
- package/dist/components/choices/choice-motion.d.ts +12 -0
- package/dist/components/choices/choice-motion.js +22 -0
- package/dist/components/code-block/CodeBlock.js +3 -2
- package/dist/components/controls/control-class-names.d.ts +1 -0
- package/dist/components/controls/control-class-names.js +8 -8
- package/dist/components/controls/useHoverHighlight.d.ts +12 -0
- package/dist/components/controls/useHoverHighlight.js +51 -0
- package/dist/components/controls/useSelectionIndicator.d.ts +3 -4
- package/dist/components/controls/useSelectionIndicator.js +43 -28
- package/dist/components/data-grid/DataGrid.js +7 -7
- package/dist/components/data-grid/DataGridHeaders.js +1 -1
- package/dist/components/date-picker/DateCalendar.js +3 -3
- package/dist/components/date-picker/DatePicker.js +10 -10
- package/dist/components/date-picker/field/DateField.js +1 -1
- package/dist/components/description-list/DescriptionList.js +2 -2
- package/dist/components/dialog/ConfirmDialog.js +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/distribution-bar/DistributionBar.js +45 -35
- package/dist/components/drag-handle/DragHandle.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.js +27 -26
- package/dist/components/dropdown/MenuContent.js +100 -69
- package/dist/components/dropdown/dropdown-types.d.ts +1 -0
- package/dist/components/dropdown/menu-motion.d.ts +2 -0
- package/dist/components/dropdown/menu-motion.js +4 -0
- package/dist/components/feedback/FeedbackIcon.d.ts +2 -1
- package/dist/components/feedback/FeedbackIcon.js +4 -4
- package/dist/components/feedback/FeedbackSurface.d.ts +3 -3
- package/dist/components/feedback/FeedbackSurface.js +49 -21
- package/dist/components/fields/FieldAction.d.ts +1 -0
- package/dist/components/fields/FieldAction.js +2 -2
- package/dist/components/icon-button/IconButton.js +37 -37
- package/dist/components/icons/index.js +776 -776
- package/dist/components/inline-reference/InlineReference.js +1 -8
- package/dist/components/list/List.js +2 -2
- package/dist/components/list/ListGroup.js +35 -30
- package/dist/components/list/ListTask.js +1 -1
- package/dist/components/list/SettingRow.js +1 -1
- package/dist/components/markdown/Markdown.js +11 -10
- package/dist/components/markdown/MarkdownTable.d.ts +1 -1
- package/dist/components/markdown/MarkdownTable.js +71 -54
- package/dist/components/otp/OTP.js +44 -43
- package/dist/components/output-sections/OutputRow.js +2 -3
- package/dist/components/overlays/OverlayFrame.js +2 -2
- package/dist/components/overlays/overlay-class-names.d.ts +3 -3
- package/dist/components/overlays/overlay-class-names.js +1 -1
- package/dist/components/phone-input/CountryPicker.js +11 -8
- package/dist/components/popover/Popover.js +2 -2
- package/dist/components/question-card/QuestionOptions.js +3 -3
- package/dist/components/radio-group/RadioGroup.js +59 -50
- package/dist/components/search/Search.js +51 -47
- package/dist/components/segmented-control/SegmentedControl.js +7 -6
- package/dist/components/selection/ChoiceField.js +1 -1
- package/dist/components/selection/ChoiceList.js +2 -1
- package/dist/components/selection/SearchableChoice.js +129 -114
- package/dist/components/selection/SelectedTags.js +1 -1
- package/dist/components/selection/SimpleChoice.js +95 -77
- package/dist/components/selection/choice-styles.d.ts +2 -2
- package/dist/components/selection/choice-styles.js +1 -1
- package/dist/components/sheet/Sheet.js +7 -7
- package/dist/components/side-nav/SideNav.d.ts +2 -5
- package/dist/components/side-nav/SideNav.js +98 -56
- package/dist/components/side-nav/SideNavItemView.d.ts +1 -1
- package/dist/components/side-nav/SideNavItemView.js +83 -98
- package/dist/components/side-nav/index.d.ts +2 -0
- package/dist/components/side-nav/index.js +1 -1
- package/dist/components/split-button/SplitButton.js +3 -2
- package/dist/components/stepper/StepMarker.js +32 -28
- package/dist/components/stepper/Stepper.js +30 -22
- package/dist/components/suggested-prompt/SuggestedPrompt.js +1 -1
- package/dist/components/switch/Switch.d.ts +1 -1
- package/dist/components/switch/Switch.js +38 -28
- package/dist/components/table/Table.js +134 -110
- package/dist/components/table/TableColumnHeader.js +20 -2
- package/dist/components/table/TableColumnResize.js +1 -1
- package/dist/components/table/TableColumnsMenu.js +1 -0
- package/dist/components/table/TableFilterChip.js +1 -1
- package/dist/components/table/TableFilterEditor.js +6 -6
- package/dist/components/table/TableFilters.js +1 -0
- package/dist/components/table/TableOptionMenu.d.ts +1 -1
- package/dist/components/table/TableOptionMenu.js +16 -17
- package/dist/components/table/TablePagination.js +1 -0
- package/dist/components/table/TableSelectionBar.js +4 -1
- package/dist/components/table/index.js +6 -6
- package/dist/components/table/table-column-style.js +0 -1
- package/dist/components/table/table-types.d.ts +5 -0
- package/dist/components/table/useTableData.js +2 -2
- package/dist/components/tabs/Tabs.js +61 -53
- package/dist/components/tabs/tab-class-names.d.ts +1 -1
- package/dist/components/tabs/tab-class-names.js +1 -1
- package/dist/components/tabular/TableEditCell.js +3 -1
- package/dist/components/tabular/tabular-class-names.d.ts +1 -0
- package/dist/components/tabular/tabular-class-names.js +1 -0
- package/dist/components/tabular/useCellEdit.js +1 -1
- package/dist/components/tabular/useTabularPinning.js +7 -6
- package/dist/components/tag/Tag.js +1 -1
- package/dist/components/tag-input/TagInput.js +64 -53
- package/dist/components/tag-input/useTagMotion.d.ts +6 -0
- package/dist/components/tag-input/useTagMotion.js +36 -0
- package/dist/components/text-area/TextArea.js +2 -1
- package/dist/components/thread/ThreadReply.js +10 -7
- package/dist/components/tool-call/ToolCall.js +2 -2
- package/dist/components/tree/TreeItemView.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +37 -37
- package/dist/styles.css +1 -1
- package/package.json +5 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -11
- package/dist/components/date-picker/date-values.d.ts +0 -23
- package/dist/components/date-picker/date-values.js +0 -52
- package/dist/components/table/TableHeaderPin.d.ts +0 -6
- package/dist/components/table/TableHeaderPin.js +0 -66
|
@@ -33,7 +33,7 @@ function h({ item: h, layout: g, size: _, emptyLabel: v }) {
|
|
|
33
33
|
}));
|
|
34
34
|
}, T = h.value === null || h.value === void 0 || h.value === "";
|
|
35
35
|
return /* @__PURE__ */ m("div", {
|
|
36
|
-
className: u("pf:group pf:grid pf:min-w-0 pf:items-start pf:gap-x-xl pf:gap-y-xs pf:rounded-md pf:ps-md pf:pe-xs pf:hover:bg-soft-pearl-200 pf:focus-within:bg-soft-pearl-200", g === "inline" ? "pf:grid-cols-[minmax(0,200px)_minmax(0,1fr)]" : g === "auto" ? "pf:@min-[480px]:grid-cols-[200px_minmax(0,1fr)]" : "pf:grid-cols-1", _ === "compact" ? "pf:py-xs pf:min-h-[28px]" : "pf:py-md pf:min-h-[36px]"),
|
|
36
|
+
className: u("pf:group pf:grid pf:min-w-0 pf:items-start pf:gap-x-xl pf:gap-y-xs pf:rounded-md pf:ps-md pf:pe-xs pf:[@media(hover:hover)]:hover:bg-soft-pearl-200 pf:motion-safe:transition-colors pf:duration-120 pf:ease-out pf:focus-within:transition-none pf:focus-within:bg-soft-pearl-200", g === "inline" ? "pf:grid-cols-[minmax(0,200px)_minmax(0,1fr)]" : g === "auto" ? "pf:@min-[480px]:grid-cols-[200px_minmax(0,1fr)]" : "pf:grid-cols-1", _ === "compact" ? "pf:py-xs pf:min-h-[28px]" : "pf:py-md pf:min-h-[36px]"),
|
|
37
37
|
children: [/* @__PURE__ */ m("dt", {
|
|
38
38
|
className: "pf:min-w-0 pf:text-soft-pearl-800 pf:leading-[20px] pf:wrap-anywhere",
|
|
39
39
|
children: [/* @__PURE__ */ m("span", {
|
|
@@ -63,7 +63,7 @@ function h({ item: h, layout: g, size: _, emptyLabel: v }) {
|
|
|
63
63
|
children: x ? T ? v : typeof h.value == "boolean" ? String(h.value) : h.value : h.sensitiveConfig?.mask ?? "••••••••"
|
|
64
64
|
}),
|
|
65
65
|
(h.copyConfig || h.editConfig || h.sensitiveConfig || h.sourceConfig || h.editedConfig) && /* @__PURE__ */ m("div", {
|
|
66
|
-
className: "pf:flex pf:shrink-0 pf:items-center pf:-my-xs pf:opacity-100 pf:[@media(hover:hover)]:opacity-0 pf:group-hover:opacity-100 pf:group-focus-within:opacity-100",
|
|
66
|
+
className: "pf:flex pf:shrink-0 pf:items-center pf:-my-xs pf:opacity-100 pf:motion-safe:transition-opacity pf:duration-120 pf:ease-out pf:group-focus-within:transition-none pf:[@media(hover:hover)]:opacity-0 pf:group-hover:opacity-100 pf:group-focus-within:opacity-100",
|
|
67
67
|
children: [
|
|
68
68
|
h.sensitiveConfig && /* @__PURE__ */ p(n, {
|
|
69
69
|
size: "sm",
|
|
@@ -21,7 +21,7 @@ function d(d) {
|
|
|
21
21
|
ref: y,
|
|
22
22
|
initialFocus: _?.initialFocusRef ?? (() => y.current?.querySelector("button") ?? y.current),
|
|
23
23
|
finalFocus: _?.returnFocusRef,
|
|
24
|
-
className: o(n, "pf:w-[400px] pf:max-w-full pf:max-h-[calc(100dvh-32px)] pf:overflow-y-auto", v.animate && "pf:transition-[opacity,transform] pf:duration-
|
|
24
|
+
className: o(n, "pf:w-[400px] pf:max-w-full pf:max-h-[calc(100dvh-32px)] pf:overflow-y-auto", v.animate && "pf:transition-[opacity,transform] pf:duration-180 pf:data-[ending-style]:duration-120 pf:ease-[cubic-bezier(0.23,1,0.32,1)] pf:motion-reduce:transition-none pf:data-[starting-style]:opacity-0 pf:data-[ending-style]:opacity-0 pf:motion-safe:data-[starting-style]:[transform:scale(0.98)] pf:motion-safe:data-[ending-style]:[transform:scale(0.98)]"),
|
|
25
25
|
children: /* @__PURE__ */ c(i, {
|
|
26
26
|
confirm: !0,
|
|
27
27
|
heading: /* @__PURE__ */ c(u.Title, {
|
|
@@ -26,7 +26,7 @@ function d(d) {
|
|
|
26
26
|
initialFocus: y?.initialFocusRef ?? (() => S.current?.querySelector("[data-overlay-body] input:not(:disabled), [data-overlay-body] textarea:not(:disabled), [data-overlay-body] button:not(:disabled), [data-overlay-body] a[href]") ?? S.current),
|
|
27
27
|
finalFocus: y?.returnFocusRef,
|
|
28
28
|
"aria-busy": x.pending || void 0,
|
|
29
|
-
className: a(t, u[h], "pf:max-w-full pf:max-h-[calc(100dvh-32px)]", x.animate && "pf:transition-[opacity,transform] pf:duration-
|
|
29
|
+
className: a(t, u[h], "pf:max-w-full pf:max-h-[calc(100dvh-32px)]", x.animate && "pf:transition-[opacity,transform] pf:duration-180 pf:data-[ending-style]:duration-120 pf:ease-[cubic-bezier(0.23,1,0.32,1)] pf:motion-reduce:transition-none pf:data-[starting-style]:opacity-0 pf:data-[ending-style]:opacity-0 pf:motion-safe:data-[starting-style]:[transform:scale(0.98)] pf:motion-safe:data-[ending-style]:[transform:scale(0.98)]", b),
|
|
30
30
|
children: /* @__PURE__ */ s(r, {
|
|
31
31
|
closeConfig: d.closeConfig,
|
|
32
32
|
heading: /* @__PURE__ */ s(l.Title, {
|
|
@@ -7,24 +7,34 @@ import { useId as a, useState as o } from "react";
|
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/distribution-bar/DistributionBar.tsx
|
|
9
9
|
function l({ label: l, segments: u, total: d, headerConfig: f, size: p = "md", legend: m = "inline", formatValue: h = (e) => new Intl.NumberFormat("en").format(e), highlightConfig: g, className: _ }) {
|
|
10
|
-
let v = a(), [
|
|
11
|
-
g ||
|
|
12
|
-
},
|
|
13
|
-
if (
|
|
10
|
+
let [v, y] = o(!0), b = a(), [x, S] = o(null), C = g ? g.activeId : x, w = (e) => {
|
|
11
|
+
g || S(e), g?.onActiveChange(e);
|
|
12
|
+
}, T = n.prepare(u, d);
|
|
13
|
+
if (T.invalid) return /* @__PURE__ */ s(t, {
|
|
14
14
|
tone: "error",
|
|
15
15
|
title: l,
|
|
16
16
|
description: "Distribution requires unique IDs, finite non-negative values, and a positive total when values are present."
|
|
17
17
|
});
|
|
18
|
-
let
|
|
18
|
+
let E = (e) => n.percentage(e, T.base), D = T.visible.filter((e) => e.value > 0), O = (e) => C === null || e === C || e === T.otherId && T.grouped.some((e) => e.id === C);
|
|
19
19
|
return /* @__PURE__ */ c("figure", {
|
|
20
|
-
"aria-labelledby":
|
|
21
|
-
|
|
20
|
+
"aria-labelledby": b,
|
|
21
|
+
"data-motion": v ? "pointer" : void 0,
|
|
22
|
+
onPointerDownCapture: () => {
|
|
23
|
+
y(!0);
|
|
24
|
+
},
|
|
25
|
+
onPointerMoveCapture: () => {
|
|
26
|
+
y(!0);
|
|
27
|
+
},
|
|
28
|
+
onKeyDownCapture: () => {
|
|
29
|
+
y(!1);
|
|
30
|
+
},
|
|
31
|
+
className: i("pf:group/distribution pf:m-0 pf:flex pf:min-w-0 pf:flex-col pf:gap-md pf:font-body pf:text-label-13 pf:text-soft-pearl-1000", _),
|
|
22
32
|
children: [
|
|
23
33
|
/* @__PURE__ */ c("figcaption", {
|
|
24
34
|
className: i("pf:flex pf:flex-wrap pf:items-center pf:justify-between pf:gap-md", f === !1 && "pf:sr-only"),
|
|
25
35
|
children: [
|
|
26
36
|
/* @__PURE__ */ s("span", {
|
|
27
|
-
id:
|
|
37
|
+
id: b,
|
|
28
38
|
className: "pf:min-w-0 pf:font-medium pf:wrap-anywhere",
|
|
29
39
|
children: l
|
|
30
40
|
}),
|
|
@@ -38,40 +48,40 @@ function l({ label: l, segments: u, total: d, headerConfig: f, size: p = "md", l
|
|
|
38
48
|
})
|
|
39
49
|
]
|
|
40
50
|
}),
|
|
41
|
-
|
|
51
|
+
T.sum > T.base && /* @__PURE__ */ s(t, {
|
|
42
52
|
tone: "warning",
|
|
43
|
-
description: `Allocation totals ${
|
|
53
|
+
description: `Allocation totals ${E(T.sum)}. The bar is scaled to the allocated amount.`
|
|
44
54
|
}),
|
|
45
55
|
/* @__PURE__ */ s("div", {
|
|
46
|
-
className: i("pf:grid pf:w-full pf:min-w-0 pf:gap-xxs pf:rounded-[4px] pf:overflow-hidden pf:bg-soft-pearl-200", p === "sm" ? "pf:h-[6px]" : "pf:h-[8px]"),
|
|
47
|
-
style: { gridTemplateColumns: [...
|
|
48
|
-
children:
|
|
49
|
-
content: t.id ===
|
|
56
|
+
className: i("pf:grid pf:w-full pf:min-w-0 pf:gap-xxs pf:rounded-[4px] pf:overflow-hidden pf:bg-soft-pearl-200 pf:transition-none pf:motion-safe:group-data-[motion=pointer]/distribution:transition-[grid-template-columns] pf:duration-200 pf:ease-[cubic-bezier(0.23,1,0.32,1)]", p === "sm" ? "pf:h-[6px]" : "pf:h-[8px]"),
|
|
57
|
+
style: { gridTemplateColumns: [...D.map((e) => `minmax(4px, ${String(e.value)}fr)`), ...T.remainder ? [`minmax(0, ${String(T.remainder)}fr)`] : []].join(" ") },
|
|
58
|
+
children: D.map((t) => /* @__PURE__ */ s(e, {
|
|
59
|
+
content: t.id === T.otherId ? T.grouped.map((e) => `${e.label}: ${h(e.value)} (${E(e.value)})`).join("; ") : `${t.label}: ${h(t.value)} (${E(t.value)})`,
|
|
50
60
|
trigger: /* @__PURE__ */ s("button", {
|
|
51
61
|
type: "button",
|
|
52
62
|
tabIndex: -1,
|
|
53
63
|
"aria-label": `${t.label} segment`,
|
|
54
64
|
onPointerEnter: () => {
|
|
55
|
-
|
|
65
|
+
w(t.id);
|
|
56
66
|
},
|
|
57
67
|
onPointerLeave: () => {
|
|
58
|
-
|
|
68
|
+
w(null);
|
|
59
69
|
},
|
|
60
70
|
onClick: () => {
|
|
61
|
-
|
|
71
|
+
w(C === t.id ? null : t.id);
|
|
62
72
|
},
|
|
63
|
-
className: "pf:min-w-0 pf:border-0 pf:p-0 pf:
|
|
73
|
+
className: "pf:min-w-0 pf:border-0 pf:p-0 pf:cursor-pointer pf:transition-none pf:motion-safe:group-data-[motion=pointer]/distribution:transition-opacity pf:duration-120 pf:ease-out",
|
|
64
74
|
style: {
|
|
65
75
|
backgroundColor: r[t.color],
|
|
66
|
-
opacity:
|
|
76
|
+
opacity: O(t.id) ? 1 : .45
|
|
67
77
|
}
|
|
68
78
|
})
|
|
69
79
|
}, t.id))
|
|
70
80
|
}),
|
|
71
81
|
/* @__PURE__ */ s("ul", {
|
|
72
82
|
className: i("pf:m-0 pf:p-0 pf:list-none pf:min-w-0", m === "none" ? "pf:sr-only pf:focus-within:not-sr-only" : m === "list" ? "pf:flex pf:flex-col" : "pf:flex pf:flex-wrap pf:gap-x-xl pf:gap-y-md"),
|
|
73
|
-
children:
|
|
74
|
-
let n = `${t.label}: ${h(t.value)} (${
|
|
83
|
+
children: T.visible.map((t) => {
|
|
84
|
+
let n = `${t.label}: ${h(t.value)} (${E(t.value)})`, a = t.id === T.otherId ? `${n}. ${T.grouped.map((e) => `${e.label}: ${h(e.value)} (${E(e.value)})`).join("; ")}` : n;
|
|
75
85
|
return /* @__PURE__ */ c("li", {
|
|
76
86
|
className: i("pf:min-w-0", m === "list" && "pf:border-0 pf:border-b-[0.5px] pf:border-solid pf:border-soft-pearl-300"),
|
|
77
87
|
children: [/* @__PURE__ */ s(e, {
|
|
@@ -80,21 +90,21 @@ function l({ label: l, segments: u, total: d, headerConfig: f, size: p = "md", l
|
|
|
80
90
|
type: "button",
|
|
81
91
|
"aria-label": n,
|
|
82
92
|
onFocus: () => {
|
|
83
|
-
|
|
93
|
+
w(t.id);
|
|
84
94
|
},
|
|
85
95
|
onBlur: () => {
|
|
86
|
-
|
|
96
|
+
w(null);
|
|
87
97
|
},
|
|
88
98
|
onPointerEnter: () => {
|
|
89
|
-
|
|
99
|
+
w(t.id);
|
|
90
100
|
},
|
|
91
101
|
onPointerLeave: () => {
|
|
92
|
-
|
|
102
|
+
w(null);
|
|
93
103
|
},
|
|
94
104
|
onClick: () => {
|
|
95
|
-
|
|
105
|
+
w(C === t.id ? null : t.id);
|
|
96
106
|
},
|
|
97
|
-
className: i("pf:flex pf:w-full pf:min-w-0 pf:items-center pf:gap-sm pf:border-0 pf:rounded-xs pf:bg-transparent pf:p-0 pf:text-start pf:font-body pf:text-label-12 pf:text-soft-pearl-900 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700", m === "list" && "pf:py-sm"),
|
|
107
|
+
className: i("pf:flex pf:w-full pf:min-w-0 pf:items-center pf:gap-sm pf:border-0 pf:rounded-xs pf:cursor-pointer pf:bg-transparent pf:p-0 pf:text-start pf:font-body pf:text-label-12 pf:text-soft-pearl-900 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700", m === "list" && "pf:py-sm"),
|
|
98
108
|
children: [
|
|
99
109
|
/* @__PURE__ */ s("span", {
|
|
100
110
|
"aria-hidden": "true",
|
|
@@ -111,35 +121,35 @@ function l({ label: l, segments: u, total: d, headerConfig: f, size: p = "md", l
|
|
|
111
121
|
}),
|
|
112
122
|
/* @__PURE__ */ s("span", {
|
|
113
123
|
className: "pf:tabular-nums pf:shrink-0 pf:text-soft-pearl-800",
|
|
114
|
-
children:
|
|
124
|
+
children: E(t.value)
|
|
115
125
|
})
|
|
116
126
|
]
|
|
117
127
|
})
|
|
118
|
-
}), t.id ===
|
|
128
|
+
}), t.id === T.otherId && /* @__PURE__ */ s("ul", {
|
|
119
129
|
className: "pf:sr-only",
|
|
120
|
-
children:
|
|
130
|
+
children: T.grouped.map((e) => /* @__PURE__ */ c("li", { children: [
|
|
121
131
|
/* @__PURE__ */ s("span", { children: e.label }),
|
|
122
132
|
": ",
|
|
123
133
|
h(e.value),
|
|
124
134
|
" (",
|
|
125
|
-
|
|
135
|
+
E(e.value),
|
|
126
136
|
")"
|
|
127
137
|
] }, e.id))
|
|
128
138
|
})]
|
|
129
139
|
}, t.id);
|
|
130
140
|
})
|
|
131
141
|
}),
|
|
132
|
-
|
|
142
|
+
T.remainder > 0 && /* @__PURE__ */ c("p", {
|
|
133
143
|
className: "pf:m-0 pf:text-copy-12 pf:text-soft-pearl-800",
|
|
134
144
|
children: [
|
|
135
145
|
"Unallocated: ",
|
|
136
|
-
h(
|
|
146
|
+
h(T.remainder),
|
|
137
147
|
" (",
|
|
138
|
-
|
|
148
|
+
E(T.remainder),
|
|
139
149
|
")"
|
|
140
150
|
]
|
|
141
151
|
}),
|
|
142
|
-
|
|
152
|
+
T.sum === 0 && /* @__PURE__ */ s("p", {
|
|
143
153
|
role: "status",
|
|
144
154
|
className: "pf:m-0 pf:text-copy-12 pf:text-soft-pearl-800",
|
|
145
155
|
children: "No allocation yet."
|
|
@@ -11,7 +11,7 @@ export interface DragHandleProps extends Omit<BaseButton.Props, 'className' | 'c
|
|
|
11
11
|
* Also provide Move up/down/to top; touch owner uses 250ms long press and active-drag scroll prevention.
|
|
12
12
|
* DRAG-GEOMETRY-01: Leading inside row; reserve space, reveal on hover/focus, always show on touch.
|
|
13
13
|
* Desktop glyph 16 in 16x24; touch target 44. Pinned items need a reason.
|
|
14
|
-
* Whole-item tabs/cards do not get handles. ResizeHandle
|
|
14
|
+
* Whole-item tabs/cards do not get handles. Use ResizeHandle for resizing panes and edges.
|
|
15
15
|
* Full rules: /docs/components/drag-handle.
|
|
16
16
|
*/
|
|
17
17
|
export declare const DragHandle: import("react").ForwardRefExoticComponent<Omit<DragHandleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ControlHint as e } from "../controls/ControlHint.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { isPointerMenuEvent as t } from "./menu-motion.js";
|
|
4
|
+
import { MenuContent as n } from "./MenuContent.js";
|
|
5
|
+
import { useId as r, useState as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { Menu as s } from "@base-ui/react/menu";
|
|
7
8
|
//#region src/components/dropdown/Dropdown.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
open:
|
|
12
|
-
defaultOpen:
|
|
13
|
-
disabled:
|
|
14
|
-
onOpenChange: (e,
|
|
15
|
-
|
|
9
|
+
var c = ({ menu: c, trigger: l, disabled: u = !1, disabledReason: d, open: f, defaultOpen: p, onOpenChange: m, ...h }) => {
|
|
10
|
+
let g = r(), [_, v] = i(!1), y = u ? d : void 0;
|
|
11
|
+
return /* @__PURE__ */ o(s.Root, {
|
|
12
|
+
open: f,
|
|
13
|
+
defaultOpen: p,
|
|
14
|
+
disabled: u,
|
|
15
|
+
onOpenChange: (e, n) => {
|
|
16
|
+
v(t(n.event)), m?.(e);
|
|
16
17
|
},
|
|
17
18
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
label:
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
render:
|
|
22
|
-
disabled:
|
|
23
|
-
"aria-describedby":
|
|
19
|
+
/* @__PURE__ */ a(e, {
|
|
20
|
+
label: y,
|
|
21
|
+
children: /* @__PURE__ */ a(s.Trigger, {
|
|
22
|
+
render: l,
|
|
23
|
+
disabled: u,
|
|
24
|
+
"aria-describedby": y ? g : void 0
|
|
24
25
|
})
|
|
25
26
|
}),
|
|
26
|
-
|
|
27
|
+
y && /* @__PURE__ */ a("span", {
|
|
27
28
|
className: "pf-control-sr pf:sr-only",
|
|
28
|
-
id:
|
|
29
|
-
children:
|
|
29
|
+
id: g,
|
|
30
|
+
children: y
|
|
30
31
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
animate:
|
|
33
|
-
menu:
|
|
34
|
-
...
|
|
32
|
+
/* @__PURE__ */ a(n, {
|
|
33
|
+
animate: _,
|
|
34
|
+
menu: c,
|
|
35
|
+
...h
|
|
35
36
|
})
|
|
36
37
|
]
|
|
37
38
|
});
|
|
38
39
|
};
|
|
39
40
|
//#endregion
|
|
40
|
-
export {
|
|
41
|
+
export { c as Dropdown };
|
|
@@ -1,113 +1,138 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ControlIcon as e } from "../controls/ControlIcon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { isPointerMenuEvent as t } from "./menu-motion.js";
|
|
4
|
+
import { NavigationLink as n } from "../controls/NavigationLink.js";
|
|
5
|
+
import { hoverHighlightClass as r, useHoverHighlight as i } from "../controls/useHoverHighlight.js";
|
|
6
|
+
import { ChevronRightIcon as a } from "../icons/ChevronRightIcon.js";
|
|
7
|
+
import { SearchMdIcon as o } from "../icons/SearchMdIcon.js";
|
|
8
|
+
import { Input as s } from "../input/Input.js";
|
|
9
|
+
import c from "clsx";
|
|
10
|
+
import { Fragment as l, useId as u, useState as d } from "react";
|
|
11
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import { Menu as h } from "@base-ui/react/menu";
|
|
13
|
+
import { useDirection as g } from "@base-ui/react/direction-provider";
|
|
12
14
|
//#region src/components/dropdown/MenuContent.tsx
|
|
13
|
-
var
|
|
14
|
-
let
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
t.leadingIcon && /* @__PURE__ */
|
|
15
|
+
var _ = ({ item: t }) => {
|
|
16
|
+
let n = g();
|
|
17
|
+
return /* @__PURE__ */ m(f, { children: [
|
|
18
|
+
t.leadingIcon && /* @__PURE__ */ p(e, {
|
|
17
19
|
size: 16,
|
|
18
20
|
children: t.leadingIcon
|
|
19
21
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ m("span", {
|
|
21
23
|
className: "pf-menu-text pf:flex pf:flex-col pf:flex-1 pf:min-w-0 pf:wrap-anywhere",
|
|
22
24
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
t.description && /* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ p("span", { children: t.label }),
|
|
26
|
+
t.description && /* @__PURE__ */ p("span", {
|
|
25
27
|
className: "pf-menu-description pf:text-soft-pearl-800 pf:font-body pf:text-copy-12 pf:font-normal",
|
|
26
28
|
children: t.description
|
|
27
29
|
}),
|
|
28
|
-
t.disabled && t.disabledReason && /* @__PURE__ */
|
|
30
|
+
t.disabled && t.disabledReason && /* @__PURE__ */ p("span", {
|
|
29
31
|
className: "pf-menu-description pf:text-soft-pearl-800 pf:font-body pf:text-copy-12 pf:font-normal",
|
|
30
32
|
children: t.disabledReason
|
|
31
33
|
})
|
|
32
34
|
]
|
|
33
35
|
}),
|
|
34
|
-
t.trailingText && /* @__PURE__ */
|
|
36
|
+
t.trailingText && /* @__PURE__ */ p("span", {
|
|
35
37
|
className: "pf-menu-meta pf:shrink pf:min-w-0 pf:max-w-[40%] pf:wrap-anywhere pf:text-soft-pearl-800 pf:font-body pf:text-[length:var(--pf-text-label-12)] pf:leading-[20px] pf:font-normal",
|
|
36
38
|
children: t.trailingText
|
|
37
39
|
}),
|
|
38
|
-
t.
|
|
39
|
-
|
|
40
|
-
children:
|
|
40
|
+
t.trailingIcon && /* @__PURE__ */ p(e, {
|
|
41
|
+
size: 16,
|
|
42
|
+
children: t.trailingIcon
|
|
43
|
+
}),
|
|
44
|
+
t.type === "submenu" && /* @__PURE__ */ p("span", {
|
|
45
|
+
className: c("pf-menu-chevron pf:flex pf:items-center pf:justify-center pf:shrink-0 pf:text-soft-pearl-800", n === "rtl" && "pf:rotate-180"),
|
|
46
|
+
children: /* @__PURE__ */ p(a, {
|
|
41
47
|
size: 16,
|
|
42
48
|
tone: "inherit"
|
|
43
49
|
})
|
|
44
50
|
})
|
|
45
51
|
] });
|
|
46
|
-
},
|
|
47
|
-
let
|
|
48
|
-
className:
|
|
52
|
+
}, v = ({ item: e, portalContainer: r, motionIndex: i }) => {
|
|
53
|
+
let a = u(), [o, s] = d(!1), l = [e.description, e.disabled ? e.disabledReason : void 0].filter(Boolean).join(". "), g = {
|
|
54
|
+
className: c([
|
|
55
|
+
"pf:delay-0",
|
|
56
|
+
"pf:delay-[18ms]",
|
|
57
|
+
"pf:delay-[36ms]",
|
|
58
|
+
"pf:delay-[54ms]",
|
|
59
|
+
"pf:delay-[72ms]",
|
|
60
|
+
"pf:delay-[90ms]"
|
|
61
|
+
][Math.min(i, 5)], "pf:relative pf-menu-row pf:box-border pf:flex pf:items-center pf:gap-sm pf:min-h-[32px] pf:py-sm pf:ps-md pf:pe-lg", "pf:rounded-sm pf:outline-none pf:cursor-pointer", "pf:[&>.pf-control-icon]:shrink-0 pf:[&>.pf-control-icon]:text-soft-pearl-800", "pf:data-highlighted:bg-soft-pearl-200 pf:data-popup-open:bg-soft-pearl-200", "pf:data-destructive:not-data-disabled:text-red-700", "pf:data-destructive:not-data-disabled:[&>.pf-control-icon]:text-red-700", "pf:data-destructive:data-highlighted:bg-red-100 pf:data-disabled:text-soft-pearl-600", "pf:data-disabled:cursor-not-allowed pf:data-disabled:[&>.pf-control-icon]:text-soft-pearl-600"),
|
|
49
62
|
disabled: e.disabled,
|
|
50
63
|
label: e.label,
|
|
51
64
|
"aria-label": e.label,
|
|
52
|
-
"aria-describedby":
|
|
65
|
+
"aria-describedby": l ? a : void 0
|
|
53
66
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
67
|
+
return /* @__PURE__ */ m(f, { children: [e.disabled ? /* @__PURE__ */ p("div", {
|
|
68
|
+
className: g.className,
|
|
69
|
+
role: "menuitem",
|
|
70
|
+
"aria-disabled": "true",
|
|
71
|
+
"aria-label": e.label,
|
|
72
|
+
"aria-describedby": g["aria-describedby"],
|
|
73
|
+
"data-disabled": "",
|
|
74
|
+
children: /* @__PURE__ */ p(_, { item: e })
|
|
75
|
+
}) : e.type === "submenu" ? /* @__PURE__ */ m(h.SubmenuRoot, {
|
|
76
|
+
onOpenChange: (e, n) => {
|
|
77
|
+
s(t(n.event));
|
|
57
78
|
},
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
-
...
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
-
animate:
|
|
79
|
+
children: [/* @__PURE__ */ p(h.SubmenuTrigger, {
|
|
80
|
+
...g,
|
|
81
|
+
children: /* @__PURE__ */ p(_, { item: e })
|
|
82
|
+
}), /* @__PURE__ */ p(y, {
|
|
83
|
+
animate: o,
|
|
63
84
|
menu: e.menu,
|
|
64
85
|
side: "inline-end",
|
|
65
86
|
align: "start",
|
|
66
|
-
portalContainer:
|
|
87
|
+
portalContainer: r
|
|
67
88
|
})]
|
|
68
|
-
}) : e.type === "link" ? /* @__PURE__ */
|
|
69
|
-
...
|
|
89
|
+
}) : e.type === "link" ? /* @__PURE__ */ p(h.Item, {
|
|
90
|
+
...g,
|
|
70
91
|
nativeButton: !1,
|
|
71
|
-
render: /* @__PURE__ */
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
}) : /* @__PURE__ */
|
|
74
|
-
...
|
|
92
|
+
render: /* @__PURE__ */ p(n, { linkConfig: e.linkConfig }),
|
|
93
|
+
children: /* @__PURE__ */ p(_, { item: e })
|
|
94
|
+
}) : /* @__PURE__ */ p(h.Item, {
|
|
95
|
+
...g,
|
|
75
96
|
"data-destructive": e.destructive || void 0,
|
|
76
97
|
onClick: e.onClick,
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
}),
|
|
79
|
-
id:
|
|
98
|
+
children: /* @__PURE__ */ p(_, { item: e })
|
|
99
|
+
}), l && /* @__PURE__ */ p("span", {
|
|
100
|
+
id: a,
|
|
80
101
|
className: "pf-control-sr pf:sr-only",
|
|
81
|
-
children:
|
|
102
|
+
children: l
|
|
82
103
|
})] });
|
|
83
|
-
},
|
|
84
|
-
let [
|
|
104
|
+
}, y = ({ menu: e, animate: t = !1, finalFocus: n, side: a = "bottom", align: u = "start", sideOffset: g = 4, portalContainer: _ }) => {
|
|
105
|
+
let y = i(), [b, x] = d(""), S = e.searchConfig?.value ?? b, C = e.loadingConfig?.isLoading ? [] : e.groups.map((t) => ({
|
|
85
106
|
...t,
|
|
86
|
-
items: !e.searchConfig || e.searchConfig.filter === "manual" || !
|
|
107
|
+
items: !e.searchConfig || e.searchConfig.filter === "manual" || !S.trim() ? t.items : t.items.filter((e) => `${e.label} ${e.description ?? ""}`.toLocaleLowerCase().includes(S.trim().toLocaleLowerCase()))
|
|
87
108
|
})).filter((e) => e.items.length);
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
container:
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
side:
|
|
92
|
-
align:
|
|
93
|
-
sideOffset:
|
|
109
|
+
return /* @__PURE__ */ p(h.Portal, {
|
|
110
|
+
container: _,
|
|
111
|
+
children: /* @__PURE__ */ p(h.Positioner, {
|
|
112
|
+
side: a,
|
|
113
|
+
align: u,
|
|
114
|
+
sideOffset: g,
|
|
94
115
|
collisionPadding: 8,
|
|
95
116
|
className: "pf-menu-positioner pf:z-50 pf:outline-none",
|
|
96
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ m(h.Popup, {
|
|
118
|
+
...y.props,
|
|
97
119
|
finalFocus: n,
|
|
98
|
-
className:
|
|
120
|
+
className: c(r, "pf-menu-popup pf:box-border pf:w-[240px] pf:max-w-(--available-width) pf:max-h-(--available-height)", "pf:overflow-y-auto pf:overscroll-contain pf:p-md pf:border-[0.5px] pf:border-solid", "pf:border-soft-pearl-300 pf:rounded-lg pf:bg-background pf:text-soft-pearl-1000", "pf:shadow-[0_1px_1px_#12121205,0_4px_10px_#12121214] pf:font-body pf:font-medium pf:text-[length:var(--pf-text-label-13)]", "pf:leading-[20px] pf:outline-none pf:origin-(--transform-origin)", "pf:motion-safe:data-animate:[&_.pf-menu-row]:transition-[opacity,transform] pf:motion-safe:data-animate:[&_.pf-menu-row]:duration-120 pf:motion-safe:data-animate:[&_.pf-menu-row]:ease-[cubic-bezier(0.23,1,0.32,1)]", "pf:motion-safe:data-animate:data-starting-style:[&_.pf-menu-row]:opacity-0 pf:motion-safe:data-animate:data-starting-style:[&_.pf-menu-row]:[transform:translateY(-3px)]", "pf:motion-safe:data-animate:data-ending-style:[&_.pf-menu-row]:delay-0 pf:motion-safe:data-animate:data-ending-style:[&_.pf-menu-row]:opacity-0", "pf:data-animate:motion-safe:transition-[opacity,transform] pf:duration-180 pf:ease-[cubic-bezier(0.23,1,0.32,1)]", "pf:data-animate:motion-safe:data-starting-style:opacity-0 pf:data-animate:motion-safe:data-starting-style:[transform:scale(0.97)]", "pf:data-animate:motion-safe:data-ending-style:opacity-0 pf:data-animate:motion-safe:data-ending-style:[transform:scale(0.97)] pf:data-ending-style:duration-120"),
|
|
99
121
|
"data-animate": t || void 0,
|
|
100
122
|
children: [
|
|
101
|
-
|
|
123
|
+
y.highlight,
|
|
124
|
+
e.searchConfig && /* @__PURE__ */ p("div", {
|
|
102
125
|
className: "pf:pb-md",
|
|
103
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ p(s, {
|
|
104
127
|
type: "search",
|
|
105
|
-
|
|
128
|
+
className: "pf:[&_input::-webkit-search-cancel-button]:appearance-none pf:[&_button]:cursor-pointer",
|
|
129
|
+
actionConfig: S ? { kind: "clear" } : void 0,
|
|
130
|
+
leadingIcon: /* @__PURE__ */ p(o, {}),
|
|
106
131
|
label: e.searchConfig.label,
|
|
107
132
|
hideLabel: !0,
|
|
108
|
-
value:
|
|
133
|
+
value: S,
|
|
109
134
|
onValueChange: (t) => {
|
|
110
|
-
|
|
135
|
+
x(t), e.searchConfig?.onValueChange?.(t);
|
|
111
136
|
},
|
|
112
137
|
onKeyDown: (e) => {
|
|
113
138
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
@@ -118,27 +143,33 @@ var m = ({ item: t }) => {
|
|
|
118
143
|
}
|
|
119
144
|
})
|
|
120
145
|
}),
|
|
121
|
-
e.loadingConfig?.isLoading && /* @__PURE__ */
|
|
146
|
+
e.loadingConfig?.isLoading && /* @__PURE__ */ p("div", {
|
|
122
147
|
role: "status",
|
|
123
148
|
className: "pf:px-md pf:py-sm pf:text-copy-12 pf:text-soft-pearl-800",
|
|
124
149
|
children: e.loadingConfig.label ?? "Loading actions…"
|
|
125
150
|
}),
|
|
126
|
-
|
|
151
|
+
C.map((e, t) => /* @__PURE__ */ m(l, { children: [t > 0 && /* @__PURE__ */ p(h.Separator, { className: "pf-menu-separator pf:h-[0.5px] pf:bg-soft-pearl-300 pf:my-xs" }), /* @__PURE__ */ m(h.Group, { children: [e.label && /* @__PURE__ */ p(h.GroupLabel, {
|
|
127
152
|
className: "pf-menu-group-label pf:py-sm pf:px-md pf:text-soft-pearl-800 pf:text-[length:var(--pf-text-label-12)]",
|
|
128
153
|
children: e.label
|
|
129
|
-
}), e.items.map((e) => /* @__PURE__ */
|
|
154
|
+
}), e.items.map((e, n) => /* @__PURE__ */ p(v, {
|
|
130
155
|
item: e,
|
|
131
|
-
|
|
156
|
+
motionIndex: C.slice(0, t).reduce((e, t) => e + t.items.length, 0) + n,
|
|
157
|
+
portalContainer: _
|
|
132
158
|
}, e.id))] })] }, e.id)),
|
|
133
|
-
!e.loadingConfig?.isLoading &&
|
|
159
|
+
!e.loadingConfig?.isLoading && C.length === 0 && /* @__PURE__ */ p("div", {
|
|
134
160
|
className: "pf-menu-empty pf:py-sm pf:px-md pf:text-soft-pearl-800 pf:text-[length:var(--pf-text-label-12)]",
|
|
135
|
-
children: e.emptyContent ?? (
|
|
161
|
+
children: e.emptyContent ?? (S ? "No matching actions" : "No actions available")
|
|
136
162
|
}),
|
|
137
|
-
e.footerContent && /* @__PURE__ */
|
|
163
|
+
e.footerContent && /* @__PURE__ */ p("div", {
|
|
138
164
|
className: "pf:border-0 pf:border-t-[0.5px] pf:border-solid pf:border-soft-pearl-300 pf:mt-xs pf:pt-md pf:px-md pf:text-copy-12 pf:text-soft-pearl-800",
|
|
139
165
|
children: e.footerContent
|
|
140
166
|
}),
|
|
141
|
-
e.footerConfig && /* @__PURE__ */
|
|
167
|
+
e.footerConfig && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(h.Separator, { className: "pf:h-[0.5px] pf:bg-soft-pearl-300 pf:my-xs" }), e.footerConfig.disabled ? /* @__PURE__ */ p("div", {
|
|
168
|
+
role: "menuitem",
|
|
169
|
+
"aria-disabled": "true",
|
|
170
|
+
className: "pf:flex pf:min-h-[32px] pf:items-center pf:px-md pf:text-soft-pearl-600 pf:cursor-not-allowed",
|
|
171
|
+
children: e.footerConfig.label
|
|
172
|
+
}) : /* @__PURE__ */ p(h.Item, {
|
|
142
173
|
onClick: e.footerConfig.onAction,
|
|
143
174
|
disabled: e.footerConfig.disabled,
|
|
144
175
|
className: "pf:box-border pf:flex pf:w-full pf:min-h-[32px] pf:items-center pf:px-md pf:rounded-sm pf:text-blue-700 pf:data-highlighted:bg-soft-pearl-200 pf:data-disabled:text-soft-pearl-600",
|
|
@@ -150,4 +181,4 @@ var m = ({ item: t }) => {
|
|
|
150
181
|
});
|
|
151
182
|
};
|
|
152
183
|
//#endregion
|
|
153
|
-
export {
|
|
184
|
+
export { y as MenuContent };
|
|
@@ -12,11 +12,11 @@ var s = {
|
|
|
12
12
|
success: t,
|
|
13
13
|
warning: i,
|
|
14
14
|
error: e
|
|
15
|
-
}, c = ({ tone: e }) => {
|
|
16
|
-
let
|
|
15
|
+
}, c = ({ tone: e, className: t }) => {
|
|
16
|
+
let n = s[e];
|
|
17
17
|
return /* @__PURE__ */ o("span", {
|
|
18
|
-
className: a("pf:
|
|
19
|
-
children: /* @__PURE__ */ o(
|
|
18
|
+
className: a("pf:inline-flex pf:shrink-0", !t && "pf:mt-px", r[e], t),
|
|
19
|
+
children: /* @__PURE__ */ o(n, {
|
|
20
20
|
size: 16,
|
|
21
21
|
tone: "inherit"
|
|
22
22
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type MouseEvent, type ReactNode } from 'react';
|
|
2
2
|
export interface DismissConfig {
|
|
3
3
|
label?: string;
|
|
4
4
|
onDismiss?: () => void;
|
|
@@ -13,10 +13,10 @@ export type FeedbackVisibility = {
|
|
|
13
13
|
onOpenChange?: (open: boolean) => void;
|
|
14
14
|
};
|
|
15
15
|
type FeedbackSurfaceProps = FeedbackVisibility & {
|
|
16
|
-
children: (onDismiss: () => void) => ReactNode;
|
|
16
|
+
children: (onDismiss: (event: MouseEvent<HTMLButtonElement>) => void) => ReactNode;
|
|
17
17
|
dismissConfig?: DismissConfig;
|
|
18
18
|
};
|
|
19
|
-
/** FEEDBACK-DISMISS-01: onOpenChange requests closure; onDismiss follows the
|
|
19
|
+
/** FEEDBACK-DISMISS-01: onOpenChange requests closure; onDismiss follows the accepted dismissal.
|
|
20
20
|
* No automatic timeout. A controlled owner may reject the close request.
|
|
21
21
|
*/
|
|
22
22
|
export declare const FeedbackSurface: ({ open: controlledOpen, defaultOpen, onOpenChange, dismissConfig, children, }: FeedbackSurfaceProps) => import("react/jsx-runtime").JSX.Element | null;
|