@ai-matrx/design-system 0.86.349 → 0.86.351
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 +22 -2
- package/dist/carousel.cjs.map +1 -1
- package/dist/carousel.js +5 -5
- package/dist/chunk-4WSXAP24.js +51 -0
- package/dist/chunk-4WSXAP24.js.map +1 -0
- package/dist/{chunk-XTP6HOB6.js → chunk-6XNYYROM.js} +1 -1
- package/dist/chunk-6XNYYROM.js.map +1 -0
- package/dist/{chunk-CEA6X445.js → chunk-CFUXEGW2.js} +2 -2
- package/dist/{chunk-54UK6P7E.js → chunk-FLWSEDUW.js} +3 -3
- package/dist/{chunk-BC7LMEOD.js → chunk-GJ6UGQ4X.js} +7 -3
- package/dist/chunk-GJ6UGQ4X.js.map +1 -0
- package/dist/{chunk-6CDAHINE.js → chunk-GMNROZQJ.js} +4 -4
- package/dist/{chunk-6CDAHINE.js.map → chunk-GMNROZQJ.js.map} +1 -1
- package/dist/{chunk-6QKT52FR.js → chunk-MTE6N7XU.js} +2 -2
- package/dist/{chunk-S6F34AX5.js → chunk-QA7EHFRX.js} +2 -2
- package/dist/{chunk-CJBSBKG5.js → chunk-SOCNWQMX.js} +2 -2
- package/dist/{chunk-GLLPO66A.js → chunk-U46XUQI7.js} +2 -2
- package/dist/{chunk-KYH42WEX.js → chunk-UGQRAQTE.js} +433 -344
- package/dist/chunk-UGQRAQTE.js.map +1 -0
- package/dist/{chunk-TWRC7NP4.js → chunk-WUD23YTG.js} +4 -4
- package/dist/{chunk-MIJMP4WI.js → chunk-YRF22M5S.js} +6 -1
- package/dist/{chunk-MIJMP4WI.js.map → chunk-YRF22M5S.js.map} +1 -1
- package/dist/clipboard-fallback-dialog.cjs.map +1 -1
- package/dist/clipboard-fallback-dialog.js +1 -1
- package/dist/controls.cjs +547 -458
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.css +52 -18
- package/dist/controls.d.cts +51 -3
- package/dist/controls.d.ts +51 -3
- package/dist/controls.js +13 -5
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +4 -4
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +5 -5
- package/dist/data-table/index.cjs +53 -43
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +52 -45
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +2 -2
- package/dist/data-table/spreadsheet.cjs +6 -2
- package/dist/data-table/spreadsheet.cjs.map +1 -1
- package/dist/data-table/spreadsheet.d.cts +4 -1
- package/dist/data-table/spreadsheet.d.ts +4 -1
- package/dist/data-table/spreadsheet.js +3 -1
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +2 -2
- package/dist/desktop.cjs +158 -16
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.css +46 -0
- package/dist/desktop.d.cts +6 -5
- package/dist/desktop.d.ts +6 -5
- package/dist/desktop.js +127 -17
- package/dist/desktop.js.map +1 -1
- package/dist/index.cjs +19 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +21 -14
- package/dist/index.js.map +1 -1
- package/dist/item.cjs.map +1 -1
- package/dist/item.js +2 -2
- package/dist/lite-table.cjs.map +1 -1
- package/dist/lite-table.js +1 -1
- package/dist/notice-stack.cjs +70 -0
- package/dist/notice-stack.cjs.map +1 -0
- package/dist/notice-stack.d.cts +60 -0
- package/dist/notice-stack.d.ts +60 -0
- package/dist/notice-stack.js +16 -0
- package/dist/notice-stack.js.map +1 -0
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.js +2 -2
- package/dist/settings.cjs +2 -2
- package/dist/settings.cjs.map +1 -1
- package/dist/settings.js +3 -3
- package/dist/swipe-deck.cjs +95 -25
- package/dist/swipe-deck.cjs.map +1 -1
- package/dist/swipe-deck.css +14 -0
- package/dist/swipe-deck.d.cts +20 -0
- package/dist/swipe-deck.d.ts +20 -0
- package/dist/swipe-deck.js +87 -25
- package/dist/swipe-deck.js.map +1 -1
- package/dist/writing-field.cjs +2 -2
- package/dist/writing-field.cjs.map +1 -1
- package/dist/writing-field.js +2 -2
- package/package.json +12 -18
- package/dist/chunk-BC7LMEOD.js.map +0 -1
- package/dist/chunk-KYH42WEX.js.map +0 -1
- package/dist/chunk-XTP6HOB6.js.map +0 -1
- /package/dist/{chunk-CEA6X445.js.map → chunk-CFUXEGW2.js.map} +0 -0
- /package/dist/{chunk-54UK6P7E.js.map → chunk-FLWSEDUW.js.map} +0 -0
- /package/dist/{chunk-6QKT52FR.js.map → chunk-MTE6N7XU.js.map} +0 -0
- /package/dist/{chunk-S6F34AX5.js.map → chunk-QA7EHFRX.js.map} +0 -0
- /package/dist/{chunk-CJBSBKG5.js.map → chunk-SOCNWQMX.js.map} +0 -0
- /package/dist/{chunk-GLLPO66A.js.map → chunk-U46XUQI7.js.map} +0 -0
- /package/dist/{chunk-TWRC7NP4.js.map → chunk-WUD23YTG.js.map} +0 -0
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
} from "./chunk-FRJ4PPA2.js";
|
|
11
11
|
import {
|
|
12
12
|
PropertyRow
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MTE6N7XU.js";
|
|
14
14
|
import {
|
|
15
15
|
completeLayeredFilterRules,
|
|
16
16
|
layeredFilterMatchesValue
|
|
17
17
|
} from "./chunk-7ZCD4AZS.js";
|
|
18
18
|
import {
|
|
19
19
|
RecordId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-U46XUQI7.js";
|
|
21
21
|
import {
|
|
22
22
|
Button
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6XNYYROM.js";
|
|
24
24
|
import {
|
|
25
25
|
useMatrxDataTableHost
|
|
26
26
|
} from "./chunk-POJ3RR3K.js";
|
|
@@ -671,4 +671,4 @@ export {
|
|
|
671
671
|
isUuidValue,
|
|
672
672
|
DataRowInspector
|
|
673
673
|
};
|
|
674
|
-
//# sourceMappingURL=chunk-
|
|
674
|
+
//# sourceMappingURL=chunk-WUD23YTG.js.map
|
|
@@ -127,6 +127,10 @@ var CommandInput = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
127
127
|
] });
|
|
128
128
|
});
|
|
129
129
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
130
|
+
function CommandRowClose({ className }) {
|
|
131
|
+
const owns = useSearchRowCloseSlotClaim();
|
|
132
|
+
return owns ? /* @__PURE__ */ jsx(CloseControl, { className: cn("-mr-1", className) }) : null;
|
|
133
|
+
}
|
|
130
134
|
var CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
131
135
|
CommandPrimitive.List,
|
|
132
136
|
{
|
|
@@ -199,6 +203,7 @@ export {
|
|
|
199
203
|
Command,
|
|
200
204
|
CommandDialog,
|
|
201
205
|
CommandInput,
|
|
206
|
+
CommandRowClose,
|
|
202
207
|
CommandList,
|
|
203
208
|
CommandEmpty,
|
|
204
209
|
CommandGroup,
|
|
@@ -206,4 +211,4 @@ export {
|
|
|
206
211
|
CommandItem,
|
|
207
212
|
CommandShortcut
|
|
208
213
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
214
|
+
//# sourceMappingURL=chunk-YRF22M5S.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/command.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * Command — ported verbatim from matrx-frontend `components/ui/command.tsx`.\n *\n * `cmdk` is a SANCTIONED REAL DEPENDENCY (the vaul ↔ BottomSheet precedent):\n * the filtering/scoring/keyboard engine IS the component's product — there is\n * no Command palette without it, and reimplementing type-ahead ranking plus\n * roving keyboard selection would twin a maintained library rather than our\n * own code. See FEATURE.md.\n *\n * Seam inversions:\n * - `MagnifyingGlassIcon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `CommandDialog` composed the host dialog module (`Dialog`, `DialogContent`,\n * `DialogTitle`). Those pieces are inlined privately below with identical\n * behavior — modal context, overlay, desktop card / mobile bottom-sheet\n * geometry, close control, portal — except the host's popout-aware\n * `DialogPortal` becomes the package's `PortalContainerProvider` seam\n * (plus an explicit `container` prop, which keeps top priority).\n * - The host's `useIsMobile` (a plain matchMedia breakpoint hook, not\n * host-shaped) became the package's own `./use-is-mobile`, with the same\n * 768px breakpoint. It started life inlined here; `Dialog` needed the same\n * answer, so it moved to a module both read rather than being copied.\n */\n\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport {\n CENTERED_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseControl, CloseRow, CloseSlotProvider, SearchRowCloseSlotProvider, useCloseSlot, useSearchRowCloseSlotClaim } from \"./close-slot\";\nimport { MagnifyingGlassIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\n\nexport const Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\n/* ------------------------------------------------------------------ */\n/* Private dialog internals for CommandDialog (host dialog module, */\n/* behavior-identical, portal seam inverted). */\n/* ------------------------------------------------------------------ */\n\nconst DIALOG_DESKTOP_CLASSES =\n `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so the sheet geometry always wins over any caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\nconst CommandDialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, children, container, onInteractOutside, ...props }, ref) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n useModalLayer(isModal);\n const portalContainer = usePortalContainer(container);\n // The × is the last item of the search row (close-slot.tsx); a palette with\n // no CommandInput gets a close row of its own.\n const closeSlot = useCloseSlot(true);\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n {isModal ? (\n <DialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n )}\n />\n ) : null}\n <DialogPrimitive.Content\n ref={ref}\n aria-modal={isModal || undefined}\n aria-describedby={undefined}\n className={cn(\n isMobile ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n isMobile ? MOTION_BOTTOM_SHEET : MOTION_DIALOG,\n className,\n isMobile && DIALOG_MOBILE_SHEET_OVERRIDE,\n !isModal && \"z-[900]\",\n )}\n {...props}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n >\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow className=\"px-4 pt-4\" /> : null}\n {/* A header inside a palette never reaches past it to an outer Dialog's slot. */}\n <CloseSlotProvider value={null}>\n <SearchRowCloseSlotProvider value={closeSlot.slot}>{children}</SearchRowCloseSlotProvider>\n </CloseSlotProvider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n});\nCommandDialogContent.displayName = \"CommandDialogContent\";\n\nexport interface CommandDialogProps extends DialogProps {\n /** Explicit portal target for the dialog; beats the injected seam. */\n container?: HTMLElement | null;\n}\n\nexport const CommandDialog = ({\n children,\n container,\n ...props\n}: CommandDialogProps) => {\n const modal = props.modal ?? true;\n return (\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n <CommandDialogContent\n className=\"overflow-hidden p-0\"\n {...(container !== undefined ? { container } : {})}\n >\n <DialogPrimitive.Title className=\"sr-only\"></DialogPrimitive.Title>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </CommandDialogContent>\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n );\n};\n\nexport const CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n // Inside a CommandDialog the search row owns the × (never a combobox's input in a Dialog).\n const ownsClose = useSearchRowCloseSlotClaim();\n return (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-disabled-foreground\",\n className,\n )}\n {...props}\n />\n {ownsClose ? <CloseControl className=\"-mr-1\" /> : null}\n </div>\n );\n});\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport const CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nexport const CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nexport const CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nexport const CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nexport const CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport const CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,YAAY,qBAAqB;AACjC,SAAS,WAAW,wBAAwB;AAC5C,YAAY,WAAW;AAuBrB,cAiDI,YAjDJ;AAJK,IAAM,UAAgB,iBAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,QAAQ,cAAc,iBAAiB;AAOvC,IAAM,yBACJ,qEAAqE,eAAe;AAEtF,IAAM,8BACJ;AAGF,IAAM,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EAAC,iBAAiB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,wBAAwB,SAAS;AAAA,IAC9C,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc,iBAAiB,UAAU;AAEnD,IAAM,cAAoB,iBAG/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,iBAAiB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc,iBAAiB,KAAK;AAEzC,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA,GAAG;AACL,MAA6C;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,gBAAgB,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/command.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * Command — ported verbatim from matrx-frontend `components/ui/command.tsx`.\n *\n * `cmdk` is a SANCTIONED REAL DEPENDENCY (the vaul ↔ BottomSheet precedent):\n * the filtering/scoring/keyboard engine IS the component's product — there is\n * no Command palette without it, and reimplementing type-ahead ranking plus\n * roving keyboard selection would twin a maintained library rather than our\n * own code. See FEATURE.md.\n *\n * Seam inversions:\n * - `MagnifyingGlassIcon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `CommandDialog` composed the host dialog module (`Dialog`, `DialogContent`,\n * `DialogTitle`). Those pieces are inlined privately below with identical\n * behavior — modal context, overlay, desktop card / mobile bottom-sheet\n * geometry, close control, portal — except the host's popout-aware\n * `DialogPortal` becomes the package's `PortalContainerProvider` seam\n * (plus an explicit `container` prop, which keeps top priority).\n * - The host's `useIsMobile` (a plain matchMedia breakpoint hook, not\n * host-shaped) became the package's own `./use-is-mobile`, with the same\n * 768px breakpoint. It started life inlined here; `Dialog` needed the same\n * answer, so it moved to a module both read rather than being copied.\n */\n\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport {\n CENTERED_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseControl, CloseRow, CloseSlotProvider, SearchRowCloseSlotProvider, useCloseSlot, useSearchRowCloseSlotClaim } from \"./close-slot\";\nimport { MagnifyingGlassIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\n\nexport const Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\n/* ------------------------------------------------------------------ */\n/* Private dialog internals for CommandDialog (host dialog module, */\n/* behavior-identical, portal seam inverted). */\n/* ------------------------------------------------------------------ */\n\nconst DIALOG_DESKTOP_CLASSES =\n `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so the sheet geometry always wins over any caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\nconst CommandDialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, children, container, onInteractOutside, ...props }, ref) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n useModalLayer(isModal);\n const portalContainer = usePortalContainer(container);\n // The × is the last item of the search row (close-slot.tsx); a palette with\n // no CommandInput gets a close row of its own.\n const closeSlot = useCloseSlot(true);\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n {isModal ? (\n <DialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n )}\n />\n ) : null}\n <DialogPrimitive.Content\n ref={ref}\n aria-modal={isModal || undefined}\n aria-describedby={undefined}\n className={cn(\n isMobile ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n isMobile ? MOTION_BOTTOM_SHEET : MOTION_DIALOG,\n className,\n isMobile && DIALOG_MOBILE_SHEET_OVERRIDE,\n !isModal && \"z-[900]\",\n )}\n {...props}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n >\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow className=\"px-4 pt-4\" /> : null}\n {/* A header inside a palette never reaches past it to an outer Dialog's slot. */}\n <CloseSlotProvider value={null}>\n <SearchRowCloseSlotProvider value={closeSlot.slot}>{children}</SearchRowCloseSlotProvider>\n </CloseSlotProvider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n});\nCommandDialogContent.displayName = \"CommandDialogContent\";\n\nexport interface CommandDialogProps extends DialogProps {\n /** Explicit portal target for the dialog; beats the injected seam. */\n container?: HTMLElement | null;\n}\n\nexport const CommandDialog = ({\n children,\n container,\n ...props\n}: CommandDialogProps) => {\n const modal = props.modal ?? true;\n return (\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n <CommandDialogContent\n className=\"overflow-hidden p-0\"\n {...(container !== undefined ? { container } : {})}\n >\n <DialogPrimitive.Title className=\"sr-only\"></DialogPrimitive.Title>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </CommandDialogContent>\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n );\n};\n\nexport const CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n // Inside a CommandDialog the search row owns the × (never a combobox's input in a Dialog).\n const ownsClose = useSearchRowCloseSlotClaim();\n return (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-disabled-foreground\",\n className,\n )}\n {...props}\n />\n {ownsClose ? <CloseControl className=\"-mr-1\" /> : null}\n </div>\n );\n});\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/**\n * The × for a CommandDialog whose search row is the caller's own (chips, a raw\n * input): put `<CommandRowClose />` last in that row and it claims the palette's\n * slot like `CommandInput` does — never an empty close row above the search.\n * Outside a CommandDialog it draws nothing.\n */\nexport function CommandRowClose({ className }: { className?: string }): React.ReactElement | null {\n const owns = useSearchRowCloseSlotClaim();\n return owns ? <CloseControl className={cn(\"-mr-1\", className)} /> : null;\n}\n\nexport const CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nexport const CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nexport const CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nexport const CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nexport const CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport const CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,YAAY,qBAAqB;AACjC,SAAS,WAAW,wBAAwB;AAC5C,YAAY,WAAW;AAuBrB,cAiDI,YAjDJ;AAJK,IAAM,UAAgB,iBAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,QAAQ,cAAc,iBAAiB;AAOvC,IAAM,yBACJ,qEAAqE,eAAe;AAEtF,IAAM,8BACJ;AAGF,IAAM,+BACJ;AAEF,IAAM,uBAA6B,iBAKjC,CAAC,EAAE,WAAW,UAAU,WAAW,mBAAmB,G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