@mastra/playground-ui 53.0.0-alpha.8 → 53.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{code-DRGJVroV.js → code-D4Vw_fYq.js} +22 -16
- package/dist/code-D4Vw_fYq.js.map +1 -0
- package/dist/{code-BJMC6T9D.cjs → code-DhrdtZce.cjs} +22 -15
- package/dist/code-DhrdtZce.cjs.map +1 -0
- package/dist/{code-block-CBJhDEeB.js → code-block-DeksY23p.js} +2 -2
- package/dist/{code-block-CBJhDEeB.js.map → code-block-DeksY23p.js.map} +1 -1
- package/dist/{code-block-fmv8bHoT.cjs → code-block-DgHrBuR8.cjs} +2 -2
- package/dist/{code-block-fmv8bHoT.cjs.map → code-block-DgHrBuR8.cjs.map} +1 -1
- package/dist/{code-diff-C-EHXZyK.cjs → code-diff-CHZ3P1ky.cjs} +51 -43
- package/dist/code-diff-CHZ3P1ky.cjs.map +1 -0
- package/dist/{code-diff-BB4sqHpq.js → code-diff-CIRbnIfl.js} +52 -44
- package/dist/code-diff-CIRbnIfl.js.map +1 -0
- package/dist/{combobox-BQrlN0eB.cjs → combobox-JNWmgC13.cjs} +8 -3
- package/dist/combobox-JNWmgC13.cjs.map +1 -0
- package/dist/{combobox-DeeAlYti.js → combobox-nxjXzRWu.js} +8 -3
- package/dist/combobox-nxjXzRWu.js.map +1 -0
- package/dist/{command-DWFd0d4c.js → command-Be-KrIAX.js} +2 -2
- package/dist/{command-DWFd0d4c.js.map → command-Be-KrIAX.js.map} +1 -1
- package/dist/{command-CUev1UxH.cjs → command-DsTBCmQq.cjs} +2 -2
- package/dist/{command-CUev1UxH.cjs.map → command-DsTBCmQq.cjs.map} +1 -1
- package/dist/components/ChatShell.cjs.js +20 -1
- package/dist/components/ChatShell.cjs.js.map +1 -1
- package/dist/components/ChatShell.es.js +20 -1
- package/dist/components/ChatShell.es.js.map +1 -1
- package/dist/components/Code.cjs.js +3 -1
- package/dist/components/Code.cjs.js.map +1 -1
- package/dist/components/Code.es.js +1 -1
- package/dist/components/CodeBlock.cjs.js +1 -1
- package/dist/components/CodeBlock.es.js +1 -1
- package/dist/components/CodeDiff.cjs.js +1 -1
- package/dist/components/CodeDiff.es.js +1 -1
- package/dist/components/CodeEditor.cjs.js +2 -1
- package/dist/components/CodeEditor.cjs.js.map +1 -1
- package/dist/components/CodeEditor.es.js +1 -1
- package/dist/components/Combobox.cjs.js +1 -1
- package/dist/components/Combobox.es.js +1 -1
- package/dist/components/Command.cjs.js +1 -1
- package/dist/components/Command.es.js +1 -1
- package/dist/components/CommandPalette.cjs.js +1 -1
- package/dist/components/CommandPalette.es.js +1 -1
- package/dist/components/Comment.cjs.js +2 -2
- package/dist/components/Comment.cjs.js.map +1 -1
- package/dist/components/Comment.es.js +2 -2
- package/dist/components/Comment.es.js.map +1 -1
- package/dist/components/DataCodeSection.cjs.js +1 -1
- package/dist/components/DataCodeSection.es.js +1 -1
- package/dist/components/DataPanel.cjs.js +1 -1
- package/dist/components/DataPanel.es.js +1 -1
- package/dist/components/Dialog.cjs.js +181 -2
- package/dist/components/Dialog.cjs.js.map +1 -1
- package/dist/components/Dialog.es.js +183 -1
- package/dist/components/Dialog.es.js.map +1 -1
- package/dist/components/HorizontalBars.cjs.js +1 -1
- package/dist/components/HorizontalBars.es.js +1 -1
- package/dist/components/IntegrationDialog.cjs.js +105 -0
- package/dist/components/IntegrationDialog.cjs.js.map +1 -0
- package/dist/components/IntegrationDialog.d.ts +2 -0
- package/dist/components/IntegrationDialog.es.js +101 -0
- package/dist/components/IntegrationDialog.es.js.map +1 -0
- package/dist/components/LogsDataList.cjs.js +0 -1
- package/dist/components/LogsDataList.cjs.js.map +1 -1
- package/dist/components/LogsDataList.es.js +0 -1
- package/dist/components/LogsDataList.es.js.map +1 -1
- package/dist/components/MainHeader.cjs.js +1 -1
- package/dist/components/MainHeader.cjs.js.map +1 -1
- package/dist/components/MainHeader.es.js +1 -1
- package/dist/components/MainHeader.es.js.map +1 -1
- package/dist/components/MarkdownRenderer.cjs.js +1 -1
- package/dist/components/MarkdownRenderer.es.js +1 -1
- package/dist/components/PropertyFilter.cjs.js +1 -1
- package/dist/components/PropertyFilter.es.js +1 -1
- package/dist/components/ThreadRail.cjs.js +19 -0
- package/dist/components/ThreadRail.cjs.js.map +1 -1
- package/dist/components/ThreadRail.es.js +19 -1
- package/dist/components/ThreadRail.es.js.map +1 -1
- package/dist/components/ai/plan.cjs.js +1 -1
- package/dist/components/ai/plan.es.js +1 -1
- package/dist/components/ai/tool-call.cjs.js +165 -0
- package/dist/components/ai/tool-call.cjs.js.map +1 -1
- package/dist/components/ai/tool-call.es.js +159 -3
- package/dist/components/ai/tool-call.es.js.map +1 -1
- package/dist/{data-code-section-Dn9smaz4.cjs → data-code-section-B_lg_J_0.cjs} +34 -5
- package/dist/data-code-section-B_lg_J_0.cjs.map +1 -0
- package/dist/{data-code-section-DN2yPgEz.js → data-code-section-Cm_W_XhO.js} +36 -7
- package/dist/data-code-section-Cm_W_XhO.js.map +1 -0
- package/dist/{data-panel-DEatwExN.cjs → data-panel-Cv9j_IGQ.cjs} +2 -2
- package/dist/{data-panel-DEatwExN.cjs.map → data-panel-Cv9j_IGQ.cjs.map} +1 -1
- package/dist/{data-panel-2Da0Utgy.js → data-panel-DXxeSnL1.js} +2 -2
- package/dist/{data-panel-2Da0Utgy.js.map → data-panel-DXxeSnL1.js.map} +1 -1
- package/dist/dialog-CZMPDVUj.js +259 -0
- package/dist/dialog-CZMPDVUj.js.map +1 -0
- package/dist/dialog-D-7Hkb3j.cjs +293 -0
- package/dist/dialog-D-7Hkb3j.cjs.map +1 -0
- package/dist/domains/memory/components/observation-detail-view.cjs.js +1 -1
- package/dist/domains/memory/components/observation-detail-view.es.js +1 -1
- package/dist/domains/metrics/components/token-usage-by-agent-card-view.cjs.js +1 -1
- package/dist/domains/metrics/components/token-usage-by-agent-card-view.es.js +1 -1
- package/dist/domains/metrics/components/traces-volume-card-view.cjs.js +1 -1
- package/dist/domains/metrics/components/traces-volume-card-view.es.js +1 -1
- package/dist/domains/traces/components/span-data-panel-view.cjs.js +61 -105
- package/dist/domains/traces/components/span-data-panel-view.cjs.js.map +1 -1
- package/dist/domains/traces/components/span-data-panel-view.es.js +62 -106
- package/dist/domains/traces/components/span-data-panel-view.es.js.map +1 -1
- package/dist/domains/traces/components/span-summary-description.cjs.js +62 -0
- package/dist/domains/traces/components/span-summary-description.cjs.js.map +1 -0
- package/dist/domains/traces/components/span-summary-description.d.ts +2 -0
- package/dist/domains/traces/components/span-summary-description.es.js +58 -0
- package/dist/domains/traces/components/span-summary-description.es.js.map +1 -0
- package/dist/domains/traces/components/timeline-expand-col.cjs.js +1 -1
- package/dist/domains/traces/components/timeline-expand-col.cjs.js.map +1 -1
- package/dist/domains/traces/components/timeline-expand-col.es.js +1 -1
- package/dist/domains/traces/components/timeline-expand-col.es.js.map +1 -1
- package/dist/domains/traces/components/timeline-name-col.cjs.js +1 -1
- package/dist/domains/traces/components/timeline-name-col.cjs.js.map +1 -1
- package/dist/domains/traces/components/timeline-name-col.es.js +1 -1
- package/dist/domains/traces/components/timeline-name-col.es.js.map +1 -1
- package/dist/domains/traces/components/timeline-timing-col.cjs.js +1 -1
- package/dist/domains/traces/components/timeline-timing-col.cjs.js.map +1 -1
- package/dist/domains/traces/components/timeline-timing-col.es.js +1 -1
- package/dist/domains/traces/components/timeline-timing-col.es.js.map +1 -1
- package/dist/domains/traces/components/trace-columns-menu.cjs.js +1 -1
- package/dist/domains/traces/components/trace-columns-menu.es.js +1 -1
- package/dist/domains/traces/components/trace-data-panel-view.cjs.js +2 -2
- package/dist/domains/traces/components/trace-data-panel-view.cjs.js.map +1 -1
- package/dist/domains/traces/components/trace-data-panel-view.es.js +2 -2
- package/dist/domains/traces/components/trace-data-panel-view.es.js.map +1 -1
- package/dist/domains/traces/components/traces-toolbar.cjs.js +1 -5
- package/dist/domains/traces/components/traces-toolbar.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-toolbar.es.js +1 -5
- package/dist/domains/traces/components/traces-toolbar.es.js.map +1 -1
- package/dist/domains/traces/hooks/use-branch.cjs.js +2 -6
- package/dist/domains/traces/hooks/use-branch.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-branch.es.js +2 -6
- package/dist/domains/traces/hooks/use-branch.es.js.map +1 -1
- package/dist/domains/traces/hooks/use-download-trace-json.cjs.js +4 -1
- package/dist/domains/traces/hooks/use-download-trace-json.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-download-trace-json.es.js +4 -1
- package/dist/domains/traces/hooks/use-download-trace-json.es.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-filter-persistence.cjs.js +11 -18
- package/dist/domains/traces/hooks/use-trace-filter-persistence.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-filter-persistence.es.js +13 -20
- package/dist/domains/traces/hooks/use-trace-filter-persistence.es.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-spans.cjs.js +10 -7
- package/dist/domains/traces/hooks/use-trace-spans.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-spans.es.js +10 -7
- package/dist/domains/traces/hooks/use-trace-spans.es.js.map +1 -1
- package/dist/domains/traces/trace-filters.cjs.js +5 -5
- package/dist/domains/traces/trace-filters.cjs.js.map +1 -1
- package/dist/domains/traces/trace-filters.es.js +5 -5
- package/dist/domains/traces/trace-filters.es.js.map +1 -1
- package/dist/domains/traces/utils/span-utils.cjs.js +6 -0
- package/dist/domains/traces/utils/span-utils.cjs.js.map +1 -1
- package/dist/domains/traces/utils/span-utils.es.js +6 -1
- package/dist/domains/traces/utils/span-utils.es.js.map +1 -1
- package/dist/ee/signals/components/entity-index-list.cjs.js +0 -1
- package/dist/ee/signals/components/entity-index-list.cjs.js.map +1 -1
- package/dist/ee/signals/components/entity-index-list.es.js +0 -1
- package/dist/ee/signals/components/entity-index-list.es.js.map +1 -1
- package/dist/ee/signals/settings/signal-definition-form-dialog.cjs.js +1 -1
- package/dist/ee/signals/settings/signal-definition-form-dialog.es.js +1 -1
- package/dist/{highlight-CSJjjoqh.js → highlight-BmpoELR4.js} +6 -2
- package/dist/{highlight-CSJjjoqh.js.map → highlight-BmpoELR4.js.map} +1 -1
- package/dist/{highlight-CEt2vhD8.cjs → highlight-DK1dn-Fh.cjs} +6 -1
- package/dist/{highlight-CEt2vhD8.cjs.map → highlight-DK1dn-Fh.cjs.map} +1 -1
- package/dist/{horizontal-bars-DZ5J4TKv.js → horizontal-bars-CyP-B-BX.js} +37 -4
- package/dist/horizontal-bars-CyP-B-BX.js.map +1 -0
- package/dist/{horizontal-bars-CE1O-Y6G.cjs → horizontal-bars-Dgq3PYsg.cjs} +37 -4
- package/dist/horizontal-bars-Dgq3PYsg.cjs.map +1 -0
- package/dist/{markdown-renderer-DiJBbnYG.js → markdown-renderer-CaFpZTFS.js} +2 -2
- package/dist/{markdown-renderer-DiJBbnYG.js.map → markdown-renderer-CaFpZTFS.js.map} +1 -1
- package/dist/{markdown-renderer-DGIzNAQY.cjs → markdown-renderer-GVtZLunG.cjs} +2 -2
- package/dist/{markdown-renderer-DGIzNAQY.cjs.map → markdown-renderer-GVtZLunG.cjs.map} +1 -1
- package/dist/src/domains/traces/components/span-summary-description.d.ts +10 -0
- package/dist/src/domains/traces/components/traces-toolbar.d.ts +1 -5
- package/dist/src/domains/traces/hooks/index.d.ts +1 -1
- package/dist/src/domains/traces/hooks/use-trace-filter-persistence.d.ts +5 -18
- package/dist/src/domains/traces/hooks/use-trace-spans.d.ts +3 -1
- package/dist/src/domains/traces/trace-filters.d.ts +4 -3
- package/dist/src/domains/traces/utils/span-utils.d.ts +2 -0
- package/dist/src/ds/components/ChatShell/chat-shell.d.ts +19 -2
- package/dist/src/ds/components/ChatShell/index.d.ts +3 -2
- package/dist/src/ds/components/Code/index.d.ts +1 -0
- package/dist/src/ds/components/Code/use-highlight.d.ts +10 -0
- package/dist/src/ds/components/CodeDiff/code-diff.stories.d.ts +2 -0
- package/dist/src/ds/components/CodeEditor/highlight.d.ts +1 -0
- package/dist/src/ds/components/CodeEditor/index.d.ts +1 -1
- package/dist/src/ds/components/Combobox/combobox.d.ts +3 -1
- package/dist/src/ds/components/DataCodeSection/data-code-section.d.ts +9 -1
- package/dist/src/ds/components/DataCodeSection/index.d.ts +1 -1
- package/dist/src/ds/components/Dialog/dialog-action.d.ts +9 -0
- package/dist/src/ds/components/Dialog/dialog-context.d.ts +16 -0
- package/dist/src/ds/components/Dialog/dialog-new-variant.stories.d.ts +64 -0
- package/dist/src/ds/components/Dialog/dialog.d.ts +15 -6
- package/dist/src/ds/components/Dialog/index.d.ts +2 -0
- package/dist/src/ds/components/HorizontalBars/horizontal-bars.stories.d.ts +2 -0
- package/dist/src/ds/components/IntegrationDialog/__fixtures__/integrations-catalog.d.ts +2 -0
- package/dist/src/ds/components/IntegrationDialog/index.d.ts +2 -0
- package/dist/src/ds/components/IntegrationDialog/integration-dialog.d.ts +28 -0
- package/dist/src/ds/components/IntegrationDialog/integration-dialog.stories.d.ts +24 -0
- package/dist/src/ds/components/ThreadRail/index.d.ts +1 -0
- package/dist/src/ds/components/ThreadRail/turn-groups.d.ts +19 -0
- package/dist/src/ds/components/ai/tool-call/ansi.d.ts +2 -0
- package/dist/src/ds/components/ai/tool-call/group-consecutive.d.ts +17 -0
- package/dist/src/ds/components/ai/tool-call/index.d.ts +4 -0
- package/dist/src/ds/components/ai/tool-call/tool-call-edit.d.ts +4 -0
- package/dist/src/ds/components/ai/tool-call/tool-call-group.d.ts +14 -0
- package/dist/src/ds/components/ai/tool-call/tool-call.d.ts +4 -0
- package/dist/src/ds/components/ai/tool-call/tool-presentation.d.ts +10 -0
- package/dist/style.css +149 -3
- package/package.json +8 -8
- package/dist/code-BJMC6T9D.cjs.map +0 -1
- package/dist/code-DRGJVroV.js.map +0 -1
- package/dist/code-diff-BB4sqHpq.js.map +0 -1
- package/dist/code-diff-C-EHXZyK.cjs.map +0 -1
- package/dist/combobox-BQrlN0eB.cjs.map +0 -1
- package/dist/combobox-DeeAlYti.js.map +0 -1
- package/dist/data-code-section-DN2yPgEz.js.map +0 -1
- package/dist/data-code-section-Dn9smaz4.cjs.map +0 -1
- package/dist/dialog-CESxLg8S.js +0 -76
- package/dist/dialog-CESxLg8S.js.map +0 -1
- package/dist/dialog-K0q0KOOW.cjs +0 -107
- package/dist/dialog-K0q0KOOW.cjs.map +0 -1
- package/dist/horizontal-bars-CE1O-Y6G.cjs.map +0 -1
- package/dist/horizontal-bars-DZ5J4TKv.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-JNWmgC13.cjs","sources":["../src/ds/components/Combobox/combobox-styles.ts","../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '../Button/Button';\nimport type { TextButtonSize } from '../Button/Button';\nimport { controlTriggerOpenState } from '@/ds/primitives/control-size';\nimport type { ControlTriggerVisualVariant } from '@/ds/primitives/control-size';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\n/**\n * A combobox is a form field, so it reuses the same button looks as everywhere,\n * mirroring `SelectTrigger`: `default` (the Button's filled default surface —\n * the default here too), `outline` (bordered, transparent) and `ghost`\n * (borderless, for breadcrumbs/inline pickers). Only the high-emphasis `primary`\n * look is intentionally NOT offered (a field is not a call-to-action).\n */\nexport type ComboboxVisualVariant = ControlTriggerVisualVariant;\nexport type ComboboxLegacyVariant = 'link';\nexport type ComboboxVariant = ComboboxVisualVariant | ComboboxLegacyVariant;\n\nfunction normalizeComboboxVariant(variant: ComboboxVariant): ComboboxVisualVariant {\n return variant === 'link' ? 'ghost' : variant;\n}\n\n/**\n * Single source of truth for both the single- and multi-select combobox\n * triggers. A combobox = a button + a trailing chevron, so it reuses the Button\n * recipe (variant colors, size = height/text/padding/radius, unified border\n * focus, disabled) and layers only the combobox-specific extras — exactly like\n * `SelectTrigger`.\n */\nexport function comboboxTriggerClass({\n variant,\n size,\n error,\n className,\n}: {\n variant: ComboboxVariant;\n size: TextButtonSize;\n error?: boolean;\n className?: string;\n}): string {\n const visualVariant = normalizeComboboxVariant(variant);\n\n return cn(\n buttonVariants({ variant: visualVariant, size }),\n // Fill the field and push the value left / chevron right (Button's base\n // centers its content with `justify-center`).\n 'w-full min-w-32 justify-between',\n // Read as \"active\" while the popup is open, per variant (see map above).\n controlTriggerOpenState[visualVariant],\n 'data-[placeholder]:text-neutral3',\n error && 'border-error hover:border-error focus-visible:border-error',\n className,\n );\n}\n\nexport const comboboxItemClass = cva(\n cn(\n 'relative flex cursor-pointer items-center rounded-md select-none',\n 'min-h-8 py-1.5',\n 'text-ui-smd leading-ui-sm text-neutral4',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-highlighted:bg-surface4 data-highlighted:text-neutral6',\n 'data-selected:text-neutral6',\n ),\n {\n variants: {\n multiple: {\n false: 'gap-2 pr-2 pl-2.5',\n true: 'gap-2 pr-2 pl-2.5',\n },\n },\n defaultVariants: {\n multiple: false,\n },\n },\n);\n\nexport const comboboxStyles = {\n /** Root wrapper */\n root: 'flex flex-col gap-1.5',\n\n /** Chevron icon in trigger — inherits the variant's text color via currentColor. */\n chevron: 'ml-2 h-4 w-4 shrink-0 opacity-60',\n\n /** Placeholder text color */\n placeholder: 'text-neutral3',\n\n /** Popup container — concentric with rounded-xl + p-1 (8px items inside 12px container). */\n popup: cn(\n 'w-max max-w-(--available-width) min-w-(--anchor-width) rounded-xl border border-border1 bg-surface3 text-neutral4',\n 'shadow-dialog',\n 'origin-(--transform-origin)',\n 'transition-[transform,scale,opacity] duration-150 ease-out',\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:scale-95 data-ending-style:opacity-0',\n ),\n\n /** Positioner */\n positioner: 'z-50 pointer-events-auto',\n\n /** Search input container — borderless top section, hairline divider below. */\n searchContainer: cn('flex items-center border-b border-border1 px-2.5 py-1.5', transitions.colors),\n\n /** Search icon */\n searchIcon: cn('mr-2 size-3.5 shrink-0 text-neutral3', transitions.colors),\n\n /** Search input */\n searchInput: cn(\n 'flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n ),\n\n /** Empty state */\n empty: 'not-empty:block hidden py-4 text-center text-ui-smd text-neutral3',\n\n /** Options list */\n list: 'max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1',\n\n /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */\n item: comboboxItemClass({ multiple: false }),\n\n /** Multi-select item — same item rhythm with a right-aligned selected check. */\n itemMulti: comboboxItemClass({ multiple: true }),\n\n /** Right-aligned slot grouping end content + selection check. */\n itemRightSlot: 'ml-auto flex items-center gap-2 shrink-0',\n\n /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */\n checkContainer: 'flex h-4 w-4 shrink-0 items-center justify-center text-neutral6',\n\n /** Check icon (single select) */\n checkIcon: 'h-3.5 w-3.5',\n\n /** Option label/description wrapper */\n optionText: 'flex flex-col gap-0.5 min-w-0',\n\n /** Option label */\n optionLabel: 'truncate',\n\n /** Option description */\n optionDescription: 'text-ui-sm text-neutral3 truncate',\n\n /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */\n optionEnd: 'ml-auto flex items-center shrink-0',\n\n /** Error message */\n error: 'text-ui-sm text-accent2',\n} as const;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport * as React from 'react';\nimport { comboboxItemClass, comboboxStyles, comboboxTriggerClass } from './combobox-styles';\nimport type { ComboboxVariant } from './combobox-styles';\nimport type { TextButtonSize } from '@/ds/components/Button/Button';\nimport { FLOATING_POSITION_METHOD } from '@/ds/primitives/floating';\nimport { usePortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n start?: React.ReactNode;\n end?: React.ReactNode;\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: React.ReactNode;\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n variant?: ComboboxVariant;\n size?: TextButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;\n error?: string;\n allowCustomValue?: boolean;\n /** Called with the search input text as it changes (and with `''` after a single-mode selection resets it). */\n onInputValueChange?: (value: string) => void;\n};\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n multiple?: false;\n value?: string;\n onValueChange?: (value: string) => void;\n};\n\nexport type ComboboxMultipleProps = ComboboxSharedProps & {\n multiple: true;\n value?: readonly string[];\n onValueChange?: (value: string[]) => void;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: string[] = [];\nconst EMPTY_OPTIONS: ComboboxOption[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n return (\n <span className={comboboxStyles.optionText}>\n <span className={comboboxStyles.optionLabel}>{option.label}</span>\n {option.description && <span className={comboboxStyles.optionDescription}>{option.description}</span>}\n </span>\n );\n}\n\nexport function Combobox(props: ComboboxProps) {\n const {\n options,\n placeholder = isMultipleCombobox(props) ? 'Select options...' : 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n disabled = false,\n variant = 'default',\n size = 'md',\n open,\n onOpenChange,\n container,\n error,\n allowCustomValue = false,\n onInputValueChange,\n } = props;\n const multiple = isMultipleCombobox(props);\n const [inputValue, setInputValue] = React.useState('');\n const customValue = inputValue.trim();\n const customOption =\n !multiple && allowCustomValue && customValue && !options.some(option => option.value === customValue)\n ? { label: `Use “${customValue}”`, value: customValue }\n : undefined;\n const displayedOptions = customOption ? [customOption, ...options] : options;\n const selectedValues = multiple ? (props.value ?? EMPTY_VALUES) : EMPTY_VALUES;\n const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);\n const selectedOption = multiple ? null : (options.find(option => option.value === props.value) ?? null);\n const selectedOptions = multiple ? options.filter(option => selectedValueSet.has(option.value)) : EMPTY_OPTIONS;\n const triggerText = selectedOptions.length === 0 ? placeholder : `${selectedOptions.length} selected`;\n // Default to the nearest SideDialog/Drawer popup so the list stays\n // interactive inside a modal drawer; an explicit `container` still wins.\n const resolvedContainer = usePortalContainer(container);\n\n const comboboxContent = (\n <>\n <BaseCombobox.Trigger className={comboboxTriggerClass({ variant, size, error: Boolean(error), className })}>\n {multiple ? (\n <span className={cn('truncate', selectedOptions.length === 0 && comboboxStyles.placeholder)}>\n {triggerText}\n </span>\n ) : (\n // Keep truncation off the outer wrapper so start adornments are not clipped.\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedOption?.start}\n <span className=\"truncate\">\n <BaseCombobox.Value placeholder={placeholder} />\n </span>\n </span>\n )}\n {/* Wrap the chevron in a `<span>` so the svg is one level deep and\n escapes Button's `[&>svg]` adornments — mirrors Select's chevron wrap. */}\n <span className=\"flex shrink-0 items-center\">\n <ChevronsUpDown className={comboboxStyles.chevron} />\n </span>\n </BaseCombobox.Trigger>\n\n <BaseCombobox.Portal container={resolvedContainer}>\n <BaseCombobox.Positioner\n align=\"start\"\n sideOffset={4}\n positionMethod={FLOATING_POSITION_METHOD}\n className={comboboxStyles.positioner}\n >\n <BaseCombobox.Popup className={comboboxStyles.popup}>\n <div className={comboboxStyles.searchContainer}>\n <Search className={comboboxStyles.searchIcon} />\n <BaseCombobox.Input className={comboboxStyles.searchInput} placeholder={searchPlaceholder} />\n </div>\n <BaseCombobox.Empty className={comboboxStyles.empty}>{emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={comboboxStyles.list}>\n {(option: ComboboxOption) => {\n const isSelected = selectedValueSet.has(option.value);\n\n return (\n <BaseCombobox.Item key={option.value} value={option} className={comboboxItemClass({ multiple })}>\n {multiple ? (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n {isSelected ? <Check className={comboboxStyles.checkIcon} /> : null}\n </span>\n </span>\n </>\n ) : (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n <BaseCombobox.ItemIndicator>\n <Check className={comboboxStyles.checkIcon} />\n </BaseCombobox.ItemIndicator>\n </span>\n </span>\n </>\n )}\n </BaseCombobox.Item>\n );\n }}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </>\n );\n\n if (multiple) {\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n multiple\n autoHighlight\n items={displayedOptions}\n value={selectedOptions}\n onValueChange={items => props.onValueChange?.((items ?? []).map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n }\n\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n autoHighlight\n items={displayedOptions}\n value={selectedOption}\n inputValue={inputValue}\n onInputValueChange={value => {\n setInputValue(value);\n onInputValueChange?.(value);\n }}\n onValueChange={item => {\n if (item) {\n props.onValueChange?.(item.value);\n setInputValue('');\n onInputValueChange?.('');\n }\n }}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n}\n"],"names":["cn","buttonVariants","controlTriggerOpenState","cva","transitions","jsxs","jsx","React","usePortalContainer","Fragment","BaseCombobox","ChevronsUpDown","FLOATING_POSITION_METHOD","Search","Check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,yBAAyB,OAAA,EAAiD;AACjF,EAAA,OAAO,OAAA,KAAY,SAAS,OAAA,GAAU,OAAA;AACxC;AASO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAKW;AACT,EAAA,MAAM,aAAA,GAAgB,yBAAyB,OAAO,CAAA;AAEtD,EAAA,OAAOA,WAAA;AAAA,IACLC,qBAAA,CAAe,EAAE,OAAA,EAAS,aAAA,EAAe,MAAM,CAAA;AAAA;AAAA;AAAA,IAG/C,iCAAA;AAAA;AAAA,IAEAC,+CAAwB,aAAa,CAAA;AAAA,IACrC,kCAAA;AAAA,IACA,KAAA,IAAS,4DAAA;AAAA,IACT;AAAA,GACF;AACF;AAEO,MAAM,iBAAA,GAAoBC,SAAA;AAAA,EAC/BH,WAAA;AAAA,IACE,kEAAA;AAAA,IACA,gBAAA;AAAA,IACA,yCAAA;AAAA,IACA,4DAAA;AAAA,IACAI,kCAAA,CAAY,MAAA;AAAA,IACZ,6DAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,QAAA,EAAU;AAAA,QACR,KAAA,EAAO,mBAAA;AAAA,QACP,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,QAAA,EAAU;AAAA;AACZ;AAEJ,CAAA;AAEO,MAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,IAAA,EAAM,uBAAA;AAAA;AAAA,EAGN,OAAA,EAAS,kCAAA;AAAA;AAAA,EAGT,WAAA,EAAa,eAAA;AAAA;AAAA,EA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AAa,IAAA;AAAA,QACb,KAAA,EAAO,gBAAA;AAAA,QACP,KAAA,EAAO,cAAA;AAAA,QACP,UAAA;AAAA,QACA,oBAAoB,CAAA,KAAA,KAAS;AAC3B,UAAA,aAAA,CAAc,KAAK,CAAA;AACnB,UAAA,kBAAA,GAAqB,KAAK,CAAA;AAAA,QAC5B,CAAA;AAAA,QACA,eAAe,CAAA,IAAA,KAAQ;AACrB,UAAA,IAAI,IAAA,EAAM;AACR,YAAA,KAAA,CAAM,aAAA,GAAgB,KAAK,KAAK,CAAA;AAChC,YAAA,aAAA,CAAc,EAAE,CAAA;AAChB,YAAA,kBAAA,GAAqB,EAAE,CAAA;AAAA,UACzB;AAAA,QACF,CAAA;AAAA,QACA,QAAA;AAAA,QACA,IAAA;AAAA,QACA,YAAA;AAAA,QAEC,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IACC,yBAASJ,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,cAAA,CAAe,OAAQ,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAC1D,CAAA;AAEJ;;;;;"}
|
|
@@ -134,7 +134,8 @@ function Combobox(props) {
|
|
|
134
134
|
onOpenChange,
|
|
135
135
|
container,
|
|
136
136
|
error,
|
|
137
|
-
allowCustomValue = false
|
|
137
|
+
allowCustomValue = false,
|
|
138
|
+
onInputValueChange
|
|
138
139
|
} = props;
|
|
139
140
|
const multiple = isMultipleCombobox(props);
|
|
140
141
|
const [inputValue, setInputValue] = React.useState("");
|
|
@@ -220,11 +221,15 @@ function Combobox(props) {
|
|
|
220
221
|
items: displayedOptions,
|
|
221
222
|
value: selectedOption,
|
|
222
223
|
inputValue,
|
|
223
|
-
onInputValueChange:
|
|
224
|
+
onInputValueChange: (value) => {
|
|
225
|
+
setInputValue(value);
|
|
226
|
+
onInputValueChange?.(value);
|
|
227
|
+
},
|
|
224
228
|
onValueChange: (item) => {
|
|
225
229
|
if (item) {
|
|
226
230
|
props.onValueChange?.(item.value);
|
|
227
231
|
setInputValue("");
|
|
232
|
+
onInputValueChange?.("");
|
|
228
233
|
}
|
|
229
234
|
},
|
|
230
235
|
disabled,
|
|
@@ -238,4 +243,4 @@ function Combobox(props) {
|
|
|
238
243
|
}
|
|
239
244
|
|
|
240
245
|
export { Combobox as C, comboboxStyles as c };
|
|
241
|
-
//# sourceMappingURL=combobox-
|
|
246
|
+
//# sourceMappingURL=combobox-nxjXzRWu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-nxjXzRWu.js","sources":["../src/ds/components/Combobox/combobox-styles.ts","../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '../Button/Button';\nimport type { TextButtonSize } from '../Button/Button';\nimport { controlTriggerOpenState } from '@/ds/primitives/control-size';\nimport type { ControlTriggerVisualVariant } from '@/ds/primitives/control-size';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\n/**\n * A combobox is a form field, so it reuses the same button looks as everywhere,\n * mirroring `SelectTrigger`: `default` (the Button's filled default surface —\n * the default here too), `outline` (bordered, transparent) and `ghost`\n * (borderless, for breadcrumbs/inline pickers). Only the high-emphasis `primary`\n * look is intentionally NOT offered (a field is not a call-to-action).\n */\nexport type ComboboxVisualVariant = ControlTriggerVisualVariant;\nexport type ComboboxLegacyVariant = 'link';\nexport type ComboboxVariant = ComboboxVisualVariant | ComboboxLegacyVariant;\n\nfunction normalizeComboboxVariant(variant: ComboboxVariant): ComboboxVisualVariant {\n return variant === 'link' ? 'ghost' : variant;\n}\n\n/**\n * Single source of truth for both the single- and multi-select combobox\n * triggers. A combobox = a button + a trailing chevron, so it reuses the Button\n * recipe (variant colors, size = height/text/padding/radius, unified border\n * focus, disabled) and layers only the combobox-specific extras — exactly like\n * `SelectTrigger`.\n */\nexport function comboboxTriggerClass({\n variant,\n size,\n error,\n className,\n}: {\n variant: ComboboxVariant;\n size: TextButtonSize;\n error?: boolean;\n className?: string;\n}): string {\n const visualVariant = normalizeComboboxVariant(variant);\n\n return cn(\n buttonVariants({ variant: visualVariant, size }),\n // Fill the field and push the value left / chevron right (Button's base\n // centers its content with `justify-center`).\n 'w-full min-w-32 justify-between',\n // Read as \"active\" while the popup is open, per variant (see map above).\n controlTriggerOpenState[visualVariant],\n 'data-[placeholder]:text-neutral3',\n error && 'border-error hover:border-error focus-visible:border-error',\n className,\n );\n}\n\nexport const comboboxItemClass = cva(\n cn(\n 'relative flex cursor-pointer items-center rounded-md select-none',\n 'min-h-8 py-1.5',\n 'text-ui-smd leading-ui-sm text-neutral4',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-highlighted:bg-surface4 data-highlighted:text-neutral6',\n 'data-selected:text-neutral6',\n ),\n {\n variants: {\n multiple: {\n false: 'gap-2 pr-2 pl-2.5',\n true: 'gap-2 pr-2 pl-2.5',\n },\n },\n defaultVariants: {\n multiple: false,\n },\n },\n);\n\nexport const comboboxStyles = {\n /** Root wrapper */\n root: 'flex flex-col gap-1.5',\n\n /** Chevron icon in trigger — inherits the variant's text color via currentColor. */\n chevron: 'ml-2 h-4 w-4 shrink-0 opacity-60',\n\n /** Placeholder text color */\n placeholder: 'text-neutral3',\n\n /** Popup container — concentric with rounded-xl + p-1 (8px items inside 12px container). */\n popup: cn(\n 'w-max max-w-(--available-width) min-w-(--anchor-width) rounded-xl border border-border1 bg-surface3 text-neutral4',\n 'shadow-dialog',\n 'origin-(--transform-origin)',\n 'transition-[transform,scale,opacity] duration-150 ease-out',\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:scale-95 data-ending-style:opacity-0',\n ),\n\n /** Positioner */\n positioner: 'z-50 pointer-events-auto',\n\n /** Search input container — borderless top section, hairline divider below. */\n searchContainer: cn('flex items-center border-b border-border1 px-2.5 py-1.5', transitions.colors),\n\n /** Search icon */\n searchIcon: cn('mr-2 size-3.5 shrink-0 text-neutral3', transitions.colors),\n\n /** Search input */\n searchInput: cn(\n 'flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n ),\n\n /** Empty state */\n empty: 'not-empty:block hidden py-4 text-center text-ui-smd text-neutral3',\n\n /** Options list */\n list: 'max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1',\n\n /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */\n item: comboboxItemClass({ multiple: false }),\n\n /** Multi-select item — same item rhythm with a right-aligned selected check. */\n itemMulti: comboboxItemClass({ multiple: true }),\n\n /** Right-aligned slot grouping end content + selection check. */\n itemRightSlot: 'ml-auto flex items-center gap-2 shrink-0',\n\n /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */\n checkContainer: 'flex h-4 w-4 shrink-0 items-center justify-center text-neutral6',\n\n /** Check icon (single select) */\n checkIcon: 'h-3.5 w-3.5',\n\n /** Option label/description wrapper */\n optionText: 'flex flex-col gap-0.5 min-w-0',\n\n /** Option label */\n optionLabel: 'truncate',\n\n /** Option description */\n optionDescription: 'text-ui-sm text-neutral3 truncate',\n\n /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */\n optionEnd: 'ml-auto flex items-center shrink-0',\n\n /** Error message */\n error: 'text-ui-sm text-accent2',\n} as const;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport * as React from 'react';\nimport { comboboxItemClass, comboboxStyles, comboboxTriggerClass } from './combobox-styles';\nimport type { ComboboxVariant } from './combobox-styles';\nimport type { TextButtonSize } from '@/ds/components/Button/Button';\nimport { FLOATING_POSITION_METHOD } from '@/ds/primitives/floating';\nimport { usePortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n start?: React.ReactNode;\n end?: React.ReactNode;\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: React.ReactNode;\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n variant?: ComboboxVariant;\n size?: TextButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;\n error?: string;\n allowCustomValue?: boolean;\n /** Called with the search input text as it changes (and with `''` after a single-mode selection resets it). */\n onInputValueChange?: (value: string) => void;\n};\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n multiple?: false;\n value?: string;\n onValueChange?: (value: string) => void;\n};\n\nexport type ComboboxMultipleProps = ComboboxSharedProps & {\n multiple: true;\n value?: readonly string[];\n onValueChange?: (value: string[]) => void;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: string[] = [];\nconst EMPTY_OPTIONS: ComboboxOption[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n return (\n <span className={comboboxStyles.optionText}>\n <span className={comboboxStyles.optionLabel}>{option.label}</span>\n {option.description && <span className={comboboxStyles.optionDescription}>{option.description}</span>}\n </span>\n );\n}\n\nexport function Combobox(props: ComboboxProps) {\n const {\n options,\n placeholder = isMultipleCombobox(props) ? 'Select options...' : 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n disabled = false,\n variant = 'default',\n size = 'md',\n open,\n onOpenChange,\n container,\n error,\n allowCustomValue = false,\n onInputValueChange,\n } = props;\n const multiple = isMultipleCombobox(props);\n const [inputValue, setInputValue] = React.useState('');\n const customValue = inputValue.trim();\n const customOption =\n !multiple && allowCustomValue && customValue && !options.some(option => option.value === customValue)\n ? { label: `Use “${customValue}”`, value: customValue }\n : undefined;\n const displayedOptions = customOption ? [customOption, ...options] : options;\n const selectedValues = multiple ? (props.value ?? EMPTY_VALUES) : EMPTY_VALUES;\n const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);\n const selectedOption = multiple ? null : (options.find(option => option.value === props.value) ?? null);\n const selectedOptions = multiple ? options.filter(option => selectedValueSet.has(option.value)) : EMPTY_OPTIONS;\n const triggerText = selectedOptions.length === 0 ? placeholder : `${selectedOptions.length} selected`;\n // Default to the nearest SideDialog/Drawer popup so the list stays\n // interactive inside a modal drawer; an explicit `container` still wins.\n const resolvedContainer = usePortalContainer(container);\n\n const comboboxContent = (\n <>\n <BaseCombobox.Trigger className={comboboxTriggerClass({ variant, size, error: Boolean(error), className })}>\n {multiple ? (\n <span className={cn('truncate', selectedOptions.length === 0 && comboboxStyles.placeholder)}>\n {triggerText}\n </span>\n ) : (\n // Keep truncation off the outer wrapper so start adornments are not clipped.\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedOption?.start}\n <span className=\"truncate\">\n <BaseCombobox.Value placeholder={placeholder} />\n </span>\n </span>\n )}\n {/* Wrap the chevron in a `<span>` so the svg is one level deep and\n escapes Button's `[&>svg]` adornments — mirrors Select's chevron wrap. */}\n <span className=\"flex shrink-0 items-center\">\n <ChevronsUpDown className={comboboxStyles.chevron} />\n </span>\n </BaseCombobox.Trigger>\n\n <BaseCombobox.Portal container={resolvedContainer}>\n <BaseCombobox.Positioner\n align=\"start\"\n sideOffset={4}\n positionMethod={FLOATING_POSITION_METHOD}\n className={comboboxStyles.positioner}\n >\n <BaseCombobox.Popup className={comboboxStyles.popup}>\n <div className={comboboxStyles.searchContainer}>\n <Search className={comboboxStyles.searchIcon} />\n <BaseCombobox.Input className={comboboxStyles.searchInput} placeholder={searchPlaceholder} />\n </div>\n <BaseCombobox.Empty className={comboboxStyles.empty}>{emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={comboboxStyles.list}>\n {(option: ComboboxOption) => {\n const isSelected = selectedValueSet.has(option.value);\n\n return (\n <BaseCombobox.Item key={option.value} value={option} className={comboboxItemClass({ multiple })}>\n {multiple ? (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n {isSelected ? <Check className={comboboxStyles.checkIcon} /> : null}\n </span>\n </span>\n </>\n ) : (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n <BaseCombobox.ItemIndicator>\n <Check className={comboboxStyles.checkIcon} />\n </BaseCombobox.ItemIndicator>\n </span>\n </span>\n </>\n )}\n </BaseCombobox.Item>\n );\n }}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </>\n );\n\n if (multiple) {\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n multiple\n autoHighlight\n items={displayedOptions}\n value={selectedOptions}\n onValueChange={items => props.onValueChange?.((items ?? []).map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n }\n\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n autoHighlight\n items={displayedOptions}\n value={selectedOption}\n inputValue={inputValue}\n onInputValueChange={value => {\n setInputValue(value);\n onInputValueChange?.(value);\n }}\n onValueChange={item => {\n if (item) {\n props.onValueChange?.(item.value);\n setInputValue('');\n onInputValueChange?.('');\n }\n }}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n}\n"],"names":["BaseCombobox"],"mappings":";;;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;AACR,YAAA,KAAA,CAAM,aAAA,GAAgB,KAAK,KAAK,CAAA;AAChC,YAAA,aAAA,CAAc,EAAE,CAAA;AAChB,YAAA,kBAAA,GAAqB,EAAE,CAAA;AAAA,UACzB;AAAA,QACF,CAAA;AAAA,QACA,QAAA;AAAA,QACA,IAAA;AAAA,QACA,YAAA;AAAA,QAEC,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IACC,yBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,cAAA,CAAe,OAAQ,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAC1D,CAAA;AAEJ;;;;"}
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Command as Command$1 } from 'cmdk';
|
|
3
3
|
import { Search } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { D as Dialog,
|
|
5
|
+
import { D as Dialog, a as DialogContent, c as DialogTitle, d as DialogDescription } from './dialog-CZMPDVUj.js';
|
|
6
6
|
import { S as ScrollArea } from './scroll-area-BiHnOfzg.js';
|
|
7
7
|
import { transitions } from './primitives/transitions.es.js';
|
|
8
8
|
import { c as cn } from './cn-B4oPhFx9.js';
|
|
@@ -165,4 +165,4 @@ const CommandShortcut = ({ className, ...props }) => {
|
|
|
165
165
|
CommandShortcut.displayName = "CommandShortcut";
|
|
166
166
|
|
|
167
167
|
export { Command as C, CommandDialog as a, CommandEmpty as b, CommandGroup as c, CommandInput as d, CommandItem as e, CommandList as f, CommandSeparator as g, CommandShortcut as h };
|
|
168
|
-
//# sourceMappingURL=command-
|
|
168
|
+
//# sourceMappingURL=command-Be-KrIAX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-DWFd0d4c.js","sources":["../src/ds/components/Command/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ds/components/Dialog';\nimport { ScrollArea } from '@/ds/components/ScrollArea';\nimport type { ScrollAreaMask } from '@/ds/components/ScrollArea';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4', className)}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {\n children?: React.ReactNode;\n title?: string;\n description?: string;\n contentClassName?: string;\n commandClassName?: string;\n commandLabel?: string;\n showOverlay?: boolean;\n overlayClassName?: string;\n};\n\nconst CommandDialog = ({\n children,\n title = 'Command Palette',\n description = 'Search for commands and actions',\n contentClassName,\n commandClassName,\n commandLabel,\n showOverlay = false,\n overlayClassName,\n ...props\n}: CommandDialogProps) => {\n // Custom filter that preserves DOM order by returning 1 for all matches\n // This prevents cmdk from reordering items by match score\n const filter = React.useCallback((value: string, search: string) => {\n const normalizedValue = value.toLowerCase();\n const normalizedSearch = search.toLowerCase();\n const searchTerms = normalizedSearch.split(/\\s+/).filter(Boolean);\n\n // All search terms must be found in the value\n const matches = searchTerms.every(term => normalizedValue.includes(term));\n return matches ? 1 : 0;\n }, []);\n\n // Stop propagation to prevent keyboard events from reaching\n // global document-level listeners (e.g., table keyboard nav)\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') return;\n\n e.stopPropagation();\n }, []);\n\n return (\n <Dialog {...props}>\n <DialogContent\n showOverlay={showOverlay}\n overlayClassName={overlayClassName}\n className={cn('overflow-hidden p-0', contentClassName)}\n >\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n label={commandLabel}\n loop\n filter={filter}\n onKeyDown={handleKeyDown}\n className={cn(\n '[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3',\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2',\n '[&_[data-slot=command-input-wrapper]_svg]:size-5',\n '**:[[cmdk-input]]:h-12',\n '**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3',\n '[&_[cmdk-item]_svg]:size-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n rightSlot?: React.ReactNode;\n wrapperClassName?: string;\n};\n\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, CommandInputProps>(\n ({ className, rightSlot, wrapperClassName, ...props }, ref) => (\n <div\n data-slot=\"command-input-wrapper\"\n className={cn('flex items-center border-b border-border1 px-3', transitions.colors, wrapperClassName)}\n >\n <Search className={cn('mr-2 size-4 shrink-0 text-neutral3', transitions.colors)} />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n className,\n )}\n {...props}\n />\n {rightSlot && (\n <div data-slot=\"command-input-right-slot\" className=\"text-neutral3 ml-2 flex shrink-0 items-center\">\n {rightSlot}\n </div>\n )}\n </div>\n ),\n);\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & {\n scrollArea?: boolean;\n scrollAreaClassName?: string;\n scrollAreaViewportClassName?: string;\n scrollAreaMask?: ScrollAreaMask;\n};\n\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, CommandListProps>(\n (\n { className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props },\n ref,\n ) => {\n const list = (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'outline-none focus:outline-none focus-visible:outline-none',\n scrollArea ? 'overflow-visible' : 'max-h-dropdown-max-height overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n\n if (!scrollArea) return list;\n\n return (\n <ScrollArea\n className={cn('min-h-0', scrollAreaClassName)}\n viewPortClassName={scrollAreaViewportClassName}\n mask={scrollAreaMask}\n >\n {list}\n </ScrollArea>\n );\n },\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"text-ui-smd text-neutral3 py-6 text-center\" {...props} />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<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-neutral4',\n '[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border1', className)} {...props} />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<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 cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums', className)} {...props} />;\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["CommandPrimitive"],"mappings":";;;;;;;;;AAUA,MAAM,OAAA,GAAU,MAAM,UAAA,CAGpB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1B,GAAA;AAAA,EAACA,SAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,8EAAA,EAAgF,SAAS,CAAA;AAAA,IACtG,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,cAAcA,SAAA,CAAiB,WAAA;AAavC,M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A,SAAA,EAAW,EAAA;AAAA,MACT,mCAAA;AAAA,MACA,8RAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAA,CAAa,WAAA,GAAcA,UAAiB,KAAA,CAAM,WAAA;AAElD,MAAM,gBAAA,GAAmB,MAAM,UAAA,CAG7B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1B,GAAA,CAACA,UAAiB,SAAA,EAAjB,EAA2B,KAAU,SAAA,EAAW,EAAA,CAAG,yBAAyB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CACrG;AACD,gBAAA,CAAiB,WAAA,GAAcA,UAAiB,SAAA,CAAU,WAAA;AAE1D,MAAM,WAAA,GAAc,MAAM,UAAA,CAGxB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1B,GAAA;AAAA,EAACA,SAAA,CAAiB,IAAA;AAAA,EAAjB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,8HAAA;AAAA,MACA,4DAAA;AAAA,MACA,WAAA,CAAY,MAAA;AAAA,MACZ,qEAAA;AAAA,MACA,0EAAA;AAAA,MACA,8HAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAA,CAAY,WAAA,GAAcA,UAAiB,IAAA,CAAK,WAAA;AAEhD,MAAM,kBAAkB,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,KAA6C;AAC1F,EAAA,uBAAO,GAAA,CAAC,UAAK,SAAA,EAAW,EAAA,CAAG,gEAAgE,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACpH;AACA,eAAA,CAAgB,WAAA,GAAc,iBAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"command-Be-KrIAX.js","sources":["../src/ds/components/Command/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ds/components/Dialog';\nimport { ScrollArea } from '@/ds/components/ScrollArea';\nimport type { ScrollAreaMask } from '@/ds/components/ScrollArea';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4', className)}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {\n children?: React.ReactNode;\n title?: string;\n description?: string;\n contentClassName?: string;\n commandClassName?: string;\n commandLabel?: string;\n showOverlay?: boolean;\n overlayClassName?: string;\n};\n\nconst CommandDialog = ({\n children,\n title = 'Command Palette',\n description = 'Search for commands and actions',\n contentClassName,\n commandClassName,\n commandLabel,\n showOverlay = false,\n overlayClassName,\n ...props\n}: CommandDialogProps) => {\n // Custom filter that preserves DOM order by returning 1 for all matches\n // This prevents cmdk from reordering items by match score\n const filter = React.useCallback((value: string, search: string) => {\n const normalizedValue = value.toLowerCase();\n const normalizedSearch = search.toLowerCase();\n const searchTerms = normalizedSearch.split(/\\s+/).filter(Boolean);\n\n // All search terms must be found in the value\n const matches = searchTerms.every(term => normalizedValue.includes(term));\n return matches ? 1 : 0;\n }, []);\n\n // Stop propagation to prevent keyboard events from reaching\n // global document-level listeners (e.g., table keyboard nav)\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') return;\n\n e.stopPropagation();\n }, []);\n\n return (\n <Dialog {...props}>\n <DialogContent\n showOverlay={showOverlay}\n overlayClassName={overlayClassName}\n className={cn('overflow-hidden p-0', contentClassName)}\n >\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n label={commandLabel}\n loop\n filter={filter}\n onKeyDown={handleKeyDown}\n className={cn(\n '[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3',\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2',\n '[&_[data-slot=command-input-wrapper]_svg]:size-5',\n '**:[[cmdk-input]]:h-12',\n '**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3',\n '[&_[cmdk-item]_svg]:size-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n rightSlot?: React.ReactNode;\n wrapperClassName?: string;\n};\n\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, CommandInputProps>(\n ({ className, rightSlot, wrapperClassName, ...props }, ref) => (\n <div\n data-slot=\"command-input-wrapper\"\n className={cn('flex items-center border-b border-border1 px-3', transitions.colors, wrapperClassName)}\n >\n <Search className={cn('mr-2 size-4 shrink-0 text-neutral3', transitions.colors)} />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n className,\n )}\n {...props}\n />\n {rightSlot && (\n <div data-slot=\"command-input-right-slot\" className=\"text-neutral3 ml-2 flex shrink-0 items-center\">\n {rightSlot}\n </div>\n )}\n </div>\n ),\n);\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & {\n scrollArea?: boolean;\n scrollAreaClassName?: string;\n scrollAreaViewportClassName?: string;\n scrollAreaMask?: ScrollAreaMask;\n};\n\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, CommandListProps>(\n (\n { className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props },\n ref,\n ) => {\n const list = (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'outline-none focus:outline-none focus-visible:outline-none',\n scrollArea ? 'overflow-visible' : 'max-h-dropdown-max-height overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n\n if (!scrollArea) return list;\n\n return (\n <ScrollArea\n className={cn('min-h-0', scrollAreaClassName)}\n viewPortClassName={scrollAreaViewportClassName}\n mask={scrollAreaMask}\n >\n {list}\n </ScrollArea>\n );\n },\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"text-ui-smd text-neutral3 py-6 text-center\" {...props} />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<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-neutral4',\n '[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border1', className)} {...props} />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<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 cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums', className)} {...props} />;\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["CommandPrimitive"],"mappings":";;;;;;;;;AAUA,MAAM,OAAA,GAAU,MAAM,UAAA,CAGpB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1B,GAAA;AAAA,EAACA,SAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,8EAAA,EAAgF,SAAS,CAAA;AAAA,IACtG,GAAG;AAAA;AACN,CACD;AACD,OAAA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mdk');
|
|
5
5
|
const lucideReact = require('lucide-react');
|
|
6
6
|
const React = require('react');
|
|
7
|
-
const dialog = require('./dialog-
|
|
7
|
+
const dialog = require('./dialog-D-7Hkb3j.cjs');
|
|
8
8
|
const scrollArea = require('./scroll-area-B1vdOFuC.cjs');
|
|
9
9
|
const primitives_transitions = require('./primitives/transitions.cjs.js');
|
|
10
10
|
const utils_cn = require('./cn-DCPcv4xv.cjs');
|
|
@@ -194,4 +194,4 @@ exports.CommandItem = CommandItem;
|
|
|
194
194
|
exports.CommandList = CommandList;
|
|
195
195
|
exports.CommandSeparator = CommandSeparator;
|
|
196
196
|
exports.CommandShortcut = CommandShortcut;
|
|
197
|
-
//# sourceMappingURL=command-
|
|
197
|
+
//# sourceMappingURL=command-DsTBCmQq.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-CUev1UxH.cjs","sources":["../src/ds/components/Command/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ds/components/Dialog';\nimport { ScrollArea } from '@/ds/components/ScrollArea';\nimport type { ScrollAreaMask } from '@/ds/components/ScrollArea';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4', className)}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {\n children?: React.ReactNode;\n title?: string;\n description?: string;\n contentClassName?: string;\n commandClassName?: string;\n commandLabel?: string;\n showOverlay?: boolean;\n overlayClassName?: string;\n};\n\nconst CommandDialog = ({\n children,\n title = 'Command Palette',\n description = 'Search for commands and actions',\n contentClassName,\n commandClassName,\n commandLabel,\n showOverlay = false,\n overlayClassName,\n ...props\n}: CommandDialogProps) => {\n // Custom filter that preserves DOM order by returning 1 for all matches\n // This prevents cmdk from reordering items by match score\n const filter = React.useCallback((value: string, search: string) => {\n const normalizedValue = value.toLowerCase();\n const normalizedSearch = search.toLowerCase();\n const searchTerms = normalizedSearch.split(/\\s+/).filter(Boolean);\n\n // All search terms must be found in the value\n const matches = searchTerms.every(term => normalizedValue.includes(term));\n return matches ? 1 : 0;\n }, []);\n\n // Stop propagation to prevent keyboard events from reaching\n // global document-level listeners (e.g., table keyboard nav)\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') return;\n\n e.stopPropagation();\n }, []);\n\n return (\n <Dialog {...props}>\n <DialogContent\n showOverlay={showOverlay}\n overlayClassName={overlayClassName}\n className={cn('overflow-hidden p-0', contentClassName)}\n >\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n label={commandLabel}\n loop\n filter={filter}\n onKeyDown={handleKeyDown}\n className={cn(\n '[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3',\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2',\n '[&_[data-slot=command-input-wrapper]_svg]:size-5',\n '**:[[cmdk-input]]:h-12',\n '**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3',\n '[&_[cmdk-item]_svg]:size-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n rightSlot?: React.ReactNode;\n wrapperClassName?: string;\n};\n\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, CommandInputProps>(\n ({ className, rightSlot, wrapperClassName, ...props }, ref) => (\n <div\n data-slot=\"command-input-wrapper\"\n className={cn('flex items-center border-b border-border1 px-3', transitions.colors, wrapperClassName)}\n >\n <Search className={cn('mr-2 size-4 shrink-0 text-neutral3', transitions.colors)} />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n className,\n )}\n {...props}\n />\n {rightSlot && (\n <div data-slot=\"command-input-right-slot\" className=\"text-neutral3 ml-2 flex shrink-0 items-center\">\n {rightSlot}\n </div>\n )}\n </div>\n ),\n);\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & {\n scrollArea?: boolean;\n scrollAreaClassName?: string;\n scrollAreaViewportClassName?: string;\n scrollAreaMask?: ScrollAreaMask;\n};\n\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, CommandListProps>(\n (\n { className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props },\n ref,\n ) => {\n const list = (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'outline-none focus:outline-none focus-visible:outline-none',\n scrollArea ? 'overflow-visible' : 'max-h-dropdown-max-height overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n\n if (!scrollArea) return list;\n\n return (\n <ScrollArea\n className={cn('min-h-0', scrollAreaClassName)}\n viewPortClassName={scrollAreaViewportClassName}\n mask={scrollAreaMask}\n >\n {list}\n </ScrollArea>\n );\n },\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"text-ui-smd text-neutral3 py-6 text-center\" {...props} />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<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-neutral4',\n '[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border1', className)} {...props} />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<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 cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums', className)} {...props} />;\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["React","jsx","CommandPrimitive","cn","Dialog","jsxs","DialogContent","DialogTitle","DialogDescription","transitions","Search","scrollArea","ScrollArea"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,OAAA,GAAUA,iBAAM,UAAA,CAGpB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA;AAAA,EAACC,YAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,WAAA,CAAG,8EAAA,EAAgF,SAAS,CAAA;AAAA,IACtG,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,cAAcD,YAAA,CAAiB,WAAA;AAavC,MAAM,gBAAgB,CAAC;AAAA,EACrB,QAAA;AAAA,EACA,KAAA,GAAQ,iBAAA;AAAA,EACR,WAAA,GAAc,iCAAA;AAAA,EACd,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA,GAAc,KAAA;AAAA,EACd,gBAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0B;AAGxB,EAAA,MAAM,MAAA,GAASF,gBAAA,CAAM,WAAA,CAAY,CAAC,OAAe,MAAA,KAAmB;AAClE,IAAA,MAAM,eAAA,GAAkB,MAAM,WAAA,EAAY;AAC1C,IAAA,MAAM,gBAAA,GAAmB,OAAO,WAAA,EAAY;AAC5C,IAAA,MAAM,cAAc,gBAAA,CAAiB,KA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BAAA,CAAiB,WAAA,GAAcD,aAAiB,SAAA,CAAU,WAAA;AAE1D,MAAM,WAAA,GAAcF,iBAAM,UAAA,CAGxB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA;AAAA,EAACC,YAAA,CAAiB,IAAA;AAAA,EAAjB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,WAAA;AAAA,MACT,8HAAA;AAAA,MACA,4DAAA;AAAA,MACAM,kCAAA,CAAY,MAAA;AAAA,MACZ,qEAAA;AAAA,MACA,0EAAA;AAAA,MACA,8HAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAA,CAAY,WAAA,GAAcP,aAAiB,IAAA,CAAK,WAAA;AAEhD,MAAM,kBAAkB,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,KAA6C;AAC1F,EAAA,uBAAOD,cAAA,CAAC,UAAK,SAAA,EAAWE,WAAA,CAAG,gEAAgE,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACpH;AACA,eAAA,CAAgB,WAAA,GAAc,iBAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"command-DsTBCmQq.cjs","sources":["../src/ds/components/Command/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ds/components/Dialog';\nimport { ScrollArea } from '@/ds/components/ScrollArea';\nimport type { ScrollAreaMask } from '@/ds/components/ScrollArea';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4', className)}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {\n children?: React.ReactNode;\n title?: string;\n description?: string;\n contentClassName?: string;\n commandClassName?: string;\n commandLabel?: string;\n showOverlay?: boolean;\n overlayClassName?: string;\n};\n\nconst CommandDialog = ({\n children,\n title = 'Command Palette',\n description = 'Search for commands and actions',\n contentClassName,\n commandClassName,\n commandLabel,\n showOverlay = false,\n overlayClassName,\n ...props\n}: CommandDialogProps) => {\n // Custom filter that preserves DOM order by returning 1 for all matches\n // This prevents cmdk from reordering items by match score\n const filter = React.useCallback((value: string, search: string) => {\n const normalizedValue = value.toLowerCase();\n const normalizedSearch = search.toLowerCase();\n const searchTerms = normalizedSearch.split(/\\s+/).filter(Boolean);\n\n // All search terms must be found in the value\n const matches = searchTerms.every(term => normalizedValue.includes(term));\n return matches ? 1 : 0;\n }, []);\n\n // Stop propagation to prevent keyboard events from reaching\n // global document-level listeners (e.g., table keyboard nav)\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') return;\n\n e.stopPropagation();\n }, []);\n\n return (\n <Dialog {...props}>\n <DialogContent\n showOverlay={showOverlay}\n overlayClassName={overlayClassName}\n className={cn('overflow-hidden p-0', contentClassName)}\n >\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n label={commandLabel}\n loop\n filter={filter}\n onKeyDown={handleKeyDown}\n className={cn(\n '[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3',\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2',\n '[&_[data-slot=command-input-wrapper]_svg]:size-5',\n '**:[[cmdk-input]]:h-12',\n '**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3',\n '[&_[cmdk-item]_svg]:size-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n rightSlot?: React.ReactNode;\n wrapperClassName?: string;\n};\n\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, CommandInputProps>(\n ({ className, rightSlot, wrapperClassName, ...props }, ref) => (\n <div\n data-slot=\"command-input-wrapper\"\n className={cn('flex items-center border-b border-border1 px-3', transitions.colors, wrapperClassName)}\n >\n <Search className={cn('mr-2 size-4 shrink-0 text-neutral3', transitions.colors)} />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n className,\n )}\n {...props}\n />\n {rightSlot && (\n <div data-slot=\"command-input-right-slot\" className=\"text-neutral3 ml-2 flex shrink-0 items-center\">\n {rightSlot}\n </div>\n )}\n </div>\n ),\n);\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & {\n scrollArea?: boolean;\n scrollAreaClassName?: string;\n scrollAreaViewportClassName?: string;\n scrollAreaMask?: ScrollAreaMask;\n};\n\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, CommandListProps>(\n (\n { className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props },\n ref,\n ) => {\n const list = (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'outline-none focus:outline-none focus-visible:outline-none',\n scrollArea ? 'overflow-visible' : 'max-h-dropdown-max-height overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n\n if (!scrollArea) return list;\n\n return (\n <ScrollArea\n className={cn('min-h-0', scrollAreaClassName)}\n viewPortClassName={scrollAreaViewportClassName}\n mask={scrollAreaMask}\n >\n {list}\n </ScrollArea>\n );\n },\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"text-ui-smd text-neutral3 py-6 text-center\" {...props} />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<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-neutral4',\n '[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border1', className)} {...props} />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<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 cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums', className)} {...props} />;\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["React","jsx","CommandPrimitive","cn","Dialog","jsxs","DialogContent","DialogTitle","DialogDescription","transitions","Search","scrollArea","ScrollArea"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,OAAA,GAAUA,iBAAM,UAAA,CAGpB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA;AAAA,EAACC,YAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,WAAA,CAAG,8EAAA,EAAgF,SAAS,CAAA;AAAA,IACtG,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,cAAcD,YAAA,CAAiB,WAAA;AAavC,MAAM,gBAAgB,CAAC;AAAA,EACrB,QAAA;AAAA,EACA,KAAA,GAAQ,iBAAA;AAAA,EACR,WAAA,GAAc,iCAAA;AAAA,EACd,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA,GAAc,KAAA;AAAA,EACd,gBAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0B;AA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A,GAAmBF,iBAAM,UAAA,CAG7B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA,CAACC,aAAiB,SAAA,EAAjB,EAA2B,KAAU,SAAA,EAAWC,WAAA,CAAG,yBAAyB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CACrG;AACD,gBAAA,CAAiB,WAAA,GAAcD,aAAiB,SAAA,CAAU,WAAA;AAE1D,MAAM,WAAA,GAAcF,iBAAM,UAAA,CAGxB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA;AAAA,EAACC,YAAA,CAAiB,IAAA;AAAA,EAAjB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,WAAA;AAAA,MACT,8HAAA;AAAA,MACA,4DAAA;AAAA,MACAM,kCAAA,CAAY,MAAA;AAAA,MACZ,qEAAA;AAAA,MACA,0EAAA;AAAA,MACA,8HAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAA,CAAY,WAAA,GAAcP,aAAiB,IAAA,CAAK,WAAA;AAEhD,MAAM,kBAAkB,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,KAA6C;AAC1F,EAAA,uBAAOD,cAAA,CAAC,UAAK,SAAA,EAAWE,WAAA,CAAG,gEAAgE,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACpH;AACA,eAAA,CAAgB,WAAA,GAAc,iBAAA;;;;;;;;;;;;"}
|
|
@@ -37,7 +37,7 @@ function ChatShellViewport({ className, children, ...props }) {
|
|
|
37
37
|
className
|
|
38
38
|
),
|
|
39
39
|
...props,
|
|
40
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "chat-shell-track", className: "flex min-h-full min-w-0 flex-col", children })
|
|
40
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "chat-shell-track", className: "relative flex min-h-full min-w-0 flex-col", children })
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
|
@@ -54,6 +54,24 @@ function ChatShellColumn({ className, ...props }) {
|
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
+
function ChatShellTurn({ opensTurn, holdsRoom, restored, className, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
"data-slot": "chat-shell-turn",
|
|
62
|
+
"data-opens-turn": opensTurn ? "true" : void 0,
|
|
63
|
+
"data-holds-room": holdsRoom ? "true" : void 0,
|
|
64
|
+
className: utils_cn.cn(
|
|
65
|
+
"flex flex-col",
|
|
66
|
+
opensTurn && "min-h-0 transition-[min-height] duration-[1500ms] ease-[cubic-bezier(0.3,0,0.2,1)] motion-reduce:transition-none",
|
|
67
|
+
holdsRoom && "min-h-[70cqh] duration-[440ms] ease-[cubic-bezier(0.2,0,0.2,1)] starting:min-h-0",
|
|
68
|
+
holdsRoom && restored && "transition-none",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
57
75
|
function ChatShellDock({ className, ...props }) {
|
|
58
76
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
77
|
"div",
|
|
@@ -93,6 +111,7 @@ const ChatShell = Object.assign(ChatShellRoot, {
|
|
|
93
111
|
Dock: ChatShellDock,
|
|
94
112
|
ScrollButton: ChatShellScrollButton,
|
|
95
113
|
Stage: ChatShellStage,
|
|
114
|
+
Turn: ChatShellTurn,
|
|
96
115
|
Viewport: ChatShellViewport
|
|
97
116
|
});
|
|
98
117
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatShell.cjs.js","sources":["../../src/ds/components/ChatShell/chat-shell.tsx","../../src/ds/components/ChatShell/index.ts"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport {\n MessageScroller,\n MessageScrollerButton,\n MessageScrollerContent,\n MessageScrollerProvider,\n MessageScrollerViewport,\n} from '../MessageScroller';\nimport type {\n MessageScrollerButtonProps,\n MessageScrollerContentProps,\n MessageScrollerProviderProps,\n MessageScrollerViewportProps,\n} from '../MessageScroller';\n\nimport { cn } from '@/lib/utils';\n\nexport type ChatShellProps = ComponentPropsWithoutRef<'div'> & {\n scroller?: Omit<MessageScrollerProviderProps, 'children'>;\n};\n\n/**\n * A chat page frame with exactly one scroll container. Bars sit above it, the\n * composer docks inside it, every region shares one column.\n *\n * Tuned through custom properties, all defaulted here: `--chat-column` (column\n * width), `--chat-surface` (page colour), `--chat-fade` (the band the veil ramps\n * in across, above the composer), `--chat-veil` (strongest it ever gets — the\n * transcript keeps showing through), `--chat-gutter` (room below the composer),\n * `--chat-inset-end` (room an overlay panel claims on the end edge).\n */\nexport function ChatShellRoot({ className, scroller, ...props }: ChatShellProps) {\n return (\n <MessageScrollerProvider {...scroller}>\n <div\n data-slot=\"chat-shell\"\n className={cn(\n '@container relative isolate flex min-h-0 min-w-0 flex-col bg-(--chat-surface)',\n '[--chat-column:48rem] [--chat-fade:1.5rem] [--chat-gutter:0.75rem] [--chat-inset-end:0px]',\n '[--chat-surface:var(--color-surface2)] [--chat-veil:70%]',\n className,\n )}\n {...props}\n />\n </MessageScrollerProvider>\n );\n}\n\n/**\n * Full-width row above the scroller (session header, goal bar). No end inset: the\n * overlay panel it would dodge floats inside the stage, below the bars.\n */\nexport function ChatShellBar({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <div data-slot=\"chat-shell-bar\" className={cn('min-w-0 shrink-0', className)} {...props} />;\n}\n\n/** Positioned region holding the scroller plus anything overlaying it. */\nexport function ChatShellStage({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <MessageScroller className={cn('h-auto min-h-0 flex-1', className)} {...props} />;\n}\n\n/**\n * The one scroll container. It takes the end inset itself — on an ancestor the\n * same room would drag the scrollbar inward, off the true edge.\n */\nexport function ChatShellViewport({ className, children, ...props }: MessageScrollerViewportProps) {\n return (\n <MessageScrollerViewport\n className={cn(\n 'h-auto min-h-0 flex-1 pe-(--chat-inset-end)',\n 'transition-[padding] duration-360 ease-out-custom motion-reduce:transition-none',\n className,\n )}\n {...props}\n >\n {/* Sticky against the scroller itself is clamped to its box, not the\n scrolled height, and strands the dock mid-transcript. */}\n <div data-slot=\"chat-shell-track\" className=\"flex min-h-full min-w-0 flex-col\">\n {children}\n </div>\n </MessageScrollerViewport>\n );\n}\n\n/** Scrolling content. The air above the composer belongs to the dock's fade band. */\nexport function ChatShellContent({ className, ...props }: MessageScrollerContentProps) {\n return <MessageScrollerContent className={cn('flex-1', className)} {...props} />;\n}\n\n/** The shared reading column. Every chat region must go through it. */\nexport function ChatShellColumn({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-column\"\n className={cn('mx-auto flex w-full max-w-(--chat-column) min-w-0 flex-col px-3 md:px-5', className)}\n {...props}\n />\n );\n}\n\n/**\n * Composer region, sticky but left in flow: its own height reserves the room the\n * transcript scrolls behind, so nothing measures it and a composer growing under\n * the cursor resizes no box the scroller watches.\n *\n * Behind it, one sheet of the page masked in over `--chat-fade` of air and never\n * past `--chat-veil`, so the transcript dims as it slides under but stays\n * readable through the card's surroundings. The ramp runs three times the air, so\n * it tops out behind the card and its end never shows.\n */\nexport function ChatShellDock({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-dock\"\n className={cn(\n 'sticky bottom-0 z-10 mt-(--chat-fade) shrink-0 pb-(--chat-gutter)',\n 'before:pointer-events-none before:absolute before:inset-x-0 before:-top-(--chat-fade) before:bottom-0 before:-z-10',\n 'before:bg-(--chat-surface) before:[mask-image:linear-gradient(to_bottom,transparent,rgb(0_0_0/var(--chat-veil))_calc(var(--chat-fade)*3))]',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Jump-to-latest, floating just above the dock. It belongs inside the dock:\n * anywhere else it centres on a box the scrollbar has not narrowed, landing off\n * the composer's axis.\n */\nexport function ChatShellScrollButton({ className, ...props }: MessageScrollerButtonProps) {\n return (\n <div\n data-slot=\"chat-shell-scroll-button\"\n className=\"pointer-events-none absolute inset-x-0 bottom-[calc(100%+0.5rem)] flex\"\n >\n <ChatShellColumn className=\"flex-row justify-center\">\n <MessageScrollerButton\n className={cn('pointer-events-auto static translate-x-0 rtl:translate-x-0', className)}\n {...props}\n />\n </ChatShellColumn>\n </div>\n );\n}\n","import {\n ChatShellBar,\n ChatShellColumn,\n ChatShellContent,\n ChatShellDock,\n ChatShellRoot,\n ChatShellScrollButton,\n ChatShellStage,\n ChatShellViewport,\n} from './chat-shell';\n\nexport type { ChatShellProps } from './chat-shell';\n\nexport const ChatShell = Object.assign(ChatShellRoot, {\n Bar: ChatShellBar,\n Column: ChatShellColumn,\n Content: ChatShellContent,\n Dock: ChatShellDock,\n ScrollButton: ChatShellScrollButton,\n Stage: ChatShellStage,\n Viewport: ChatShellViewport,\n});\n"],"names":["jsx","MessageScrollerProvider","cn","MessageScroller","MessageScrollerViewport","MessageScrollerContent","MessageScrollerButton"],"mappings":";;;;;;;;AAgCO,SAAS,cAAc,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAmB;AAC/E,EAAA,uBACEA,cAAA,CAACC,uCAAA,EAAA,EAAyB,GAAG,QAAA,EAC3B,QAAA,kBAAAD,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,YAAA;AAAA,MACV,SAAA,EAAWE,WAAA;AAAA,QACT,+EAAA;AAAA,QACA,2FAAA;AAAA,QACA,0DAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN,EACF,CAAA;AAEJ;AAMO,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AACrF,EAAA,uBAAOF,cAAA,CAAC,KAAA,EAAA,EAAI,WAAA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,MACV,SAAA,EAAWE,WAAA;AAAA,QACT,mEAAA;AAAA,QACA,oHAAA;AAAA,QACA,4IAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAOO,SAAS,qBAAA,CAAsB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AACzF,EAAA,uBACEF,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,0BAAA;AAAA,MACV,SAAA,EAAU,wEAAA;AAAA,MAEV,QAAA,kBAAAA,cAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAU,yBAAA,EACzB,QAAA,kBAAAA,cAAA;AAAA,QAACM,qCAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAWJ,WAAA,CAAG,4DAAA,EAA8D,SAAS,CAAA;AAAA,UACpF,GAAG;AAAA;AAAA,OACN,EACF;AAAA;AAAA,GACF;AAEJ;;ACpIO,MAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EACpD,GAAA,EAAK,YAAA;AAAA,EACL,MAAA,EAAQ,eAAA;AAAA,EACR,OAAA,EAAS,gBAAA;AAAA,EACT,IAAA,EAAM,aAAA;AAAA,EACN,YAAA,EAAc,qBAAA;AAAA,EACd,KAAA,EAAO,cAAA;AAAA,EACP,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ChatShell.cjs.js","sources":["../../src/ds/components/ChatShell/chat-shell.tsx","../../src/ds/components/ChatShell/index.ts"],"sourcesContent":["import type { ComponentProps, ComponentPropsWithoutRef } from 'react';\n\nimport {\n MessageScroller,\n MessageScrollerButton,\n MessageScrollerContent,\n MessageScrollerProvider,\n MessageScrollerViewport,\n} from '../MessageScroller';\nimport type {\n MessageScrollerButtonProps,\n MessageScrollerContentProps,\n MessageScrollerProviderProps,\n MessageScrollerViewportProps,\n} from '../MessageScroller';\n\nimport { cn } from '@/lib/utils';\n\nexport type ChatShellProps = ComponentPropsWithoutRef<'div'> & {\n scroller?: Omit<MessageScrollerProviderProps, 'children'>;\n};\n\n/**\n * A chat page frame with exactly one scroll container. Bars sit above it, the\n * composer docks inside it, every region shares one column.\n *\n * Tuned through custom properties, all defaulted here: `--chat-column` (column\n * width), `--chat-surface` (page colour), `--chat-fade` (the band the veil ramps\n * in across, above the composer), `--chat-veil` (strongest it ever gets — the\n * transcript keeps showing through), `--chat-gutter` (room below the composer),\n * `--chat-inset-end` (room an overlay panel claims on the end edge).\n */\nexport function ChatShellRoot({ className, scroller, ...props }: ChatShellProps) {\n return (\n <MessageScrollerProvider {...scroller}>\n <div\n data-slot=\"chat-shell\"\n className={cn(\n '@container relative isolate flex min-h-0 min-w-0 flex-col bg-(--chat-surface)',\n '[--chat-column:48rem] [--chat-fade:1.5rem] [--chat-gutter:0.75rem] [--chat-inset-end:0px]',\n '[--chat-surface:var(--color-surface2)] [--chat-veil:70%]',\n className,\n )}\n {...props}\n />\n </MessageScrollerProvider>\n );\n}\n\n/**\n * Full-width row above the scroller (session header, goal bar). No end inset: the\n * overlay panel it would dodge floats inside the stage, below the bars.\n */\nexport function ChatShellBar({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <div data-slot=\"chat-shell-bar\" className={cn('min-w-0 shrink-0', className)} {...props} />;\n}\n\n/** Positioned region holding the scroller plus anything overlaying it. */\nexport function ChatShellStage({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <MessageScroller className={cn('h-auto min-h-0 flex-1', className)} {...props} />;\n}\n\n/**\n * The one scroll container. It takes the end inset itself — on an ancestor the\n * same room would drag the scrollbar inward, off the true edge.\n */\nexport function ChatShellViewport({ className, children, ...props }: MessageScrollerViewportProps) {\n return (\n <MessageScrollerViewport\n className={cn(\n 'h-auto min-h-0 flex-1 pe-(--chat-inset-end)',\n 'transition-[padding] duration-360 ease-out-custom motion-reduce:transition-none',\n className,\n )}\n {...props}\n >\n {/* Sticky against the scroller itself is clamped to its box, not the\n scrolled height, and strands the dock mid-transcript. */}\n <div data-slot=\"chat-shell-track\" className=\"relative flex min-h-full min-w-0 flex-col\">\n {children}\n </div>\n </MessageScrollerViewport>\n );\n}\n\n/** Scrolling content. The air above the composer belongs to the dock's fade band. */\nexport function ChatShellContent({ className, ...props }: MessageScrollerContentProps) {\n return <MessageScrollerContent className={cn('flex-1', className)} {...props} />;\n}\n\n/** The shared reading column. Every chat region must go through it. */\nexport function ChatShellColumn({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-column\"\n className={cn('mx-auto flex w-full max-w-(--chat-column) min-w-0 flex-col px-3 md:px-5', className)}\n {...props}\n />\n );\n}\n\nexport interface ChatShellTurnProps extends ComponentPropsWithoutRef<'div'> {\n /** Opened by a user message: the turn reserves room and releases it through a slow drift. */\n opensTurn?: boolean;\n /** Holds the reply's share of the screen open under the live turn while the run answers. */\n holdsRoom?: boolean;\n /** Restored mid-run: the room is already due, so it opens with no transition. */\n restored?: boolean;\n}\n\n/**\n * One user turn and the reply under it. The room is the answer's share of the\n * screen: the scroller parks the sent message exactly one room above the end of\n * the box, so wherever the composer ends the message rests with this much space\n * under it, and the scroller has nothing to follow until the answer outgrows it.\n * A full screen parked the message against the very top; 70 leaves it breathing.\n * Opening must outrun the scroller's trip; closing is the conversation settling.\n */\nexport function ChatShellTurn({ opensTurn, holdsRoom, restored, className, ...props }: ChatShellTurnProps) {\n return (\n <div\n data-slot=\"chat-shell-turn\"\n data-opens-turn={opensTurn ? 'true' : undefined}\n data-holds-room={holdsRoom ? 'true' : undefined}\n className={cn(\n 'flex flex-col',\n opensTurn &&\n 'min-h-0 transition-[min-height] duration-[1500ms] ease-[cubic-bezier(0.3,0,0.2,1)] motion-reduce:transition-none',\n holdsRoom && 'min-h-[70cqh] duration-[440ms] ease-[cubic-bezier(0.2,0,0.2,1)] starting:min-h-0',\n holdsRoom && restored && 'transition-none',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Composer region, sticky but left in flow: its own height reserves the room the\n * transcript scrolls behind, so nothing measures it and a composer growing under\n * the cursor resizes no box the scroller watches.\n *\n * Behind it, one sheet of the page masked in over `--chat-fade` of air and never\n * past `--chat-veil`, so the transcript dims as it slides under but stays\n * readable through the card's surroundings. The ramp runs three times the air, so\n * it tops out behind the card and its end never shows.\n */\nexport function ChatShellDock({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-dock\"\n className={cn(\n 'sticky bottom-0 z-10 mt-(--chat-fade) shrink-0 pb-(--chat-gutter)',\n 'before:pointer-events-none before:absolute before:inset-x-0 before:-top-(--chat-fade) before:bottom-0 before:-z-10',\n 'before:bg-(--chat-surface) before:[mask-image:linear-gradient(to_bottom,transparent,rgb(0_0_0/var(--chat-veil))_calc(var(--chat-fade)*3))]',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Jump-to-latest, floating just above the dock. It belongs inside the dock:\n * anywhere else it centres on a box the scrollbar has not narrowed, landing off\n * the composer's axis.\n */\nexport function ChatShellScrollButton({ className, ...props }: MessageScrollerButtonProps) {\n return (\n <div\n data-slot=\"chat-shell-scroll-button\"\n className=\"pointer-events-none absolute inset-x-0 bottom-[calc(100%+0.5rem)] flex\"\n >\n <ChatShellColumn className=\"flex-row justify-center\">\n <MessageScrollerButton\n className={cn('pointer-events-auto static translate-x-0 rtl:translate-x-0', className)}\n {...props}\n />\n </ChatShellColumn>\n </div>\n );\n}\n","import {\n ChatShellBar,\n ChatShellColumn,\n ChatShellContent,\n ChatShellDock,\n ChatShellRoot,\n ChatShellScrollButton,\n ChatShellStage,\n ChatShellTurn,\n ChatShellViewport,\n} from './chat-shell';\n\nexport type { ChatShellProps, ChatShellTurnProps } from './chat-shell';\n\nexport const ChatShell = Object.assign(ChatShellRoot, {\n Bar: ChatShellBar,\n Column: ChatShellColumn,\n Content: ChatShellContent,\n Dock: ChatShellDock,\n ScrollButton: ChatShellScrollButton,\n Stage: ChatShellStage,\n Turn: ChatShellTurn,\n Viewport: ChatShellViewport,\n});\n"],"names":["jsx","MessageScrollerProvider","cn","MessageScroller","MessageScrollerViewport","MessageScrollerContent","MessageScrollerButton"],"mappings":";;;;;;;;AAgCO,SAAS,cAAc,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAmB;AAC/E,EAAA,uBACEA,cAAA,CAACC,uCAAA,EAAA,EAAyB,GAAG,QAAA,EAC3B,QAAA,kBAAAD,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,YAAA;AAAA,MACV,SAAA,EAAWE,WAAA;AAAA,QACT,+EAAA;AAAA,QACA,2FAAA;AAAA,QACA,0DAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN,EACF,CAAA;AAEJ;AAMO,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AACrF,EAAA,uBAAOF,cAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,gBAAA,EAAiB,SAAA,EAAWE,YAAG,kBAAA,EAAoB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClG;AAGO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AACvF,EAAA,uBAAOF,cAAA,CAACG,mCAAgB,SAAA,EAAWD,WAAA,CAAG,yBAAyB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACxF;AAMO,SAAS,kBAAkB,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAiC;AACjG,EAAA,uBACEF,cAAA;AAAA,IAACI,uCAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAWF,WAAA;AAAA,QACT,6CAAA;AAAA,QACA,iFAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAIJ,yCAAC,KAAA,EAAA,EAAI,WAAA,EAAU,kBAAA,EAAmB,SAAA,EAAU,6CACzC,QAAA,E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GACN;AAEJ;AAOO,SAAS,qBAAA,CAAsB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AACzF,EAAA,uBACEF,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,0BAAA;AAAA,MACV,SAAA,EAAU,wEAAA;AAAA,MAEV,QAAA,kBAAAA,cAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAU,yBAAA,EACzB,QAAA,kBAAAA,cAAA;AAAA,QAACM,qCAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAWJ,WAAA,CAAG,4DAAA,EAA8D,SAAS,CAAA;AAAA,UACpF,GAAG;AAAA;AAAA,OACN,EACF;AAAA;AAAA,GACF;AAEJ;;ACvKO,MAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EACpD,GAAA,EAAK,YAAA;AAAA,EACL,MAAA,EAAQ,eAAA;AAAA,EACR,OAAA,EAAS,gBAAA;AAAA,EACT,IAAA,EAAM,aAAA;AAAA,EACN,YAAA,EAAc,qBAAA;AAAA,EACd,KAAA,EAAO,cAAA;AAAA,EACP,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -33,7 +33,7 @@ function ChatShellViewport({ className, children, ...props }) {
|
|
|
33
33
|
className
|
|
34
34
|
),
|
|
35
35
|
...props,
|
|
36
|
-
children: /* @__PURE__ */ jsx("div", { "data-slot": "chat-shell-track", className: "flex min-h-full min-w-0 flex-col", children })
|
|
36
|
+
children: /* @__PURE__ */ jsx("div", { "data-slot": "chat-shell-track", className: "relative flex min-h-full min-w-0 flex-col", children })
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
}
|
|
@@ -50,6 +50,24 @@ function ChatShellColumn({ className, ...props }) {
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
+
function ChatShellTurn({ opensTurn, holdsRoom, restored, className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "chat-shell-turn",
|
|
58
|
+
"data-opens-turn": opensTurn ? "true" : void 0,
|
|
59
|
+
"data-holds-room": holdsRoom ? "true" : void 0,
|
|
60
|
+
className: cn(
|
|
61
|
+
"flex flex-col",
|
|
62
|
+
opensTurn && "min-h-0 transition-[min-height] duration-[1500ms] ease-[cubic-bezier(0.3,0,0.2,1)] motion-reduce:transition-none",
|
|
63
|
+
holdsRoom && "min-h-[70cqh] duration-[440ms] ease-[cubic-bezier(0.2,0,0.2,1)] starting:min-h-0",
|
|
64
|
+
holdsRoom && restored && "transition-none",
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
53
71
|
function ChatShellDock({ className, ...props }) {
|
|
54
72
|
return /* @__PURE__ */ jsx(
|
|
55
73
|
"div",
|
|
@@ -89,6 +107,7 @@ const ChatShell = Object.assign(ChatShellRoot, {
|
|
|
89
107
|
Dock: ChatShellDock,
|
|
90
108
|
ScrollButton: ChatShellScrollButton,
|
|
91
109
|
Stage: ChatShellStage,
|
|
110
|
+
Turn: ChatShellTurn,
|
|
92
111
|
Viewport: ChatShellViewport
|
|
93
112
|
});
|
|
94
113
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatShell.es.js","sources":["../../src/ds/components/ChatShell/chat-shell.tsx","../../src/ds/components/ChatShell/index.ts"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport {\n MessageScroller,\n MessageScrollerButton,\n MessageScrollerContent,\n MessageScrollerProvider,\n MessageScrollerViewport,\n} from '../MessageScroller';\nimport type {\n MessageScrollerButtonProps,\n MessageScrollerContentProps,\n MessageScrollerProviderProps,\n MessageScrollerViewportProps,\n} from '../MessageScroller';\n\nimport { cn } from '@/lib/utils';\n\nexport type ChatShellProps = ComponentPropsWithoutRef<'div'> & {\n scroller?: Omit<MessageScrollerProviderProps, 'children'>;\n};\n\n/**\n * A chat page frame with exactly one scroll container. Bars sit above it, the\n * composer docks inside it, every region shares one column.\n *\n * Tuned through custom properties, all defaulted here: `--chat-column` (column\n * width), `--chat-surface` (page colour), `--chat-fade` (the band the veil ramps\n * in across, above the composer), `--chat-veil` (strongest it ever gets — the\n * transcript keeps showing through), `--chat-gutter` (room below the composer),\n * `--chat-inset-end` (room an overlay panel claims on the end edge).\n */\nexport function ChatShellRoot({ className, scroller, ...props }: ChatShellProps) {\n return (\n <MessageScrollerProvider {...scroller}>\n <div\n data-slot=\"chat-shell\"\n className={cn(\n '@container relative isolate flex min-h-0 min-w-0 flex-col bg-(--chat-surface)',\n '[--chat-column:48rem] [--chat-fade:1.5rem] [--chat-gutter:0.75rem] [--chat-inset-end:0px]',\n '[--chat-surface:var(--color-surface2)] [--chat-veil:70%]',\n className,\n )}\n {...props}\n />\n </MessageScrollerProvider>\n );\n}\n\n/**\n * Full-width row above the scroller (session header, goal bar). No end inset: the\n * overlay panel it would dodge floats inside the stage, below the bars.\n */\nexport function ChatShellBar({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <div data-slot=\"chat-shell-bar\" className={cn('min-w-0 shrink-0', className)} {...props} />;\n}\n\n/** Positioned region holding the scroller plus anything overlaying it. */\nexport function ChatShellStage({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <MessageScroller className={cn('h-auto min-h-0 flex-1', className)} {...props} />;\n}\n\n/**\n * The one scroll container. It takes the end inset itself — on an ancestor the\n * same room would drag the scrollbar inward, off the true edge.\n */\nexport function ChatShellViewport({ className, children, ...props }: MessageScrollerViewportProps) {\n return (\n <MessageScrollerViewport\n className={cn(\n 'h-auto min-h-0 flex-1 pe-(--chat-inset-end)',\n 'transition-[padding] duration-360 ease-out-custom motion-reduce:transition-none',\n className,\n )}\n {...props}\n >\n {/* Sticky against the scroller itself is clamped to its box, not the\n scrolled height, and strands the dock mid-transcript. */}\n <div data-slot=\"chat-shell-track\" className=\"flex min-h-full min-w-0 flex-col\">\n {children}\n </div>\n </MessageScrollerViewport>\n );\n}\n\n/** Scrolling content. The air above the composer belongs to the dock's fade band. */\nexport function ChatShellContent({ className, ...props }: MessageScrollerContentProps) {\n return <MessageScrollerContent className={cn('flex-1', className)} {...props} />;\n}\n\n/** The shared reading column. Every chat region must go through it. */\nexport function ChatShellColumn({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-column\"\n className={cn('mx-auto flex w-full max-w-(--chat-column) min-w-0 flex-col px-3 md:px-5', className)}\n {...props}\n />\n );\n}\n\n/**\n * Composer region, sticky but left in flow: its own height reserves the room the\n * transcript scrolls behind, so nothing measures it and a composer growing under\n * the cursor resizes no box the scroller watches.\n *\n * Behind it, one sheet of the page masked in over `--chat-fade` of air and never\n * past `--chat-veil`, so the transcript dims as it slides under but stays\n * readable through the card's surroundings. The ramp runs three times the air, so\n * it tops out behind the card and its end never shows.\n */\nexport function ChatShellDock({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-dock\"\n className={cn(\n 'sticky bottom-0 z-10 mt-(--chat-fade) shrink-0 pb-(--chat-gutter)',\n 'before:pointer-events-none before:absolute before:inset-x-0 before:-top-(--chat-fade) before:bottom-0 before:-z-10',\n 'before:bg-(--chat-surface) before:[mask-image:linear-gradient(to_bottom,transparent,rgb(0_0_0/var(--chat-veil))_calc(var(--chat-fade)*3))]',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Jump-to-latest, floating just above the dock. It belongs inside the dock:\n * anywhere else it centres on a box the scrollbar has not narrowed, landing off\n * the composer's axis.\n */\nexport function ChatShellScrollButton({ className, ...props }: MessageScrollerButtonProps) {\n return (\n <div\n data-slot=\"chat-shell-scroll-button\"\n className=\"pointer-events-none absolute inset-x-0 bottom-[calc(100%+0.5rem)] flex\"\n >\n <ChatShellColumn className=\"flex-row justify-center\">\n <MessageScrollerButton\n className={cn('pointer-events-auto static translate-x-0 rtl:translate-x-0', className)}\n {...props}\n />\n </ChatShellColumn>\n </div>\n );\n}\n","import {\n ChatShellBar,\n ChatShellColumn,\n ChatShellContent,\n ChatShellDock,\n ChatShellRoot,\n ChatShellScrollButton,\n ChatShellStage,\n ChatShellViewport,\n} from './chat-shell';\n\nexport type { ChatShellProps } from './chat-shell';\n\nexport const ChatShell = Object.assign(ChatShellRoot, {\n Bar: ChatShellBar,\n Column: ChatShellColumn,\n Content: ChatShellContent,\n Dock: ChatShellDock,\n ScrollButton: ChatShellScrollButton,\n Stage: ChatShellStage,\n Viewport: ChatShellViewport,\n});\n"],"names":[],"mappings":";;;;AAgCO,SAAS,cAAc,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAmB;AAC/E,EAAA,uBACE,GAAA,CAAC,uBAAA,EAAA,EAAyB,GAAG,QAAA,EAC3B,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,YAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,+EAAA;AAAA,QACA,2FAAA;AAAA,QACA,0DAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN,EACF,CAAA;AAEJ;AAMO,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AACrF,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,gBAAA,EAAiB,SAAA,EAAW,GAAG,kBAAA,EAAoB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClG;AAGO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AACvF,EAAA,uBAAO,GAAA,CAAC,mBAAgB,SAAA,EAAW,EAAA,CAAG,yBAAyB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACxF;AAMO,SAAS,kBAAkB,EAAE,SAAA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EV,QAAA,kBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAU,yBAAA,EACzB,QAAA,kBAAA,GAAA;AAAA,QAAC,qBAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,EAAA,CAAG,4DAAA,EAA8D,SAAS,CAAA;AAAA,UACpF,GAAG;AAAA;AAAA,OACN,EACF;AAAA;AAAA,GACF;AAEJ;;ACpIO,MAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EACpD,GAAA,EAAK,YAAA;AAAA,EACL,MAAA,EAAQ,eAAA;AAAA,EACR,OAAA,EAAS,gBAAA;AAAA,EACT,IAAA,EAAM,aAAA;AAAA,EACN,YAAA,EAAc,qBAAA;AAAA,EACd,KAAA,EAAO,cAAA;AAAA,EACP,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ChatShell.es.js","sources":["../../src/ds/components/ChatShell/chat-shell.tsx","../../src/ds/components/ChatShell/index.ts"],"sourcesContent":["import type { ComponentProps, ComponentPropsWithoutRef } from 'react';\n\nimport {\n MessageScroller,\n MessageScrollerButton,\n MessageScrollerContent,\n MessageScrollerProvider,\n MessageScrollerViewport,\n} from '../MessageScroller';\nimport type {\n MessageScrollerButtonProps,\n MessageScrollerContentProps,\n MessageScrollerProviderProps,\n MessageScrollerViewportProps,\n} from '../MessageScroller';\n\nimport { cn } from '@/lib/utils';\n\nexport type ChatShellProps = ComponentPropsWithoutRef<'div'> & {\n scroller?: Omit<MessageScrollerProviderProps, 'children'>;\n};\n\n/**\n * A chat page frame with exactly one scroll container. Bars sit above it, the\n * composer docks inside it, every region shares one column.\n *\n * Tuned through custom properties, all defaulted here: `--chat-column` (column\n * width), `--chat-surface` (page colour), `--chat-fade` (the band the veil ramps\n * in across, above the composer), `--chat-veil` (strongest it ever gets — the\n * transcript keeps showing through), `--chat-gutter` (room below the composer),\n * `--chat-inset-end` (room an overlay panel claims on the end edge).\n */\nexport function ChatShellRoot({ className, scroller, ...props }: ChatShellProps) {\n return (\n <MessageScrollerProvider {...scroller}>\n <div\n data-slot=\"chat-shell\"\n className={cn(\n '@container relative isolate flex min-h-0 min-w-0 flex-col bg-(--chat-surface)',\n '[--chat-column:48rem] [--chat-fade:1.5rem] [--chat-gutter:0.75rem] [--chat-inset-end:0px]',\n '[--chat-surface:var(--color-surface2)] [--chat-veil:70%]',\n className,\n )}\n {...props}\n />\n </MessageScrollerProvider>\n );\n}\n\n/**\n * Full-width row above the scroller (session header, goal bar). No end inset: the\n * overlay panel it would dodge floats inside the stage, below the bars.\n */\nexport function ChatShellBar({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <div data-slot=\"chat-shell-bar\" className={cn('min-w-0 shrink-0', className)} {...props} />;\n}\n\n/** Positioned region holding the scroller plus anything overlaying it. */\nexport function ChatShellStage({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return <MessageScroller className={cn('h-auto min-h-0 flex-1', className)} {...props} />;\n}\n\n/**\n * The one scroll container. It takes the end inset itself — on an ancestor the\n * same room would drag the scrollbar inward, off the true edge.\n */\nexport function ChatShellViewport({ className, children, ...props }: MessageScrollerViewportProps) {\n return (\n <MessageScrollerViewport\n className={cn(\n 'h-auto min-h-0 flex-1 pe-(--chat-inset-end)',\n 'transition-[padding] duration-360 ease-out-custom motion-reduce:transition-none',\n className,\n )}\n {...props}\n >\n {/* Sticky against the scroller itself is clamped to its box, not the\n scrolled height, and strands the dock mid-transcript. */}\n <div data-slot=\"chat-shell-track\" className=\"relative flex min-h-full min-w-0 flex-col\">\n {children}\n </div>\n </MessageScrollerViewport>\n );\n}\n\n/** Scrolling content. The air above the composer belongs to the dock's fade band. */\nexport function ChatShellContent({ className, ...props }: MessageScrollerContentProps) {\n return <MessageScrollerContent className={cn('flex-1', className)} {...props} />;\n}\n\n/** The shared reading column. Every chat region must go through it. */\nexport function ChatShellColumn({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-column\"\n className={cn('mx-auto flex w-full max-w-(--chat-column) min-w-0 flex-col px-3 md:px-5', className)}\n {...props}\n />\n );\n}\n\nexport interface ChatShellTurnProps extends ComponentPropsWithoutRef<'div'> {\n /** Opened by a user message: the turn reserves room and releases it through a slow drift. */\n opensTurn?: boolean;\n /** Holds the reply's share of the screen open under the live turn while the run answers. */\n holdsRoom?: boolean;\n /** Restored mid-run: the room is already due, so it opens with no transition. */\n restored?: boolean;\n}\n\n/**\n * One user turn and the reply under it. The room is the answer's share of the\n * screen: the scroller parks the sent message exactly one room above the end of\n * the box, so wherever the composer ends the message rests with this much space\n * under it, and the scroller has nothing to follow until the answer outgrows it.\n * A full screen parked the message against the very top; 70 leaves it breathing.\n * Opening must outrun the scroller's trip; closing is the conversation settling.\n */\nexport function ChatShellTurn({ opensTurn, holdsRoom, restored, className, ...props }: ChatShellTurnProps) {\n return (\n <div\n data-slot=\"chat-shell-turn\"\n data-opens-turn={opensTurn ? 'true' : undefined}\n data-holds-room={holdsRoom ? 'true' : undefined}\n className={cn(\n 'flex flex-col',\n opensTurn &&\n 'min-h-0 transition-[min-height] duration-[1500ms] ease-[cubic-bezier(0.3,0,0.2,1)] motion-reduce:transition-none',\n holdsRoom && 'min-h-[70cqh] duration-[440ms] ease-[cubic-bezier(0.2,0,0.2,1)] starting:min-h-0',\n holdsRoom && restored && 'transition-none',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Composer region, sticky but left in flow: its own height reserves the room the\n * transcript scrolls behind, so nothing measures it and a composer growing under\n * the cursor resizes no box the scroller watches.\n *\n * Behind it, one sheet of the page masked in over `--chat-fade` of air and never\n * past `--chat-veil`, so the transcript dims as it slides under but stays\n * readable through the card's surroundings. The ramp runs three times the air, so\n * it tops out behind the card and its end never shows.\n */\nexport function ChatShellDock({ className, ...props }: ComponentPropsWithoutRef<'div'>) {\n return (\n <div\n data-slot=\"chat-shell-dock\"\n className={cn(\n 'sticky bottom-0 z-10 mt-(--chat-fade) shrink-0 pb-(--chat-gutter)',\n 'before:pointer-events-none before:absolute before:inset-x-0 before:-top-(--chat-fade) before:bottom-0 before:-z-10',\n 'before:bg-(--chat-surface) before:[mask-image:linear-gradient(to_bottom,transparent,rgb(0_0_0/var(--chat-veil))_calc(var(--chat-fade)*3))]',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Jump-to-latest, floating just above the dock. It belongs inside the dock:\n * anywhere else it centres on a box the scrollbar has not narrowed, landing off\n * the composer's axis.\n */\nexport function ChatShellScrollButton({ className, ...props }: MessageScrollerButtonProps) {\n return (\n <div\n data-slot=\"chat-shell-scroll-button\"\n className=\"pointer-events-none absolute inset-x-0 bottom-[calc(100%+0.5rem)] flex\"\n >\n <ChatShellColumn className=\"flex-row justify-center\">\n <MessageScrollerButton\n className={cn('pointer-events-auto static translate-x-0 rtl:translate-x-0', className)}\n {...props}\n />\n </ChatShellColumn>\n </div>\n );\n}\n","import {\n ChatShellBar,\n ChatShellColumn,\n ChatShellContent,\n ChatShellDock,\n ChatShellRoot,\n ChatShellScrollButton,\n ChatShellStage,\n ChatShellTurn,\n ChatShellViewport,\n} from './chat-shell';\n\nexport type { ChatShellProps, ChatShellTurnProps } from './chat-shell';\n\nexport const ChatShell = Object.assign(ChatShellRoot, {\n Bar: ChatShellBar,\n Column: ChatShellColumn,\n Content: ChatShellContent,\n Dock: ChatShellDock,\n ScrollButton: ChatShellScrollButton,\n Stage: ChatShellStage,\n Turn: ChatShellTurn,\n Viewport: ChatShellViewport,\n});\n"],"names":[],"mappings":";;;;AAgCO,SAAS,cAAc,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAmB;AAC/E,EAAA,uBACE,GAAA,CAAC,uBAAA,EAAA,EAAyB,GAAG,QAAA,EAC3B,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,YAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,+EAAA;AAAA,QACA,2FAAA;AAAA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AAAA,GACF;AAEJ;;ACvKO,MAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EACpD,GAAA,EAAK,YAAA;AAAA,EACL,MAAA,EAAQ,eAAA;AAAA,EACR,OAAA,EAAS,gBAAA;AAAA,EACT,IAAA,EAAM,aAAA;AAAA,EACN,YAAA,EAAc,qBAAA;AAAA,EACd,KAAA,EAAO,cAAA;AAAA,EACP,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const code = require('../code-
|
|
5
|
+
const code = require('../code-DhrdtZce.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
exports.Code = code.Code;
|
|
10
|
+
exports.tokenStyle = code.tokenStyle;
|
|
11
|
+
exports.useHighlight = code.useHighlight;
|
|
10
12
|
//# sourceMappingURL=Code.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Code.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as Code } from '../code-
|
|
1
|
+
export { C as Code, t as tokenStyle, u as useHighlight } from '../code-D4Vw_fYq.js';
|
|
2
2
|
//# sourceMappingURL=Code.es.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CodeBlock } from '../code-block-
|
|
1
|
+
export { C as CodeBlock } from '../code-block-DeksY23p.js';
|
|
2
2
|
//# sourceMappingURL=CodeBlock.es.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CodeDiff } from '../code-diff-
|
|
1
|
+
export { C as CodeDiff } from '../code-diff-CIRbnIfl.js';
|
|
2
2
|
//# sourceMappingURL=CodeDiff.es.js.map
|
|
@@ -17,7 +17,7 @@ const autocomplete = require('@codemirror/autocomplete');
|
|
|
17
17
|
const copyButton = require('../copy-button-BtnbaMvl.cjs');
|
|
18
18
|
const themeProvider = require('../theme-provider-aO5-jZVp.cjs');
|
|
19
19
|
const utils_cn = require('../cn-DCPcv4xv.cjs');
|
|
20
|
-
const highlight = require('../highlight-
|
|
20
|
+
const highlight = require('../highlight-DK1dn-Fh.cjs');
|
|
21
21
|
|
|
22
22
|
function legacy(parser) {
|
|
23
23
|
return new language.LanguageSupport(language.StreamLanguage.define(parser));
|
|
@@ -480,6 +480,7 @@ const CodeEditor = React.forwardRef(
|
|
|
480
480
|
);
|
|
481
481
|
|
|
482
482
|
exports.highlight = highlight.highlight;
|
|
483
|
+
exports.languageForPath = highlight.languageForPath;
|
|
483
484
|
exports.CodeEditor = CodeEditor;
|
|
484
485
|
exports.VARIABLE_PATTERN = VARIABLE_PATTERN;
|
|
485
486
|
exports.codeLanguages = codeLanguages;
|