@stackone/malachite 2.36.0 → 2.37.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.
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as n, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import w, { useState as y, useEffect as N, useRef as k, useCallback as $ } from "react";
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { ShadowRootWrapper as
|
|
3
|
+
import { createPortal as R } from "react-dom";
|
|
4
|
+
import { ShadowRootWrapper as _ } from "../ShadowRootWrapper.js";
|
|
5
5
|
import { Keycap as z } from "./Keycap.js";
|
|
6
6
|
import F from "./TruncatedTooltip.js";
|
|
7
7
|
import { paintOnChild as c } from "./asChild.js";
|
|
8
8
|
import { useOverlayBehaviour as L } from "./overlayBehaviour.js";
|
|
9
9
|
import { OVERLAY_ELEVATED_ATTR as C, overlayIdentity as f } from "./portalOverlay.js";
|
|
10
|
-
|
|
10
|
+
import { isRenderableNode as E } from "./renderableNode.js";
|
|
11
|
+
const T = "w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[var(--malachite-radius-xxl,14px)] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] outline-none [box-shadow:0_16px_48px_0_rgba(0,0,0,0.18)]", I = ({
|
|
11
12
|
children: a,
|
|
12
13
|
onDismiss: e,
|
|
13
|
-
"aria-label":
|
|
14
|
+
"aria-label": t,
|
|
14
15
|
className: l = "",
|
|
15
16
|
style: i
|
|
16
17
|
}) => {
|
|
@@ -22,28 +23,28 @@ const E = "w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[v
|
|
|
22
23
|
hostRef: s,
|
|
23
24
|
initialFocus: "content"
|
|
24
25
|
});
|
|
25
|
-
return d ?
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
26
|
+
return d ? R(
|
|
27
|
+
/* @__PURE__ */ r(
|
|
28
|
+
_,
|
|
28
29
|
{
|
|
29
30
|
hostRef: s,
|
|
30
31
|
hostStyle: { position: "relative", zIndex: b },
|
|
31
32
|
hostProps: v ? { ...f("commandpalette"), [C]: "" } : f("commandpalette"),
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ r(
|
|
33
34
|
"div",
|
|
34
35
|
{
|
|
35
36
|
className: "fixed inset-0 z-[1000] flex items-start justify-center pt-[10vh] bg-[var(--malachite-overlay-scrim,rgba(0,0,0,0.5))]",
|
|
36
37
|
onClick: e ? (u) => u.target === u.currentTarget && e() : void 0,
|
|
37
38
|
role: "presentation",
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ r(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
42
|
ref: x,
|
|
42
43
|
role: "dialog",
|
|
43
44
|
"aria-modal": h ? "true" : void 0,
|
|
44
|
-
"aria-label":
|
|
45
|
+
"aria-label": t,
|
|
45
46
|
tabIndex: -1,
|
|
46
|
-
className: `${
|
|
47
|
+
className: `${T} ${l}`.trim(),
|
|
47
48
|
style: i,
|
|
48
49
|
children: a
|
|
49
50
|
}
|
|
@@ -54,38 +55,38 @@ const E = "w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[v
|
|
|
54
55
|
),
|
|
55
56
|
document.body
|
|
56
57
|
) : null;
|
|
57
|
-
},
|
|
58
|
+
}, S = "w-full border-none bg-transparent px-0 py-[18px] text-[length:var(--malachite-font-size-xlarge,18px)] text-[var(--malachite-text-primary)] outline-none placeholder:text-[var(--malachite-text-placeholder)]", j = ({ children: a, className: e = "", style: t }) => c(a, `${S} ${e}`.trim(), t), A = ({ children: a, scope: e, className: t = "" }) => /* @__PURE__ */ n(
|
|
58
59
|
"div",
|
|
59
60
|
{
|
|
60
|
-
className: `flex items-center gap-2 border-0 border-b border-solid border-[var(--malachite-card-border)] px-[18px] ${
|
|
61
|
+
className: `flex items-center gap-2 border-0 border-b border-solid border-[var(--malachite-card-border)] px-[18px] ${t}`.trim(),
|
|
61
62
|
children: [
|
|
62
63
|
e,
|
|
63
64
|
a
|
|
64
65
|
]
|
|
65
66
|
}
|
|
66
|
-
),
|
|
67
|
-
c(a, `${
|
|
68
|
-
e ? /* @__PURE__ */
|
|
67
|
+
), P = ({ children: a }) => /* @__PURE__ */ r("span", { className: "flex-none whitespace-nowrap rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-sunken-background)] px-2 py-[3px] text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-primary)]", children: a }), G = "max-h-[420px] overflow-auto py-1 bg-[var(--malachite-card-background)]", M = ({ children: a, hasMoreBelow: e = !1, className: t = "", style: l }) => /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
68
|
+
c(a, `${G} ${t}`.trim(), l),
|
|
69
|
+
e ? /* @__PURE__ */ r(
|
|
69
70
|
"div",
|
|
70
71
|
{
|
|
71
72
|
"aria-hidden": !0,
|
|
72
73
|
className: "pointer-events-none absolute inset-x-0 bottom-0 h-[28px] bg-[linear-gradient(to_bottom,transparent,var(--malachite-card-background))]"
|
|
73
74
|
}
|
|
74
75
|
) : null
|
|
75
|
-
] }),
|
|
76
|
+
] }), O = ({ children: a, divider: e = !1, className: t = "", style: l }) => c(
|
|
76
77
|
a,
|
|
77
|
-
`block pt-1 pb-2 ${e ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : ""} ${
|
|
78
|
+
`block pt-1 pb-2 ${e ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : ""} ${t}`.trim(),
|
|
78
79
|
l
|
|
79
|
-
),
|
|
80
|
+
), V = ({
|
|
80
81
|
children: a,
|
|
81
82
|
trailing: e
|
|
82
83
|
}) => /* @__PURE__ */ n("div", { className: "mb-1 flex items-center gap-2 px-4 text-[length:var(--malachite-font-size-xsmall,11px)] font-semibold uppercase tracking-[0.06em] text-[var(--malachite-text-secondary)]", children: [
|
|
83
84
|
a,
|
|
84
85
|
e
|
|
85
|
-
] }),
|
|
86
|
+
] }), H = "group mx-2 flex cursor-pointer items-center gap-2 rounded-[var(--malachite-radius-xl,12px)] px-3 py-[10px] text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-primary)] transition-colors hover:bg-[var(--malachite-card-sunken-background)] data-[selected=true]:bg-[var(--malachite-card-sunken-background)]", W = ({
|
|
86
87
|
children: a,
|
|
87
88
|
selected: e = !1,
|
|
88
|
-
leading:
|
|
89
|
+
leading: t,
|
|
89
90
|
label: l,
|
|
90
91
|
labelTooltip: i,
|
|
91
92
|
tags: d,
|
|
@@ -96,19 +97,19 @@ const E = "w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[v
|
|
|
96
97
|
className: h = ""
|
|
97
98
|
}) => c(
|
|
98
99
|
a,
|
|
99
|
-
`${
|
|
100
|
+
`${H} ${e ? "bg-[var(--malachite-card-sunken-background)]" : ""} ${h}`.trim(),
|
|
100
101
|
void 0,
|
|
101
102
|
/* @__PURE__ */ n(g, { children: [
|
|
102
|
-
|
|
103
|
+
t,
|
|
103
104
|
/* @__PURE__ */ n("span", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
|
|
104
|
-
l && i ? /* @__PURE__ */
|
|
105
|
-
l && !i ? /* @__PURE__ */
|
|
106
|
-
d ? /* @__PURE__ */
|
|
107
|
-
p ? /* @__PURE__ */
|
|
108
|
-
s ? /* @__PURE__ */
|
|
105
|
+
l && i ? /* @__PURE__ */ r(F, { text: i, triggerAs: "span", describesTrigger: !1, children: l }) : null,
|
|
106
|
+
l && !i ? /* @__PURE__ */ r("span", { className: "min-w-0 flex-[0_1_auto] overflow-hidden text-ellipsis whitespace-nowrap", children: l }) : null,
|
|
107
|
+
d ? /* @__PURE__ */ r("span", { className: "flex flex-none items-center gap-1 self-center", children: d }) : null,
|
|
108
|
+
p ? /* @__PURE__ */ r("span", { className: "flex-none whitespace-nowrap", children: p }) : null,
|
|
109
|
+
s ? /* @__PURE__ */ r("span", { className: "min-w-0 flex-[1_1_0%] overflow-hidden text-ellipsis whitespace-nowrap", children: s }) : null
|
|
109
110
|
] }),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
111
|
+
E(m) ? /* @__PURE__ */ r("span", { className: "flex min-w-[84px] flex-none justify-end", children: m }) : null,
|
|
112
|
+
/* @__PURE__ */ r(
|
|
112
113
|
"span",
|
|
113
114
|
{
|
|
114
115
|
className: `flex-none ${e ? "" : "invisible"} group-data-[selected=true]:visible`,
|
|
@@ -116,36 +117,36 @@ const E = "w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[v
|
|
|
116
117
|
}
|
|
117
118
|
)
|
|
118
119
|
] })
|
|
119
|
-
),
|
|
120
|
+
), B = ({ children: a, className: e = "", style: t }) => {
|
|
120
121
|
const l = `block px-4 py-2 text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-secondary)] ${e}`.trim();
|
|
121
|
-
return w.isValidElement(a) ? c(a, l,
|
|
122
|
-
},
|
|
123
|
-
/* @__PURE__ */
|
|
122
|
+
return w.isValidElement(a) ? c(a, l, t) : /* @__PURE__ */ r("div", { className: l, style: t, children: a });
|
|
123
|
+
}, K = ({ items: a }) => /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-[14px] px-4 pt-[10px] pb-1 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]", children: a.map((e) => /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-[6px]", children: [
|
|
124
|
+
/* @__PURE__ */ r(z, { size: "small", children: e.key }),
|
|
124
125
|
e.label
|
|
125
|
-
] }, e.key)) }),
|
|
126
|
+
] }, e.key)) }), Y = ({ children: a, columns: e = 2, className: t = "" }) => /* @__PURE__ */ r(
|
|
126
127
|
"div",
|
|
127
128
|
{
|
|
128
|
-
className: `grid gap-1 px-2 ${e === 2 ? "grid-cols-2" : "grid-cols-1"} ${
|
|
129
|
+
className: `grid gap-1 px-2 ${e === 2 ? "grid-cols-2" : "grid-cols-1"} ${t}`.trim(),
|
|
129
130
|
children: a
|
|
130
131
|
}
|
|
131
|
-
),
|
|
132
|
+
), q = ({
|
|
132
133
|
children: a,
|
|
133
134
|
trailing: e
|
|
134
135
|
}) => /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-3 border-0 border-t border-solid border-[var(--malachite-card-border)] px-4 py-3 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]", children: [
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
e ? /* @__PURE__ */
|
|
137
|
-
] }), o =
|
|
138
|
-
o.FieldRow =
|
|
139
|
-
o.Field =
|
|
140
|
-
o.ScopeChip =
|
|
141
|
-
o.List =
|
|
142
|
-
o.Group =
|
|
143
|
-
o.Heading =
|
|
144
|
-
o.Row =
|
|
145
|
-
o.Grid =
|
|
146
|
-
o.Message =
|
|
147
|
-
o.Legend =
|
|
148
|
-
o.Footer =
|
|
136
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-[10px]", children: a }),
|
|
137
|
+
e ? /* @__PURE__ */ r("span", { className: "flex items-center gap-[10px]", children: e }) : null
|
|
138
|
+
] }), o = I;
|
|
139
|
+
o.FieldRow = A;
|
|
140
|
+
o.Field = j;
|
|
141
|
+
o.ScopeChip = P;
|
|
142
|
+
o.List = M;
|
|
143
|
+
o.Group = O;
|
|
144
|
+
o.Heading = V;
|
|
145
|
+
o.Row = W;
|
|
146
|
+
o.Grid = Y;
|
|
147
|
+
o.Message = B;
|
|
148
|
+
o.Legend = K;
|
|
149
|
+
o.Footer = q;
|
|
149
150
|
export {
|
|
150
151
|
o as CommandPalette,
|
|
151
152
|
o as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPalette.js","sources":["../../src/components/CommandPalette.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ShadowRootWrapper } from '../ShadowRootWrapper';\nimport Keycap from './Keycap';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport { paintOnChild } from './asChild';\nimport { useOverlayBehaviour } from './overlayBehaviour';\nimport { OVERLAY_ELEVATED_ATTR, overlayIdentity } from './portalOverlay';\n\nconst PANEL =\n 'w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[var(--malachite-radius-xxl,14px)] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] outline-none [box-shadow:0_16px_48px_0_rgba(0,0,0,0.18)]';\n\nexport interface CommandPaletteProps {\n children?: React.ReactNode;\n /** Scrim click, and Escape unless a consumer handler already called `preventDefault`. */\n onDismiss?: () => void;\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** Open while mounted. */\nconst CommandPaletteRoot: React.FC<CommandPaletteProps> = ({\n children,\n onDismiss,\n 'aria-label': ariaLabel,\n className = '',\n style,\n}) => {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const hostRef = useRef<HTMLDivElement | null>(null);\n const dismiss = useCallback(() => onDismiss?.(), [onDismiss]);\n const { ref, isTopmost, zIndex, elevated } = useOverlayBehaviour({\n open: true,\n onClose: dismiss,\n hostRef,\n initialFocus: 'content',\n });\n\n if (!isMounted) {\n return null;\n }\n\n return createPortal(\n <ShadowRootWrapper\n hostRef={hostRef}\n hostStyle={{ position: 'relative', zIndex }}\n hostProps={\n elevated\n ? { ...overlayIdentity('commandpalette'), [OVERLAY_ELEVATED_ATTR]: '' }\n : overlayIdentity('commandpalette')\n }\n >\n <div\n className=\"fixed inset-0 z-[1000] flex items-start justify-center pt-[10vh] bg-[var(--malachite-overlay-scrim,rgba(0,0,0,0.5))]\"\n onClick={\n onDismiss\n ? (event) => event.target === event.currentTarget && onDismiss()\n : undefined\n }\n role=\"presentation\"\n >\n <div\n ref={ref}\n role=\"dialog\"\n aria-modal={isTopmost ? 'true' : undefined}\n aria-label={ariaLabel}\n tabIndex={-1}\n className={`${PANEL} ${className}`.trim()}\n style={style}\n >\n {children}\n </div>\n </div>\n </ShadowRootWrapper>,\n document.body,\n );\n};\n\ninterface AsChildProps {\n children: React.ReactElement;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst FIELD =\n 'w-full border-none bg-transparent px-0 py-[18px] text-[length:var(--malachite-font-size-xlarge,18px)] text-[var(--malachite-text-primary)] outline-none placeholder:text-[var(--malachite-text-placeholder)]';\n\nconst Field: React.FC<AsChildProps> = ({ children, className = '', style }) =>\n paintOnChild(children, `${FIELD} ${className}`.trim(), style);\n\nexport interface FieldRowProps {\n children?: React.ReactNode;\n scope?: React.ReactNode;\n className?: string;\n}\n\nconst FieldRow: React.FC<FieldRowProps> = ({ children, scope, className = '' }) => (\n <div\n className={`flex items-center gap-2 border-0 border-b border-solid border-[var(--malachite-card-border)] px-[18px] ${className}`.trim()}\n >\n {scope}\n {children}\n </div>\n);\n\nconst ScopeChip: React.FC<{ children?: React.ReactNode }> = ({ children }) => (\n <span className=\"flex-none whitespace-nowrap rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-sunken-background)] px-2 py-[3px] text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-primary)]\">\n {children}\n </span>\n);\n\nexport interface ListProps extends AsChildProps {\n hasMoreBelow?: boolean;\n}\n\nconst LIST = 'max-h-[420px] overflow-auto py-1 bg-[var(--malachite-card-background)]';\n\nconst List: React.FC<ListProps> = ({ children, hasMoreBelow = false, className = '', style }) => (\n <div className=\"relative\">\n {paintOnChild(children, `${LIST} ${className}`.trim(), style)}\n {hasMoreBelow ? (\n <div\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-[28px] bg-[linear-gradient(to_bottom,transparent,var(--malachite-card-background))]\"\n />\n ) : null}\n </div>\n);\n\nexport interface GroupProps extends AsChildProps {\n divider?: boolean;\n}\n\nconst Group: React.FC<GroupProps> = ({ children, divider = false, className = '', style }) =>\n paintOnChild(\n children,\n `block pt-1 pb-2 ${\n divider ? 'border-0 border-b border-solid border-[var(--malachite-card-border)]' : ''\n } ${className}`.trim(),\n style,\n );\n\nconst Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"mb-1 flex items-center gap-2 px-4 text-[length:var(--malachite-font-size-xsmall,11px)] font-semibold uppercase tracking-[0.06em] text-[var(--malachite-text-secondary)]\">\n {children}\n {trailing}\n </div>\n);\n\nexport interface RowProps {\n /** Its children are replaced, so give the item an explicit `value`/`keywords`. */\n children: React.ReactElement;\n selected?: boolean;\n leading?: React.ReactNode;\n label?: React.ReactNode;\n /** The full label as text, shown in a tooltip only while the label is truncated. */\n labelTooltip?: string;\n /** Tags beside the label, kept visible while a long label truncates. */\n tags?: React.ReactNode;\n crumb?: React.ReactNode;\n /** Truncates before the label when the row runs out of room; inline text gets an ellipsis. */\n meta?: React.ReactNode;\n status?: React.ReactNode;\n hint?: React.ReactNode;\n className?: string;\n}\n\n// `data-selected` too: a headless library marks its active item without re-rendering the row.\nconst ROW =\n 'group mx-2 flex cursor-pointer items-center gap-2 rounded-[var(--malachite-radius-xl,12px)] px-3 py-[10px] text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-primary)] transition-colors hover:bg-[var(--malachite-card-sunken-background)] data-[selected=true]:bg-[var(--malachite-card-sunken-background)]';\n\nconst Row: React.FC<RowProps> = ({\n children,\n selected = false,\n leading,\n label,\n labelTooltip,\n tags,\n crumb,\n meta,\n status,\n hint,\n className = '',\n}) =>\n paintOnChild(\n children,\n `${ROW} ${selected ? 'bg-[var(--malachite-card-sunken-background)]' : ''} ${className}`.trim(),\n undefined,\n <>\n {leading}\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n {label && labelTooltip ? (\n <TruncatedTooltip text={labelTooltip} triggerAs=\"span\" describesTrigger={false}>\n {label}\n </TruncatedTooltip>\n ) : null}\n {label && !labelTooltip ? (\n <span className=\"min-w-0 flex-[0_1_auto] overflow-hidden text-ellipsis whitespace-nowrap\">\n {label}\n </span>\n ) : null}\n {tags ? (\n <span className=\"flex flex-none items-center gap-1 self-center\">{tags}</span>\n ) : null}\n {crumb ? <span className=\"flex-none whitespace-nowrap\">{crumb}</span> : null}\n {/* Sized from zero, it takes only the room the label leaves, so it truncates first. */}\n {meta ? (\n <span className=\"min-w-0 flex-[1_1_0%] overflow-hidden text-ellipsis whitespace-nowrap\">\n {meta}\n </span>\n ) : null}\n </span>\n <span className=\"flex min-w-[84px] flex-none justify-end\">{status}</span>\n <span\n className={`flex-none ${selected ? '' : 'invisible'} group-data-[selected=true]:visible`}\n >\n {hint}\n </span>\n </>,\n );\n\nexport interface MessageProps {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst Message: React.FC<MessageProps> = ({ children, className = '', style }) => {\n const classes =\n `block px-4 py-2 text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-secondary)] ${className}`.trim();\n return React.isValidElement(children) ? (\n paintOnChild(children, classes, style)\n ) : (\n <div className={classes} style={style}>\n {children}\n </div>\n );\n};\n\nexport interface LegendProps {\n items: { key: string; label: string }[];\n}\n\nconst Legend: React.FC<LegendProps> = ({ items }) => (\n <div className=\"flex flex-wrap gap-[14px] px-4 pt-[10px] pb-1 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n {items.map((item) => (\n <span key={item.key} className=\"inline-flex items-center gap-[6px]\">\n <Keycap size=\"small\">{item.key}</Keycap>\n {item.label}\n </span>\n ))}\n </div>\n);\n\nexport interface GridProps {\n children?: React.ReactNode;\n columns?: 1 | 2;\n className?: string;\n}\n\nconst Grid: React.FC<GridProps> = ({ children, columns = 2, className = '' }) => (\n <div\n className={`grid gap-1 px-2 ${columns === 2 ? 'grid-cols-2' : 'grid-cols-1'} ${className}`.trim()}\n >\n {children}\n </div>\n);\n\nconst Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"flex items-center justify-between gap-3 border-0 border-t border-solid border-[var(--malachite-card-border)] px-4 py-3 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n <span className=\"flex items-center gap-[10px]\">{children}</span>\n {trailing ? <span className=\"flex items-center gap-[10px]\">{trailing}</span> : null}\n </div>\n);\n\ninterface CommandPaletteComponent extends React.FC<CommandPaletteProps> {\n FieldRow: React.FC<FieldRowProps>;\n Field: React.FC<AsChildProps>;\n ScopeChip: React.FC<{ children?: React.ReactNode }>;\n List: React.FC<ListProps>;\n Group: React.FC<GroupProps>;\n Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n Row: React.FC<RowProps>;\n Grid: React.FC<GridProps>;\n Message: React.FC<MessageProps>;\n Legend: React.FC<LegendProps>;\n Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n}\n\nconst CommandPalette = CommandPaletteRoot as CommandPaletteComponent;\nCommandPalette.FieldRow = FieldRow;\nCommandPalette.Field = Field;\nCommandPalette.ScopeChip = ScopeChip;\nCommandPalette.List = List;\nCommandPalette.Group = Group;\nCommandPalette.Heading = Heading;\nCommandPalette.Row = Row;\nCommandPalette.Grid = Grid;\nCommandPalette.Message = Message;\nCommandPalette.Legend = Legend;\nCommandPalette.Footer = Footer;\n\nexport default CommandPalette;\nexport { CommandPalette };\n"],"names":["PANEL","CommandPaletteRoot","children","onDismiss","ariaLabel","className","style","isMounted","setIsMounted","useState","useEffect","hostRef","useRef","dismiss","useCallback","ref","isTopmost","zIndex","elevated","useOverlayBehaviour","createPortal","jsx","ShadowRootWrapper","overlayIdentity","OVERLAY_ELEVATED_ATTR","event","FIELD","Field","paintOnChild","FieldRow","scope","jsxs","ScopeChip","LIST","List","hasMoreBelow","Group","divider","Heading","trailing","ROW","Row","selected","leading","label","labelTooltip","tags","crumb","meta","status","hint","Fragment","TruncatedTooltip","Message","classes","React","Legend","items","item","Keycap","Grid","columns","Footer","CommandPalette"],"mappings":";;;;;;;;;AASA,MAAMA,IACF,kQAYEC,IAAoD,CA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UV;AACzBU,EAAe,SAASP;AACxBO,EAAe,SAASD;"}
|
|
1
|
+
{"version":3,"file":"CommandPalette.js","sources":["../../src/components/CommandPalette.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ShadowRootWrapper } from '../ShadowRootWrapper';\nimport Keycap from './Keycap';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport { paintOnChild } from './asChild';\nimport { useOverlayBehaviour } from './overlayBehaviour';\nimport { OVERLAY_ELEVATED_ATTR, overlayIdentity } from './portalOverlay';\nimport { isRenderableNode } from './renderableNode';\n\nconst PANEL =\n 'w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[var(--malachite-radius-xxl,14px)] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] outline-none [box-shadow:0_16px_48px_0_rgba(0,0,0,0.18)]';\n\nexport interface CommandPaletteProps {\n children?: React.ReactNode;\n /** Scrim click, and Escape unless a consumer handler already called `preventDefault`. */\n onDismiss?: () => void;\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** Open while mounted. */\nconst CommandPaletteRoot: React.FC<CommandPaletteProps> = ({\n children,\n onDismiss,\n 'aria-label': ariaLabel,\n className = '',\n style,\n}) => {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const hostRef = useRef<HTMLDivElement | null>(null);\n const dismiss = useCallback(() => onDismiss?.(), [onDismiss]);\n const { ref, isTopmost, zIndex, elevated } = useOverlayBehaviour({\n open: true,\n onClose: dismiss,\n hostRef,\n initialFocus: 'content',\n });\n\n if (!isMounted) {\n return null;\n }\n\n return createPortal(\n <ShadowRootWrapper\n hostRef={hostRef}\n hostStyle={{ position: 'relative', zIndex }}\n hostProps={\n elevated\n ? { ...overlayIdentity('commandpalette'), [OVERLAY_ELEVATED_ATTR]: '' }\n : overlayIdentity('commandpalette')\n }\n >\n <div\n className=\"fixed inset-0 z-[1000] flex items-start justify-center pt-[10vh] bg-[var(--malachite-overlay-scrim,rgba(0,0,0,0.5))]\"\n onClick={\n onDismiss\n ? (event) => event.target === event.currentTarget && onDismiss()\n : undefined\n }\n role=\"presentation\"\n >\n <div\n ref={ref}\n role=\"dialog\"\n aria-modal={isTopmost ? 'true' : undefined}\n aria-label={ariaLabel}\n tabIndex={-1}\n className={`${PANEL} ${className}`.trim()}\n style={style}\n >\n {children}\n </div>\n </div>\n </ShadowRootWrapper>,\n document.body,\n );\n};\n\ninterface AsChildProps {\n children: React.ReactElement;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst FIELD =\n 'w-full border-none bg-transparent px-0 py-[18px] text-[length:var(--malachite-font-size-xlarge,18px)] text-[var(--malachite-text-primary)] outline-none placeholder:text-[var(--malachite-text-placeholder)]';\n\nconst Field: React.FC<AsChildProps> = ({ children, className = '', style }) =>\n paintOnChild(children, `${FIELD} ${className}`.trim(), style);\n\nexport interface FieldRowProps {\n children?: React.ReactNode;\n scope?: React.ReactNode;\n className?: string;\n}\n\nconst FieldRow: React.FC<FieldRowProps> = ({ children, scope, className = '' }) => (\n <div\n className={`flex items-center gap-2 border-0 border-b border-solid border-[var(--malachite-card-border)] px-[18px] ${className}`.trim()}\n >\n {scope}\n {children}\n </div>\n);\n\nconst ScopeChip: React.FC<{ children?: React.ReactNode }> = ({ children }) => (\n <span className=\"flex-none whitespace-nowrap rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-sunken-background)] px-2 py-[3px] text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-primary)]\">\n {children}\n </span>\n);\n\nexport interface ListProps extends AsChildProps {\n hasMoreBelow?: boolean;\n}\n\nconst LIST = 'max-h-[420px] overflow-auto py-1 bg-[var(--malachite-card-background)]';\n\nconst List: React.FC<ListProps> = ({ children, hasMoreBelow = false, className = '', style }) => (\n <div className=\"relative\">\n {paintOnChild(children, `${LIST} ${className}`.trim(), style)}\n {hasMoreBelow ? (\n <div\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-[28px] bg-[linear-gradient(to_bottom,transparent,var(--malachite-card-background))]\"\n />\n ) : null}\n </div>\n);\n\nexport interface GroupProps extends AsChildProps {\n divider?: boolean;\n}\n\nconst Group: React.FC<GroupProps> = ({ children, divider = false, className = '', style }) =>\n paintOnChild(\n children,\n `block pt-1 pb-2 ${\n divider ? 'border-0 border-b border-solid border-[var(--malachite-card-border)]' : ''\n } ${className}`.trim(),\n style,\n );\n\nconst Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"mb-1 flex items-center gap-2 px-4 text-[length:var(--malachite-font-size-xsmall,11px)] font-semibold uppercase tracking-[0.06em] text-[var(--malachite-text-secondary)]\">\n {children}\n {trailing}\n </div>\n);\n\nexport interface RowProps {\n /** Its children are replaced, so give the item an explicit `value`/`keywords`. */\n children: React.ReactElement;\n selected?: boolean;\n leading?: React.ReactNode;\n label?: React.ReactNode;\n /** The full label as text, shown in a tooltip only while the label is truncated. */\n labelTooltip?: string;\n /** Tags beside the label, kept visible while a long label truncates. */\n tags?: React.ReactNode;\n crumb?: React.ReactNode;\n /** Truncates before the label when the row runs out of room; inline text gets an ellipsis. */\n meta?: React.ReactNode;\n /** Held at a minimum width so status words line up; a row without one gives that room to its label. */\n status?: React.ReactNode;\n hint?: React.ReactNode;\n className?: string;\n}\n\n// `data-selected` too: a headless library marks its active item without re-rendering the row.\nconst ROW =\n 'group mx-2 flex cursor-pointer items-center gap-2 rounded-[var(--malachite-radius-xl,12px)] px-3 py-[10px] text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-primary)] transition-colors hover:bg-[var(--malachite-card-sunken-background)] data-[selected=true]:bg-[var(--malachite-card-sunken-background)]';\n\nconst Row: React.FC<RowProps> = ({\n children,\n selected = false,\n leading,\n label,\n labelTooltip,\n tags,\n crumb,\n meta,\n status,\n hint,\n className = '',\n}) =>\n paintOnChild(\n children,\n `${ROW} ${selected ? 'bg-[var(--malachite-card-sunken-background)]' : ''} ${className}`.trim(),\n undefined,\n <>\n {leading}\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n {label && labelTooltip ? (\n <TruncatedTooltip text={labelTooltip} triggerAs=\"span\" describesTrigger={false}>\n {label}\n </TruncatedTooltip>\n ) : null}\n {label && !labelTooltip ? (\n <span className=\"min-w-0 flex-[0_1_auto] overflow-hidden text-ellipsis whitespace-nowrap\">\n {label}\n </span>\n ) : null}\n {tags ? (\n <span className=\"flex flex-none items-center gap-1 self-center\">{tags}</span>\n ) : null}\n {crumb ? <span className=\"flex-none whitespace-nowrap\">{crumb}</span> : null}\n {/* Sized from zero, it takes only the room the label leaves, so it truncates first. */}\n {meta ? (\n <span className=\"min-w-0 flex-[1_1_0%] overflow-hidden text-ellipsis whitespace-nowrap\">\n {meta}\n </span>\n ) : null}\n </span>\n {isRenderableNode(status) ? (\n <span className=\"flex min-w-[84px] flex-none justify-end\">{status}</span>\n ) : null}\n <span\n className={`flex-none ${selected ? '' : 'invisible'} group-data-[selected=true]:visible`}\n >\n {hint}\n </span>\n </>,\n );\n\nexport interface MessageProps {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst Message: React.FC<MessageProps> = ({ children, className = '', style }) => {\n const classes =\n `block px-4 py-2 text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-secondary)] ${className}`.trim();\n return React.isValidElement(children) ? (\n paintOnChild(children, classes, style)\n ) : (\n <div className={classes} style={style}>\n {children}\n </div>\n );\n};\n\nexport interface LegendProps {\n items: { key: string; label: string }[];\n}\n\nconst Legend: React.FC<LegendProps> = ({ items }) => (\n <div className=\"flex flex-wrap gap-[14px] px-4 pt-[10px] pb-1 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n {items.map((item) => (\n <span key={item.key} className=\"inline-flex items-center gap-[6px]\">\n <Keycap size=\"small\">{item.key}</Keycap>\n {item.label}\n </span>\n ))}\n </div>\n);\n\nexport interface GridProps {\n children?: React.ReactNode;\n columns?: 1 | 2;\n className?: string;\n}\n\nconst Grid: React.FC<GridProps> = ({ children, columns = 2, className = '' }) => (\n <div\n className={`grid gap-1 px-2 ${columns === 2 ? 'grid-cols-2' : 'grid-cols-1'} ${className}`.trim()}\n >\n {children}\n </div>\n);\n\nconst Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"flex items-center justify-between gap-3 border-0 border-t border-solid border-[var(--malachite-card-border)] px-4 py-3 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n <span className=\"flex items-center gap-[10px]\">{children}</span>\n {trailing ? <span className=\"flex items-center gap-[10px]\">{trailing}</span> : null}\n </div>\n);\n\ninterface CommandPaletteComponent extends React.FC<CommandPaletteProps> {\n FieldRow: React.FC<FieldRowProps>;\n Field: React.FC<AsChildProps>;\n ScopeChip: React.FC<{ children?: React.ReactNode }>;\n List: React.FC<ListProps>;\n Group: React.FC<GroupProps>;\n Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n Row: React.FC<RowProps>;\n Grid: React.FC<GridProps>;\n Message: React.FC<MessageProps>;\n Legend: React.FC<LegendProps>;\n Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n}\n\nconst CommandPalette = CommandPaletteRoot as CommandPaletteComponent;\nCommandPalette.FieldRow = FieldRow;\nCommandPalette.Field = Field;\nCommandPalette.ScopeChip = ScopeChip;\nCommandPalette.List = List;\nCommandPalette.Group = Group;\nCommandPalette.Heading = Heading;\nCommandPalette.Row = Row;\nCommandPalette.Grid = Grid;\nCommandPalette.Message = Message;\nCommandPalette.Legend = Legend;\nCommandPalette.Footer = Footer;\n\nexport default CommandPalette;\nexport { CommandPalette };\n"],"names":["PANEL","CommandPaletteRoot","children","onDismiss","ariaLabel","className","style","isMounted","setIsMounted","useState","useEffect","hostRef","useRef","dismiss","useCallback","ref","isTopmost","zIndex","elevated","useOverlayBehaviour","createPortal","jsx","ShadowRootWrapper","overlayIdentity","OVERLAY_ELEVATED_ATTR","event","FIELD","Field","paintOnChild","FieldRow","scope","jsxs","ScopeChip","LIST","List","hasMoreBelow","Group","divider","Heading","trailing","ROW","Row","selected","leading","label","labelTooltip","tags","crumb","meta","status","hint","Fragment","TruncatedTooltip","isRenderableNode","Message","classes","React","Legend","items","item","Keycap","Grid","columns","Footer","CommandPalette"],"mappings":";;;;;;;;;;AAUA,MAAMA,IACF,kQAYEC,IAAoD,CAAC;AAAA,EACvD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAcC;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAM;AACF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAChD,EAAAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE;AAEtC,QAAMG,IAAUC,EAA8B,IAAI,GAC5CC,IAAUC,EAAY,MAAMX,KAAA,gBAAAA,KAAe,CAACA,CAAS,CAAC,GACtD,EAAE,KAAAY,GAAK,WAAAC,GAAW,QAAAC,GAAQ,UAAAC,EAAA,IAAaC,EAAoB;AAAA,IAC7D,MAAM;AAAA,IACN,SAASN;AAAA,IACT,SAAAF;AAAA,IACA,cAAc;AAAA,EAAA,CACjB;AAED,SAAKJ,IAIEa;AAAA,IACH,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,SAAAX;AAAA,QACA,WAAW,EAAE,UAAU,YAAY,QAAAM,EAAA;AAAA,QACnC,WACIC,IACM,EAAE,GAAGK,EAAgB,gBAAgB,GAAG,CAACC,CAAqB,GAAG,GAAA,IACjED,EAAgB,gBAAgB;AAAA,QAG1C,UAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,SACIlB,IACM,CAACsB,MAAUA,EAAM,WAAWA,EAAM,iBAAiBtB,EAAA,IACnD;AAAA,Y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AV,EAAC,QAAA,EAAK,WAAU,gCAAgC,UAAAnB,EAAA,CAAS;AAAA,EACxDqC,IAAW,gBAAAlB,EAAC,QAAA,EAAK,WAAU,gCAAgC,aAAS,IAAU;AAAA,GACnF,GAiBE2C,IAAiB/D;AACvB+D,EAAe,WAAWnC;AAC1BmC,EAAe,QAAQrC;AACvBqC,EAAe,YAAYhC;AAC3BgC,EAAe,OAAO9B;AACtB8B,EAAe,QAAQ5B;AACvB4B,EAAe,UAAU1B;AACzB0B,EAAe,MAAMvB;AACrBuB,EAAe,OAAOH;AACtBG,EAAe,UAAUV;AACzBU,EAAe,SAASP;AACxBO,EAAe,SAASD;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1044,6 +1044,7 @@ export declare interface CommandPaletteRowProps {
|
|
|
1044
1044
|
crumb?: default_2.ReactNode;
|
|
1045
1045
|
/** Truncates before the label when the row runs out of room; inline text gets an ellipsis. */
|
|
1046
1046
|
meta?: default_2.ReactNode;
|
|
1047
|
+
/** Held at a minimum width so status words line up; a row without one gives that room to its label. */
|
|
1047
1048
|
status?: default_2.ReactNode;
|
|
1048
1049
|
hint?: default_2.ReactNode;
|
|
1049
1050
|
className?: string;
|
package/package.json
CHANGED