@camunda/design-system 0.80.0 → 0.81.1
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/dist/carbon-compat/overflow-menu.d.ts +2 -1
- package/dist/carbon-compat/overflow-menu.d.ts.map +1 -1
- package/dist/carbon-compat/overflow-menu.js.map +1 -1
- package/dist/src/components/ui/app-header.d.ts +8 -1
- package/dist/src/components/ui/app-header.d.ts.map +1 -1
- package/dist/src/components/ui/app-header.js +6 -2
- package/dist/src/components/ui/app-header.js.map +1 -1
- package/dist/src/components/ui/choice-card.d.ts.map +1 -1
- package/dist/src/components/ui/choice-card.js +8 -1
- package/dist/src/components/ui/choice-card.js.map +1 -1
- package/dist/src/components/ui/command-palette.assignability.d.ts +33 -0
- package/dist/src/components/ui/command-palette.assignability.d.ts.map +1 -0
- package/dist/src/components/ui/command-palette.assignability.js +33 -0
- package/dist/src/components/ui/command-palette.assignability.js.map +1 -0
- package/dist/src/components/ui/command-palette.d.ts +86 -0
- package/dist/src/components/ui/command-palette.d.ts.map +1 -0
- package/dist/src/components/ui/command-palette.js +220 -0
- package/dist/src/components/ui/command-palette.js.map +1 -0
- package/dist/src/components/ui/command.d.ts +23 -4
- package/dist/src/components/ui/command.d.ts.map +1 -1
- package/dist/src/components/ui/command.js +28 -6
- package/dist/src/components/ui/command.js.map +1 -1
- package/dist/src/components/ui/kbd.d.ts +5 -0
- package/dist/src/components/ui/kbd.d.ts.map +1 -0
- package/dist/src/components/ui/kbd.js +34 -0
- package/dist/src/components/ui/kbd.js.map +1 -0
- package/dist/src/components/ui/search-trigger.d.ts +19 -0
- package/dist/src/components/ui/search-trigger.d.ts.map +1 -0
- package/dist/src/components/ui/search-trigger.js +31 -0
- package/dist/src/components/ui/search-trigger.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/i18n/dictionary.d.ts +22 -0
- package/dist/src/lib/i18n/dictionary.d.ts.map +1 -1
- package/dist/src/lib/i18n/dictionary.js +19 -0
- package/dist/src/lib/i18n/dictionary.js.map +1 -1
- package/dist/src/lib/keyboard-shortcut.d.ts +38 -0
- package/dist/src/lib/keyboard-shortcut.d.ts.map +1 -0
- package/dist/src/lib/keyboard-shortcut.js +134 -0
- package/dist/src/lib/keyboard-shortcut.js.map +1 -0
- package/dist/src/specs/schema.d.ts +1 -1
- package/dist/src/specs/schema.d.ts.map +1 -1
- package/dist/styles.css +156 -24
- package/eslint-rules/no-hardcoded-i18n-prop.js +1 -1
- package/package.json +9 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { OverflowMenuProps as
|
|
2
|
+
import type { OverflowMenuProps as CarbonOverflowMenuPropsUnion } from "@carbon/react";
|
|
3
|
+
type CarbonOverflowMenuProps = CarbonOverflowMenuPropsUnion extends infer P ? P extends unknown ? "flipped" extends keyof P ? P : never : never : never;
|
|
3
4
|
type CarbonOverflowMenuItemProps = {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overflow-menu.d.ts","sourceRoot":"","sources":["../../carbon-compat/overflow-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,iBAAiB,IAAI,
|
|
1
|
+
{"version":3,"file":"overflow-menu.d.ts","sourceRoot":"","sources":["../../carbon-compat/overflow-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,iBAAiB,IAAI,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAIvF,KAAK,uBAAuB,GAAG,4BAA4B,SAAS,MAAM,CAAC,GACvE,CAAC,SAAS,OAAO,GACf,SAAS,SAAS,MAAM,CAAC,GACvB,CAAC,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nB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"overflow-menu.js","sourceRoot":"","sources":["../../carbon-compat/overflow-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAkCpD,oLAAoL;AACpL,SAAS,YAAY,CAAC,KAAwB;IAC5C,MAAM,EACJ,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,EACT,eAAe,EACf,EAAE,EACF,QAAQ,EACR,KAAK,EACL,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,UAAU,EAAE,UAAU,EACtB,oBAAoB,EACpB,IAAI,GACL,GAAG,KAAiE,CAAC;IAEtE,gBAAgB,CAAC,cAAc,EAAE;QAC/B,SAAS;QACT,OAAO;QACP,SAAS;QACT,SAAS;QACT,QAAQ;QACR,KAAK;QACL,UAAU;QACV,cAAc;QACd,gBAAgB;QAChB,oBAAoB;QACpB,IAAI;KACL,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,SAAS,IAAI,mBAAmB,IAAI,MAAM,CAAC;IACnE,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE;QACzC,IAAI,IAAI;YAAE,MAAM,EAAE,EAAE,CA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AAC,CACF,8BACG,QAAQ,EACR,QAAQ,IACR,CACJ,GACgB,CACpB,CAAC;IACF,IAAI,UAAU;QACZ,OAAO,CACL,8BACE,KAAC,qBAAqB,KAAG,EACxB,IAAI,IACJ,CACJ,CAAC;IACJ,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -16,6 +16,13 @@ export interface AppHeaderProps extends React.ComponentProps<"header"> {
|
|
|
16
16
|
logo?: React.ReactNode;
|
|
17
17
|
appName?: string;
|
|
18
18
|
breadcrumb?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The global-search trigger: a `SearchTrigger` that opens `CommandPalette`. Rendered after
|
|
21
|
+
* `trailing` and before `globalActions`, and never yields. From `lg` up the trigger is a
|
|
22
|
+
* field-shaped button, below `lg` an icon button. Unset, the header renders as it did before
|
|
23
|
+
* this slot existed.
|
|
24
|
+
*/
|
|
25
|
+
search?: React.ReactNode;
|
|
19
26
|
trailing?: React.ReactNode;
|
|
20
27
|
actions?: React.ReactNode;
|
|
21
28
|
globalActions?: GlobalActionButton[];
|
|
@@ -48,5 +55,5 @@ export interface AppHeaderProps extends React.ComponentProps<"header"> {
|
|
|
48
55
|
*/
|
|
49
56
|
sidebarCollapsedWidth?: string;
|
|
50
57
|
}
|
|
51
|
-
export declare function AppHeader({ logo, appName, breadcrumb, trailing, actions, globalActions, tools, activeToolKey, onActiveToolChange, skipToContentTargetId, skipToContentLabel, showSidebarTrigger, sidebarCollapsedWidth, className, children, ...props }: AppHeaderProps): React.JSX.Element;
|
|
58
|
+
export declare function AppHeader({ logo, appName, breadcrumb, search, trailing, actions, globalActions, tools, activeToolKey, onActiveToolChange, skipToContentTargetId, skipToContentLabel, showSidebarTrigger, sidebarCollapsedWidth, className, children, ...props }: AppHeaderProps): React.JSX.Element;
|
|
52
59
|
//# sourceMappingURL=app-header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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,MAAM,GAAG,IAAI,CAAC;IAC9B,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAClD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gJAAgJ;IAChJ,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2GAA2G;IAC3G,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,QAAQ,EACR,OAAO,EACP,aAAa,EAEb,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAyB,EACzB,qBAAgC,EAChC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,qBAyJhB"}
|
|
@@ -41,7 +41,7 @@ import { HeaderTools, useHeaderTools } from "./nav-tools.js";
|
|
|
41
41
|
* every segment carries.
|
|
42
42
|
*/
|
|
43
43
|
const BREADCRUMB_SLOT_FLOOR_PX = 144;
|
|
44
|
-
export function AppHeader({ logo, appName, breadcrumb, trailing, actions, globalActions,
|
|
44
|
+
export function AppHeader({ logo, appName, breadcrumb, search, trailing, actions, globalActions,
|
|
45
45
|
// Destructured before the spread below, or they land on the <header> as unknown attributes.
|
|
46
46
|
tools, activeToolKey, onActiveToolChange, skipToContentTargetId, skipToContentLabel, showSidebarTrigger = true, sidebarCollapsedWidth = "3.5rem", className, children, ...props }) {
|
|
47
47
|
const sidebar = useSidebar();
|
|
@@ -98,7 +98,11 @@ tools, activeToolKey, onActiveToolChange, skipToContentTargetId, skipToContentLa
|
|
|
98
98
|
// (DS `Badge`, the canonical content here, is `shrink-0` with
|
|
99
99
|
// `whitespace-nowrap`). The clip lands on this box's trailing edge, so under
|
|
100
100
|
// RTL it removes the START of the text rather than its end.
|
|
101
|
-
_jsx("div", { "data-slot": "app-header-trailing", className: "min-w-0 overflow-hidden", children: trailing })),
|
|
101
|
+
_jsx("div", { "data-slot": "app-header-trailing", className: "min-w-0 overflow-hidden", children: trailing })), search ? (
|
|
102
|
+
// `shrink-0`: like every action, a clipped search button is one the user cannot reach.
|
|
103
|
+
// An icon button's glyph sits 10px inside its box, so the field form takes 10px more on
|
|
104
|
+
// its left to sit as far from the badge as it does from the next icon.
|
|
105
|
+
_jsx("div", { "data-slot": "app-header-search", className: "shrink-0 has-[[data-slot=search-trigger][data-variant=field]]:ml-2.5 lg:has-[[data-slot=search-trigger][data-variant=auto]]:ml-2.5", children: search })) : null, globalActions
|
|
102
106
|
?.filter((action) => action.element || action.icon)
|
|
103
107
|
.map((action) => action.element ? (_jsx(React.Fragment, { children: action.element }, action.key)) : (_jsx(Button, { variant: "ghost", size: "icon", "aria-label": action.label, onClick: action.onClick, children: action.icon ? (_jsx(action.icon, { "aria-hidden": true, className: "size-4" })) : null }, action.key))), tools !== undefined && tools.length > 0 && (_jsx(HeaderTools, { tools: tools, ...headerTools })), actions] })] }));
|
|
104
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-header.js","sourceRoot":"","sources":["../../../../src/components/ui/app-header.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAgB,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAA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"file":"choice-card.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/choice-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAoB7D,KAAK,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAC9C,OAAO,mBAAmB,CAAC,IAAI,CAChC,GAAG;IACF,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACzB,CAAC;AAkBF,QAAA,MAAM,eAAe,0GAEpB,CAAC;AAEF,KAAK,eAAe,GAAG,IAAI,CACzB,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,EACrD,UAAU,CACX,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAC1D,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC;AAgFF,QAAA,MAAM,UAAU,wGAA8D,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -26,7 +26,14 @@ function ChoiceCardImpl({ ref, className, value, title, description, icon: Icon,
|
|
|
26
26
|
const id = React.useId();
|
|
27
27
|
const titleId = `${id}-title`;
|
|
28
28
|
const descId = `${id}-desc`;
|
|
29
|
-
return (_jsxs(RadioGroupPrimitive.Item, { ref: ref, "data-slot": "choice-card", value: value, "aria-labelledby": titleId, "aria-describedby": description ? descId : undefined, className: cn("group/choice-card relative flex flex-col items-start gap-1 rounded-
|
|
29
|
+
return (_jsxs(RadioGroupPrimitive.Item, { ref: ref, "data-slot": "choice-card", value: value, "aria-labelledby": titleId, "aria-describedby": description ? descId : undefined, className: cn("group/choice-card relative flex flex-col items-start gap-1 rounded-lg bg-neutral-background-subtle p-4 text-left ring-1 ring-border transition-[color,background-color,box-shadow] outline-none", "data-[state=unchecked]:hover:bg-neutral-background-medium", "data-[state=checked]:bg-neutral-background-medium data-[state=checked]:ring-primary-border-strong",
|
|
30
|
+
// `!` so the focus color wins over the selected and invalid ring
|
|
31
|
+
// colors, which come later in the CSS or are more specific.
|
|
32
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring!",
|
|
33
|
+
// Dim the content, not the whole card: card-level opacity washes out
|
|
34
|
+
// the surface. A selected-but-disabled card keeps the unselected
|
|
35
|
+
// surface and border; the dimmed radio alone marks the selection.
|
|
36
|
+
"disabled:pointer-events-none", "disabled:data-[state=checked]:bg-neutral-background-subtle disabled:data-[state=checked]:ring-border", "aria-invalid:ring-danger-foreground-subtle aria-invalid:data-[state=checked]:ring-danger-foreground-subtle", className), ...props, children: [_jsx("span", { "aria-hidden": true, "data-slot": "choice-card-indicator", className: "absolute top-4 right-4 flex size-4 items-center justify-center rounded-full border border-input bg-input-background group-disabled/choice-card:opacity-50 group-aria-invalid/choice-card:border-danger-foreground-subtle", children: _jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: _jsx(CircleIcon, { className: "size-2 fill-primary-action-default text-primary-action-default" }) }) }), _jsxs("div", { className: "flex w-full items-start gap-2 pr-6 group-disabled/choice-card:opacity-50", children: [Icon ? (_jsx(Icon, { "aria-hidden": true, className: "size-5 shrink-0 text-neutral-foreground-strong" })) : null, badge ? _jsx("span", { className: "ml-auto", children: badge }) : null] }), _jsx("span", { id: titleId, className: "pr-6 font-medium text-neutral-foreground-strong group-disabled/choice-card:opacity-50", children: title }), description ? (_jsx("span", { id: descId, className: cn(typographyVariants({ variant: "body-subtle" }), "group-disabled/choice-card:opacity-50"), children: description })) : null] }));
|
|
30
37
|
}
|
|
31
38
|
const ChoiceCard = withRef(ChoiceCardImpl);
|
|
32
39
|
export { ChoiceCardGroup, ChoiceCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-card.js","sourceRoot":"","sources":["../../../../src/components/ui/choice-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,uBAAuB,GAAG,GAAG,CAAC,YAAY,EAAE;IAChD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,CAAC,EAAE,aAAa;YAChB,CAAC,EAAE,4BAA4B;YAC/B,CAAC,EAAE,4BAA4B;YAC/B,CAAC,EAAE,2CAA2C;SAC/C;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;CAChC,CAAC,CAAC;AAQH,SAAS,mBAAmB,CAAC,EAC3B,GAAG,EACH,SAAS,EACT,OAAO,GAAG,CAAC,EACX,GAAG,KAAK,EACmD;IAC3D,OAAO,CACL,KAAC,mBAAmB,CAAC,IAAI,IACvB,GAAG,EAAE,GAAG,eACE,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAAG,OAAO,CAC7B,mBAAmB,CACpB,CAAC;AAaF,SAAS,cAAc,CAAC,EACtB,GAAG,EACH,SAAS,EACT,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAA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C,gDAAgD,GAC1D,CACH,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,GAAQ,CAAC,CAAC,CAAC,IAAI,IACpD,EACN,eACE,EAAE,EAAE,OAAO,EACX,SAAS,EAAC,uFAAuF,YAEhG,KAAK,GACD,EACN,WAAW,CAAC,CAAC,CAAC,CACb,eACE,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,EAAE,CACX,kBAAkB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,EAC9C,uCAAuC,CACxC,YAEA,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,IACiB,CAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,OAAO,CAAqC,cAAc,CAAC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time fixture for the `CommandPalette` drop-in contract. Nothing imports this file: it
|
|
3
|
+
* exists to be type-checked, and `npm run typecheck` is what runs it.
|
|
4
|
+
*
|
|
5
|
+
* The point it pins: Control's local `CommandDialog` and `Kbd` can be deleted in favour of these
|
|
6
|
+
* two, so each prop type Control declares must assign to ours. Control is not a dependency of this
|
|
7
|
+
* package, so its declarations are re-declared here from
|
|
8
|
+
* `packages/control-ui/src/components/ui/command-dialog.tsx`, the same approach
|
|
9
|
+
* `nav-tools.assignability.ts` takes for C3's tool shape. If a line below stops compiling, the
|
|
10
|
+
* swap would break at Control's call sites too.
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import type { Dialog } from "./dialog.js";
|
|
14
|
+
import { type CommandPaletteProps } from "./command-palette.js";
|
|
15
|
+
import { Kbd } from "./kbd.js";
|
|
16
|
+
/** Control's declaration, verbatim. `Dialog` is the design system's `Dialog` root. */
|
|
17
|
+
interface ControlCommandDialogProps extends React.ComponentProps<typeof Dialog> {
|
|
18
|
+
title?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
shouldFilter?: boolean;
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
contentClassName?: string;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const asDsProps: CommandPaletteProps;
|
|
26
|
+
type ControlCommandDialog = (props: ControlCommandDialogProps) => React.ReactNode;
|
|
27
|
+
export declare const dsAsControlDialog: ControlCommandDialog;
|
|
28
|
+
export declare const asDsKbdProps: React.ComponentProps<typeof Kbd>;
|
|
29
|
+
type ControlKbd = (props: React.ComponentProps<"kbd">) => React.ReactNode;
|
|
30
|
+
export declare const dsAsControlKbd: ControlKbd;
|
|
31
|
+
export declare const controlCallSite: React.FunctionComponentElement<CommandPaletteProps>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=command-palette.assignability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.assignability.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/command-palette.assignability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,sFAAsF;AACtF,UAAU,yBAA0B,SAAQ,KAAK,CAAC,cAAc,CAC9D,OAAO,MAAM,CACd;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAKD,eAAO,MAAM,SAAS,EAAE,mBAA6B,CAAC;AAItD,KAAK,oBAAoB,GAAG,CAC1B,KAAK,EAAE,yBAAyB,KAC7B,KAAK,CAAC,SAAS,CAAC;AACrB,eAAO,MAAM,iBAAiB,EAAE,oBAAqC,CAAC;AAItE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAmB,CAAC;AAE9E,KAAK,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;AAC1E,eAAO,MAAM,cAAc,EAAE,UAAgB,CAAC;AAK9C,eAAO,MAAM,eAAe,qDAS1B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time fixture for the `CommandPalette` drop-in contract. Nothing imports this file: it
|
|
3
|
+
* exists to be type-checked, and `npm run typecheck` is what runs it.
|
|
4
|
+
*
|
|
5
|
+
* The point it pins: Control's local `CommandDialog` and `Kbd` can be deleted in favour of these
|
|
6
|
+
* two, so each prop type Control declares must assign to ours. Control is not a dependency of this
|
|
7
|
+
* package, so its declarations are re-declared here from
|
|
8
|
+
* `packages/control-ui/src/components/ui/command-dialog.tsx`, the same approach
|
|
9
|
+
* `nav-tools.assignability.ts` takes for C3's tool shape. If a line below stops compiling, the
|
|
10
|
+
* swap would break at Control's call sites too.
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { CommandPalette } from "./command-palette.js";
|
|
14
|
+
import { Kbd } from "./kbd.js";
|
|
15
|
+
// 1. Control's props assign to ours: `CommandPaletteProps` is a supertype of them.
|
|
16
|
+
export const asDsProps = control;
|
|
17
|
+
export const dsAsControlDialog = CommandPalette;
|
|
18
|
+
export const asDsKbdProps = controlKbdProps;
|
|
19
|
+
export const dsAsControlKbd = Kbd;
|
|
20
|
+
// 4. Control's real call site. Its `contentClassName` is kept only so the swap compiles. The
|
|
21
|
+
// component's own `sm:top-*` wins from `sm` up, so a migration drops that string and takes the
|
|
22
|
+
// fixed size and position.
|
|
23
|
+
export const controlCallSite = React.createElement(CommandPalette, {
|
|
24
|
+
open: true,
|
|
25
|
+
onOpenChange: () => { },
|
|
26
|
+
title: "Command palette",
|
|
27
|
+
description: "Search for pages, clusters and actions.",
|
|
28
|
+
shouldFilter: false,
|
|
29
|
+
loop: true,
|
|
30
|
+
contentClassName: "top-[88px] translate-y-0 sm:max-w-[720px]",
|
|
31
|
+
children: React.createElement(Kbd, null, "↑"),
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=command-palette.assignability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.assignability.js","sourceRoot":"","sources":["../../../../src/components/ui/command-palette.assignability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,cAAc,EAA4B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAgB5B,mFAAmF;AACnF,MAAM,CAAC,MAAM,SAAS,GAAwB,OAAO,CAAC;AAOtD,MAAM,CAAC,MAAM,iBAAiB,GAAyB,cAAc,CAAC;AAItE,MAAM,CAAC,MAAM,YAAY,GAAqC,eAAe,CAAC;AAG9E,MAAM,CAAC,MAAM,cAAc,GAAe,GAAG,CAAC;AAE9C,6FAA6F;AAC7F,kGAAkG;AAClG,8BAA8B;AAC9B,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE;IACjE,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,yCAAyC;IACtD,YAAY,EAAE,KAAK;IACnB,IAAI,EAAE,IAAI;IACV,gBAAgB,EAAE,2CAA2C;IAC7D,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC;CAC9C,CAAC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Command, CommandItem } from "./command.js";
|
|
3
|
+
import { type NavIcon } from "./nav-icon.js";
|
|
4
|
+
type CommandPaletteProps = {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
modal?: boolean;
|
|
9
|
+
/** Accessible name of the dialog and the input. Visually hidden. */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** Visually hidden description. Pass your own when you add footer `hints`. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** cmdk's built-in filter. Pass `false` when the consumer filters. */
|
|
14
|
+
shouldFilter?: boolean;
|
|
15
|
+
/** Wrap the highlight from the last row to the first. */
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
/** Toggle the palette with ⌘K or Ctrl+K. Pass it on one palette per page. */
|
|
18
|
+
globalShortcut?: boolean;
|
|
19
|
+
/** Close the palette after a `CommandResultItem`'s `onSelect`. Default `true`. */
|
|
20
|
+
closeOnSelect?: boolean;
|
|
21
|
+
value?: string;
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
filter?: React.ComponentProps<typeof Command>["filter"];
|
|
24
|
+
/**
|
|
25
|
+
* Compatibility passthrough for a local palette being swapped for this one. Merged last, so it
|
|
26
|
+
* overrides the fixed size and position. Don't use it for new code.
|
|
27
|
+
*/
|
|
28
|
+
contentClassName?: string;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare function CommandPalette({ open: openProp, defaultOpen, onOpenChange, modal, title, description, shouldFilter, loop, globalShortcut, closeOnSelect, value, onValueChange, filter, contentClassName, children, }: CommandPaletteProps): React.JSX.Element;
|
|
32
|
+
type CommandResultItemProps = Omit<React.ComponentProps<typeof CommandItem>, "children" | "value" | "checked" | "asChild"> & {
|
|
33
|
+
/** The row's name and the text the match highlight applies to. */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Drawn in a tile before the label. */
|
|
36
|
+
icon?: NavIcon;
|
|
37
|
+
/** What kind of thing the row is, such as "BPMN". Starts the secondary line. */
|
|
38
|
+
type?: string;
|
|
39
|
+
/** Where the result sits, outermost first. Follows the type on the secondary line. */
|
|
40
|
+
location?: string[];
|
|
41
|
+
/** Secondary text. Follows the location, and is highlighted like the label. */
|
|
42
|
+
description?: string;
|
|
43
|
+
/** A `StatusIcon` or `Badge`. Needs its own text alternative. */
|
|
44
|
+
status?: React.ReactNode;
|
|
45
|
+
/** Trailing keys of a shortcut, one string per key, drawn as one cap: ["⌘", "N"] is "⌘N". */
|
|
46
|
+
shortcut?: string[];
|
|
47
|
+
/** What Enter does, shown with a ↵ cap on the highlighted row only. Default "Open". */
|
|
48
|
+
actionLabel?: string;
|
|
49
|
+
/** The text to highlight. Defaults to the palette's search text. */
|
|
50
|
+
query?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Pass an id when label, location and description can collide. The built-in filter still
|
|
53
|
+
* matches the label, location and description, which are added to `keywords`.
|
|
54
|
+
*/
|
|
55
|
+
value?: string;
|
|
56
|
+
};
|
|
57
|
+
declare function CommandResultItem({ label, icon: Icon, type, location, description, status, shortcut, actionLabel, query, value, keywords, className, onSelect, ...props }: CommandResultItemProps): React.JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* "Searching…" with a spinner. Render it after `CommandList`, never inside it. Its own markup is
|
|
60
|
+
* hidden from assistive tech: the dialog's live region carries the message.
|
|
61
|
+
*/
|
|
62
|
+
declare function CommandLoading({ label, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
63
|
+
label?: string;
|
|
64
|
+
}): React.JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* A failed load with an optional retry button. Render it after `CommandList`, never inside it.
|
|
67
|
+
*/
|
|
68
|
+
declare function CommandError({ message, onRetry, retryLabel, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
69
|
+
message?: string;
|
|
70
|
+
onRetry?: () => void;
|
|
71
|
+
retryLabel?: string;
|
|
72
|
+
}): React.JSX.Element;
|
|
73
|
+
type CommandPaletteHint = {
|
|
74
|
+
keys: string[];
|
|
75
|
+
label: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The key-hint bar: navigate, open, close, plus any extra `hints`, each key or chord drawn as one
|
|
79
|
+
* cap. While a `useCommandShortcut` binding is active, the right edge shows that shortcut.
|
|
80
|
+
* Display only, and hidden from assistive tech because the dialog's description says the same.
|
|
81
|
+
*/
|
|
82
|
+
declare function CommandPaletteFooter({ hints, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
83
|
+
hints?: CommandPaletteHint[];
|
|
84
|
+
}): React.JSX.Element;
|
|
85
|
+
export { CommandPalette, CommandPaletteFooter, CommandError, CommandLoading, CommandResultItem, type CommandPaletteHint, type CommandPaletteProps, type CommandResultItemProps, };
|
|
86
|
+
//# sourceMappingURL=command-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,EACL,OAAO,EAEP,WAAW,EAGZ,MAAM,WAAW,CAAC;AAQnB,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AA+F1C,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E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AAU,CAAC,GAAG;IACjD,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B,qBA2CA;AAED,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useCommandState } from "cmdk";
|
|
5
|
+
import { ChevronRight } from "../../icons/lucide.js";
|
|
6
|
+
import { useC4Dictionary } from "../../lib/i18n/context.js";
|
|
7
|
+
import { formatChord, useCommandShortcut, useCommandShortcutActive, useEscapeKeyLabel, useModifierKeyLabel, } from "../../lib/keyboard-shortcut.js";
|
|
8
|
+
import { cn } from "../../lib/utils.js";
|
|
9
|
+
import { Alert, AlertDescription } from "./alert.js";
|
|
10
|
+
import { Button } from "./button.js";
|
|
11
|
+
import { Command, CommandPaletteContext, CommandItem, useCommandPaletteContext, } from "./command.js";
|
|
12
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle, } from "./dialog.js";
|
|
13
|
+
import { Kbd } from "./kbd.js";
|
|
14
|
+
import {} from "./nav-icon.js";
|
|
15
|
+
import { SpinnerIcon } from "./spinner.js";
|
|
16
|
+
// How long the query has to stay unchanged before the result count is announced.
|
|
17
|
+
const ANNOUNCE_DELAY_MS = 500;
|
|
18
|
+
// Size comes from the dialog's `md` tier. Position is pinned near the top so the input does not
|
|
19
|
+
// move as the list changes height. `contentClassName` is merged after these.
|
|
20
|
+
const CONTENT_CLASSES = cn("top-4 translate-y-0 gap-0 overflow-hidden p-0 sm:top-[12dvh]", "[&_[data-slot=command-list]]:max-h-[min(32rem,calc(100dvh-12rem))]",
|
|
21
|
+
// The close button is for touch users, who have no Escape key.
|
|
22
|
+
"sm:[&>[data-slot=dialog-close]]:hidden max-sm:[&>[data-slot=dialog-close]]:top-0.5 max-sm:[&>[data-slot=dialog-close]]:right-1 max-sm:[&_[data-slot=command-input-wrapper]]:pr-10", "data-open:animate-none data-closed:animate-none motion-safe:data-open:animate-in motion-safe:data-closed:animate-out");
|
|
23
|
+
function useOpenState({ open: openProp, defaultOpen = false, onOpenChange, }) {
|
|
24
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
25
|
+
const isControlled = openProp !== undefined;
|
|
26
|
+
const open = isControlled ? openProp : uncontrolledOpen;
|
|
27
|
+
const setOpen = React.useCallback((next) => {
|
|
28
|
+
if (!isControlled)
|
|
29
|
+
setUncontrolledOpen(next);
|
|
30
|
+
onOpenChange?.(next);
|
|
31
|
+
}, [isControlled, onOpenChange]);
|
|
32
|
+
return [open, setOpen];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The palette's one persistent status region. It lives inside the dialog content, because a modal
|
|
36
|
+
* dialog hides everything outside it from assistive tech. Text is written only after the region
|
|
37
|
+
* has mounted, so a palette that opens already loading still announces.
|
|
38
|
+
*/
|
|
39
|
+
function PaletteLiveRegion({ loadingLabel, hasError, }) {
|
|
40
|
+
const { t } = useC4Dictionary();
|
|
41
|
+
const search = useCommandState((state) => state.search);
|
|
42
|
+
const count = useCommandState((state) => state.filtered.count);
|
|
43
|
+
const [message, setMessage] = React.useState("");
|
|
44
|
+
const initialSearch = React.useRef(search);
|
|
45
|
+
const queryChanged = React.useRef(false);
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
let text = "";
|
|
48
|
+
let delay = 0;
|
|
49
|
+
let isCount = false;
|
|
50
|
+
if (search !== initialSearch.current)
|
|
51
|
+
queryChanged.current = true;
|
|
52
|
+
if (loadingLabel !== null) {
|
|
53
|
+
text = loadingLabel;
|
|
54
|
+
}
|
|
55
|
+
else if (!hasError && queryChanged.current) {
|
|
56
|
+
// While `CommandError` shows, its alert speaks for the palette: a count here would announce
|
|
57
|
+
// a failed search as "No results".
|
|
58
|
+
text = t("commandPalette.resultCount", { count });
|
|
59
|
+
delay = ANNOUNCE_DELAY_MS;
|
|
60
|
+
isCount = true;
|
|
61
|
+
}
|
|
62
|
+
// Screen readers announce a change to the text, so the same count for a new query would be
|
|
63
|
+
// silent; a trailing no-break space alternates to make the text differ. Counts only: an
|
|
64
|
+
// unchanged loading label stays put, or it would repeat on every keystroke.
|
|
65
|
+
const timer = setTimeout(() => setMessage((previous) => isCount && previous === text ? `${text}\u00a0` : text), delay);
|
|
66
|
+
return () => clearTimeout(timer);
|
|
67
|
+
}, [loadingLabel, hasError, search, count, t]);
|
|
68
|
+
return (_jsx("div", { role: "status", "data-slot": "command-palette-live-region", className: "sr-only", children: message }));
|
|
69
|
+
}
|
|
70
|
+
function CommandPalette({ open: openProp, defaultOpen, onOpenChange, modal, title, description, shouldFilter, loop, globalShortcut = false, closeOnSelect = true, value, onValueChange, filter, contentClassName, children, }) {
|
|
71
|
+
const { t } = useC4Dictionary();
|
|
72
|
+
const [open, setOpen] = useOpenState({
|
|
73
|
+
open: openProp,
|
|
74
|
+
defaultOpen,
|
|
75
|
+
onOpenChange,
|
|
76
|
+
});
|
|
77
|
+
useCommandShortcut(() => setOpen(!open), {
|
|
78
|
+
enabled: globalShortcut,
|
|
79
|
+
open,
|
|
80
|
+
});
|
|
81
|
+
const [loadings, setLoadings] = React.useState([]);
|
|
82
|
+
const [errorCount, setErrorCount] = React.useState(0);
|
|
83
|
+
const registerLoading = React.useCallback((label) => {
|
|
84
|
+
const entry = { label };
|
|
85
|
+
setLoadings((current) => [...current, entry]);
|
|
86
|
+
return () => setLoadings((current) => current.filter((e) => e !== entry));
|
|
87
|
+
}, []);
|
|
88
|
+
const registerError = React.useCallback(() => {
|
|
89
|
+
setErrorCount((current) => current + 1);
|
|
90
|
+
return () => setErrorCount((current) => current - 1);
|
|
91
|
+
}, []);
|
|
92
|
+
const close = React.useCallback(() => setOpen(false), [setOpen]);
|
|
93
|
+
const listLabel = t("commandPalette.results");
|
|
94
|
+
const hasStatus = loadings.length > 0 || errorCount > 0;
|
|
95
|
+
const contextValue = React.useMemo(() => ({
|
|
96
|
+
listLabel,
|
|
97
|
+
hasStatus,
|
|
98
|
+
registerLoading,
|
|
99
|
+
registerError,
|
|
100
|
+
closeOnSelect,
|
|
101
|
+
close,
|
|
102
|
+
}), [
|
|
103
|
+
listLabel,
|
|
104
|
+
hasStatus,
|
|
105
|
+
registerLoading,
|
|
106
|
+
registerError,
|
|
107
|
+
closeOnSelect,
|
|
108
|
+
close,
|
|
109
|
+
]);
|
|
110
|
+
const resolvedTitle = title ?? t("commandPalette.title");
|
|
111
|
+
return (_jsx(Dialog, { open: open, onOpenChange: setOpen, modal: modal, children: _jsxs(DialogContent, { size: "md", className: cn(CONTENT_CLASSES, contentClassName), children: [_jsx(DialogTitle, { className: "sr-only", children: resolvedTitle }), _jsx(DialogDescription, { className: "sr-only", children: description ?? t("commandPalette.description") }), _jsx(CommandPaletteContext.Provider, { value: contextValue, children: _jsxs(Command, { className: "rounded-xl", label: resolvedTitle, shouldFilter: shouldFilter, loop: loop, vimBindings: false, value: value, onValueChange: onValueChange, filter: filter, children: [children, _jsx(PaletteLiveRegion, { loadingLabel: loadings.at(-1)?.label ?? null, hasError: errorCount > 0 })] }) })] }) }));
|
|
112
|
+
}
|
|
113
|
+
function escapeRegExp(text) {
|
|
114
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
115
|
+
}
|
|
116
|
+
function splitByQuery(text, query) {
|
|
117
|
+
const terms = query
|
|
118
|
+
.trim()
|
|
119
|
+
.split(/\s+/)
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.sort((a, b) => b.length - a.length);
|
|
122
|
+
if (terms.length === 0)
|
|
123
|
+
return [{ text, match: false }];
|
|
124
|
+
const pattern = new RegExp(terms.map(escapeRegExp).join("|"), "gi");
|
|
125
|
+
const parts = [];
|
|
126
|
+
let last = 0;
|
|
127
|
+
for (const found of text.matchAll(pattern)) {
|
|
128
|
+
const start = found.index ?? 0;
|
|
129
|
+
if (found[0] === "")
|
|
130
|
+
continue;
|
|
131
|
+
if (start > last)
|
|
132
|
+
parts.push({ text: text.slice(last, start), match: false });
|
|
133
|
+
parts.push({ text: found[0], match: true });
|
|
134
|
+
last = start + found[0].length;
|
|
135
|
+
}
|
|
136
|
+
if (last < text.length)
|
|
137
|
+
parts.push({ text: text.slice(last), match: false });
|
|
138
|
+
return parts;
|
|
139
|
+
}
|
|
140
|
+
// A plain span with a heavier weight: `<mark>` and `<strong>` would change what a screen reader
|
|
141
|
+
// announces for the option.
|
|
142
|
+
function Highlighted({ text, query }) {
|
|
143
|
+
return (_jsx(_Fragment, { children: splitByQuery(text, query).map((part, index) => part.match ? (_jsx("span", { className: "font-semibold", children: part.text }, index)) : (_jsx(React.Fragment, { children: part.text }, index))) }));
|
|
144
|
+
}
|
|
145
|
+
function CommandResultItem({ label, icon: Icon, type, location, description, status, shortcut, actionLabel, query, value, keywords, className, onSelect, ...props }) {
|
|
146
|
+
const { t } = useC4Dictionary();
|
|
147
|
+
const dialog = useCommandPaletteContext();
|
|
148
|
+
const search = useCommandState((state) => state.search);
|
|
149
|
+
const highlightQuery = query ?? search;
|
|
150
|
+
const separator = t("commandPalette.locationSeparator");
|
|
151
|
+
const searchText = [label, ...(location ?? []), description].filter((part) => Boolean(part));
|
|
152
|
+
const resolvedValue = value ?? searchText.join(" ");
|
|
153
|
+
// cmdk filters on `value` and `keywords` only, so an id `value` needs the visible text here.
|
|
154
|
+
const resolvedKeywords = value === undefined ? keywords : [...(keywords ?? []), ...searchText];
|
|
155
|
+
const secondary = [];
|
|
156
|
+
if (type)
|
|
157
|
+
secondary.push(type);
|
|
158
|
+
if (location !== undefined && location.length > 0) {
|
|
159
|
+
secondary.push(location.map((segment, index) => (_jsxs(React.Fragment, { children: [index > 0 && (_jsxs(_Fragment, { children: [_jsx(ChevronRight, { "aria-hidden": "true", className: "mx-0.5 inline size-3 align-[-0.125rem]" }), _jsx("span", { className: "sr-only", children: separator })] })), segment] }, index))));
|
|
160
|
+
}
|
|
161
|
+
if (description) {
|
|
162
|
+
secondary.push(_jsx(Highlighted, { text: description, query: highlightQuery }));
|
|
163
|
+
}
|
|
164
|
+
return (_jsxs(CommandItem, { value: resolvedValue, keywords: resolvedKeywords, className: cn("group/result gap-3 px-2 py-2", className), onSelect: (selected) => {
|
|
165
|
+
onSelect?.(selected);
|
|
166
|
+
if (dialog?.closeOnSelect)
|
|
167
|
+
dialog.close();
|
|
168
|
+
}, ...props, children: [Icon && (_jsx("span", { "data-slot": "command-result-icon", "aria-hidden": "true", className: "flex size-8 shrink-0 items-center justify-center rounded-md bg-accent-background-strong", children: _jsx(Icon, { "aria-hidden": "true", className: "size-4 text-accent-foreground-strong" }) })), _jsxs("span", { "data-slot": "command-result-body", className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 break-words", children: _jsx(Highlighted, { text: label, query: highlightQuery }) }), status] }), secondary.length > 0 && (_jsx("span", { "data-slot": "command-result-secondary", className: "min-w-0 text-xs break-words text-neutral-foreground-subtle", children: secondary.map((part, index) => (_jsxs(React.Fragment, { children: [index > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: " \u00B7 " }), _jsx("span", { className: "sr-only", children: separator })] })), part] }, index))) }))] }), shortcut && shortcut.length > 0 && (_jsx(Kbd, { className: "shrink-0", children: formatChord(shortcut) })), _jsxs("span", { "data-slot": "command-result-action", "aria-hidden": "true", className: "hidden shrink-0 items-center gap-1.5 text-xs text-neutral-foreground-subtle group-data-[selected=true]/result:flex", children: [actionLabel ?? t("commandPalette.actionOpen"), _jsx(Kbd, { children: "\u21B5" })] })] }));
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* "Searching…" with a spinner. Render it after `CommandList`, never inside it. Its own markup is
|
|
172
|
+
* hidden from assistive tech: the dialog's live region carries the message.
|
|
173
|
+
*/
|
|
174
|
+
function CommandLoading({ label, className, ...props }) {
|
|
175
|
+
const { t } = useC4Dictionary();
|
|
176
|
+
const registerLoading = useCommandPaletteContext()?.registerLoading;
|
|
177
|
+
const text = label ?? t("commandPalette.searching");
|
|
178
|
+
React.useLayoutEffect(() => registerLoading?.(text), [registerLoading, text]);
|
|
179
|
+
return (_jsxs("div", { "data-slot": "command-loading", "aria-hidden": "true", className: cn("flex items-center justify-center gap-2 py-4 text-sm text-neutral-foreground-subtle", className), ...props, children: [_jsx(SpinnerIcon, {}), text] }));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* A failed load with an optional retry button. Render it after `CommandList`, never inside it.
|
|
183
|
+
*/
|
|
184
|
+
function CommandError({ message, onRetry, retryLabel, className, ...props }) {
|
|
185
|
+
const { t } = useC4Dictionary();
|
|
186
|
+
const registerError = useCommandPaletteContext()?.registerError;
|
|
187
|
+
React.useLayoutEffect(() => registerError?.(), [registerError]);
|
|
188
|
+
return (_jsx("div", { "data-slot": "command-error", className: cn("p-2", className), ...props, children: _jsx(Alert, { variant: "destructive", children: _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-3", children: [_jsx(AlertDescription, { children: message ?? t("commandPalette.error") }), onRetry && (
|
|
189
|
+
// `-my-0.5` keeps the row one text line tall, so the alert icon stays level with it.
|
|
190
|
+
_jsx(Button, { variant: "secondary", size: "xs", className: "-my-0.5", onClick: onRetry,
|
|
191
|
+
// cmdk's root handles Enter by selecting the highlighted row and cancelling the
|
|
192
|
+
// keypress, which would swallow the button's own activation.
|
|
193
|
+
onKeyDown: (event) => {
|
|
194
|
+
if (event.key === "Enter")
|
|
195
|
+
event.stopPropagation();
|
|
196
|
+
}, children: retryLabel ?? t("commandPalette.retry") }))] }) }) }));
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The key-hint bar: navigate, open, close, plus any extra `hints`, each key or chord drawn as one
|
|
200
|
+
* cap. While a `useCommandShortcut` binding is active, the right edge shows that shortcut.
|
|
201
|
+
* Display only, and hidden from assistive tech because the dialog's description says the same.
|
|
202
|
+
*/
|
|
203
|
+
function CommandPaletteFooter({ hints, className, ...props }) {
|
|
204
|
+
const { t } = useC4Dictionary();
|
|
205
|
+
const escapeLabel = useEscapeKeyLabel();
|
|
206
|
+
const modifier = useModifierKeyLabel();
|
|
207
|
+
const shortcutBound = useCommandShortcutActive();
|
|
208
|
+
const allHints = [
|
|
209
|
+
{ caps: ["↑", "↓"], label: t("commandPalette.hintNavigate") },
|
|
210
|
+
{ caps: ["↵"], label: t("commandPalette.hintOpen") },
|
|
211
|
+
{ caps: [escapeLabel], label: t("commandPalette.hintClose") },
|
|
212
|
+
...(hints ?? []).map((hint) => ({
|
|
213
|
+
caps: [formatChord(hint.keys)],
|
|
214
|
+
label: hint.label,
|
|
215
|
+
})),
|
|
216
|
+
];
|
|
217
|
+
return (_jsxs("div", { "data-slot": "command-palette-footer", "aria-hidden": "true", className: cn("flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-border px-3 py-2 text-xs text-neutral-foreground-subtle", className), ...props, children: [allHints.map((hint, index) => (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "flex items-center gap-1", children: hint.caps.map((cap) => (_jsx(Kbd, { children: cap }, cap))) }), hint.label] }, index))), shortcutBound && (_jsxs("span", { className: "ml-auto flex items-center gap-1.5", children: [t("commandPalette.hintShortcut"), _jsx(Kbd, { children: formatChord([modifier, "K"]) })] }))] }));
|
|
218
|
+
}
|
|
219
|
+
export { CommandPalette, CommandPaletteFooter, CommandError, CommandLoading, CommandResultItem, };
|
|
220
|
+
//# sourceMappingURL=command-palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../../../src/components/ui/command-palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OA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