@mastra/playground-ui 72.0.0-alpha.0 → 72.0.0-alpha.2
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/{combobox-Db8NtklU.js → combobox-BCB51kuy.js} +58 -12
- package/dist/combobox-BCB51kuy.js.map +1 -0
- package/dist/{combobox-Cg-KVjdt.cjs → combobox-CtEvUaJc.cjs} +58 -12
- package/dist/combobox-CtEvUaJc.cjs.map +1 -0
- package/dist/components/Combobox.cjs.js +1 -1
- package/dist/components/Combobox.es.js +1 -1
- package/dist/components/DataList.cjs.js +1 -1
- package/dist/components/DataList.es.js +1 -1
- package/dist/components/PropertyFilter.cjs.js +1 -1
- package/dist/components/PropertyFilter.es.js +1 -1
- package/dist/domains/agents/agent-combobox.cjs.js +1 -1
- package/dist/domains/agents/agent-combobox.es.js +1 -1
- package/dist/domains/chat/tools/connect-prompt-tool.cjs.js +112 -76
- package/dist/domains/chat/tools/connect-prompt-tool.cjs.js.map +1 -1
- package/dist/domains/chat/tools/connect-prompt-tool.es.js +113 -77
- package/dist/domains/chat/tools/connect-prompt-tool.es.js.map +1 -1
- package/dist/domains/connect/use-user-connect.cjs.js +1 -0
- package/dist/domains/connect/use-user-connect.cjs.js.map +1 -1
- package/dist/domains/connect/use-user-connect.es.js +1 -0
- package/dist/domains/connect/use-user-connect.es.js.map +1 -1
- package/dist/domains/datasets/components/dataset-combobox.cjs.js +1 -1
- package/dist/domains/datasets/components/dataset-combobox.es.js +1 -1
- package/dist/domains/datasets/components/dataset-detail/dataset-tags-editor.cjs.js +1 -1
- package/dist/domains/datasets/components/dataset-detail/dataset-tags-editor.es.js +1 -1
- package/dist/domains/datasets/components/dataset-versions.cjs.js +1 -1
- package/dist/domains/datasets/components/dataset-versions.es.js +1 -1
- package/dist/domains/datasets/components/experiment-trigger/scorer-selector.cjs.js +1 -1
- package/dist/domains/datasets/components/experiment-trigger/scorer-selector.es.js +1 -1
- package/dist/domains/experiments/components/experiment-results-tag-picker.cjs.js +1 -1
- package/dist/domains/experiments/components/experiment-results-tag-picker.es.js +1 -1
- package/dist/domains/prompt-blocks/prompt-block-version-combobox.cjs.js +1 -1
- package/dist/domains/prompt-blocks/prompt-block-version-combobox.es.js +1 -1
- package/dist/domains/scores/components/span-scoring.cjs.js +1 -1
- package/dist/domains/scores/components/span-scoring.es.js +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/workflows/components/workflow-combobox.cjs.js +1 -1
- package/dist/domains/workflows/components/workflow-combobox.es.js +1 -1
- package/dist/layout/tabbed-container.cjs.js +1 -1
- package/dist/layout/tabbed-container.es.js +1 -1
- package/dist/{tabbed-container-DiHt3VX3.js → tabbed-container-CRPiA3RI.js} +2 -2
- package/dist/{tabbed-container-DiHt3VX3.js.map → tabbed-container-CRPiA3RI.js.map} +1 -1
- package/dist/{tabbed-container-DbgPRklc.cjs → tabbed-container-DLntsyso.cjs} +2 -2
- package/dist/{tabbed-container-DbgPRklc.cjs.map → tabbed-container-DLntsyso.cjs.map} +1 -1
- package/package.json +7 -7
- package/dist/combobox-Cg-KVjdt.cjs.map +0 -1
- package/dist/combobox-Db8NtklU.js.map +0 -1
|
@@ -31,9 +31,13 @@ function getComboboxShape({ inFieldContext, multiple, variant, size, iconOnlyVal
|
|
|
31
31
|
if (size !== "md") return "trigger";
|
|
32
32
|
return "chips";
|
|
33
33
|
}
|
|
34
|
+
/** The value typed text stands for. The custom option and the value match in the filter both read it this way. */
|
|
35
|
+
function typedValue(inputValue) {
|
|
36
|
+
return inputValue.trim();
|
|
37
|
+
}
|
|
34
38
|
/** A "Use “text”" option for typed text that isn't one of the options yet. */
|
|
35
39
|
function getCustomOption(options, inputValue) {
|
|
36
|
-
const value = inputValue
|
|
40
|
+
const value = typedValue(inputValue);
|
|
37
41
|
if (!value) return void 0;
|
|
38
42
|
if (options.some((option) => option.value === value || optionText(option) === value)) return void 0;
|
|
39
43
|
return {
|
|
@@ -41,10 +45,37 @@ function getCustomOption(options, inputValue) {
|
|
|
41
45
|
value
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Selected values that no option lists (typed ones, or ones the caller's options no longer include), in the
|
|
50
|
+
* order given. Each shows its bare value, on its chip and in the popup.
|
|
51
|
+
*/
|
|
52
|
+
function getUnlistedOptions(options, values) {
|
|
53
|
+
const listedValues = new Set(options.map((option) => option.value));
|
|
54
|
+
return [...new Set(values)].filter((value) => !listedValues.has(value)).map((value) => ({
|
|
55
|
+
label: value,
|
|
56
|
+
value
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The selected values as options: listed ones in `options` order, then the unlisted ones. `onValueChange`
|
|
61
|
+
* reports the values in this order too, with a new pick appended.
|
|
62
|
+
*/
|
|
63
|
+
function getSelectedOptions(options, values, unlistedOptions) {
|
|
64
|
+
const selectedValues = new Set(values);
|
|
65
|
+
return [...options.filter((option) => selectedValues.has(option.value)), ...unlistedOptions];
|
|
66
|
+
}
|
|
67
|
+
/** Matches options by value, because Base UI compares by reference and unlisted selections are rebuilt on every render. */
|
|
68
|
+
function isSameOption(item, selected) {
|
|
69
|
+
return item.value === selected.value;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Matches the label like Base UI's default filter, the text a field shows, and any keywords. With
|
|
73
|
+
* `matchValue`, an option whose value is exactly the typed value matches too: `getCustomOption` holds back
|
|
74
|
+
* typed text that is an existing value, so without this, typing a value whose label differs shows nothing.
|
|
75
|
+
*/
|
|
76
|
+
function useOptionFilter({ matchValue }) {
|
|
46
77
|
const { contains } = Combobox.useFilter();
|
|
47
|
-
return (option, query) => [
|
|
78
|
+
return (option, query) => matchValue && option.value === typedValue(query) || [
|
|
48
79
|
option.label,
|
|
49
80
|
optionText(option),
|
|
50
81
|
...option.keywords ?? []
|
|
@@ -163,7 +194,7 @@ function MultipleComboboxControl({ shape, controlProps, placeholder, selectedCou
|
|
|
163
194
|
}
|
|
164
195
|
function SingleCombobox({ shape, controlProps, options, value, onValueChange, placeholder = "Select option", searchPlaceholder = "Search", emptyText = "No option found.", className, disabled = false, variant = "default", size = "md", open, onOpenChange, container, align = "start", popupWidth, showChevron = true, iconOnlyValue = false, allowCustomValue = false, onInputValueChange }) {
|
|
165
196
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
166
|
-
const filter = useOptionFilter();
|
|
197
|
+
const filter = useOptionFilter({ matchValue: allowCustomValue });
|
|
167
198
|
const inField = shape === "field";
|
|
168
199
|
const selectedOption = options.find((option) => option.value === value);
|
|
169
200
|
const customOption = allowCustomValue ? getCustomOption(options, inputValue) : void 0;
|
|
@@ -211,10 +242,23 @@ function SingleCombobox({ shape, controlProps, options, value, onValueChange, pl
|
|
|
211
242
|
})]
|
|
212
243
|
});
|
|
213
244
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
245
|
+
/**
|
|
246
|
+
* A multiple select: picks show as chips (or a count on a compact trigger) and stay listed, checked, in the popup.
|
|
247
|
+
* With `allowCustomValue` the typed text can be picked as a new value.
|
|
248
|
+
*/
|
|
249
|
+
function MultipleCombobox({ shape, controlProps, options, value = EMPTY_VALUES, onValueChange, clearLabel, placeholder = "Select options", searchPlaceholder = "Search", emptyText = "No option found.", className, disabled = false, variant = "default", size = "md", open, onOpenChange, container, align = "start", popupWidth, showChevron = true, iconOnlyValue = false, allowCustomValue = false, onInputValueChange }) {
|
|
250
|
+
const [inputValue, setInputValue] = React$1.useState("");
|
|
251
|
+
const filter = useOptionFilter({ matchValue: allowCustomValue });
|
|
252
|
+
const unlistedOptions = getUnlistedOptions(options, value);
|
|
253
|
+
const selectedOptions = getSelectedOptions(options, value, unlistedOptions);
|
|
254
|
+
const customOption = allowCustomValue ? getCustomOption([...options, ...unlistedOptions], inputValue) : void 0;
|
|
255
|
+
const extraItems = customOption ? [...unlistedOptions, customOption] : unlistedOptions;
|
|
256
|
+
const items = extraItems.length > 0 ? [...options, ...extraItems] : options;
|
|
257
|
+
/** Keeps the mirrored search text in step with Base UI, which also clears it after each pick. */
|
|
258
|
+
function handleInputValueChange(next) {
|
|
259
|
+
setInputValue(next);
|
|
260
|
+
onInputValueChange?.(next);
|
|
261
|
+
}
|
|
218
262
|
const footer = clearLabel && selectedOptions.length > 0 ? /* @__PURE__ */ jsx(ComboboxClearFooter, {
|
|
219
263
|
label: clearLabel,
|
|
220
264
|
onClear: () => onValueChange?.([])
|
|
@@ -222,10 +266,12 @@ function MultipleCombobox({ shape, controlProps, options, value = EMPTY_VALUES,
|
|
|
222
266
|
return /* @__PURE__ */ jsxs(ComboboxRoot, {
|
|
223
267
|
multiple: true,
|
|
224
268
|
autoHighlight: true,
|
|
225
|
-
items
|
|
269
|
+
items,
|
|
226
270
|
filter,
|
|
227
271
|
value: selectedOptions,
|
|
228
|
-
|
|
272
|
+
isItemEqualToValue: isSameOption,
|
|
273
|
+
onInputValueChange: handleInputValueChange,
|
|
274
|
+
onValueChange: (picked) => onValueChange?.(picked.map((item) => item.value)),
|
|
229
275
|
disabled,
|
|
230
276
|
open,
|
|
231
277
|
onOpenChange,
|
|
@@ -303,4 +349,4 @@ function Combobox$1(props) {
|
|
|
303
349
|
}
|
|
304
350
|
export { Combobox$1 as t };
|
|
305
351
|
|
|
306
|
-
//# sourceMappingURL=combobox-
|
|
352
|
+
//# sourceMappingURL=combobox-BCB51kuy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-BCB51kuy.js","names":["BaseCombobox","_Fragment","React","Combobox"],"sources":["../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport * as React from 'react';\nimport {\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxRoot,\n ComboboxSearch,\n ComboboxTrigger,\n ComboboxValue,\n} from './combobox-parts';\nimport { comboboxPopupWidthClass, comboboxStyles } from './combobox-styles';\nimport type { ComboboxPopupWidth, ComboboxVariant } from './combobox-styles';\nimport { Button, isIconButtonSize } from '@/ds/components/Button/Button';\nimport type { ButtonSize } from '@/ds/components/Button/Button';\nimport { keepOwnAccessibleName, useFieldAriaIds } from '@/ds/components/Field/field-control-aria';\nimport { FieldBlock } from '@/ds/components/FormFieldBlocks/block/field-block';\nimport { fieldErrorId } from '@/ds/components/FormFieldBlocks/block/field-error-id';\nimport { IconCrossMedium } from '@/ds/icons/central/IconCrossMedium';\nimport { deprecatedErrorAria } from '@/ds/primitives/form-element';\nimport type { PortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxPopupWidth, ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n displayLabel?: React.ReactNode;\n start?: React.ReactNode;\n end?: React.ReactNode;\n /** Extra terms the search matches besides `label` (aliases, ids, a provider name). Never displayed. */\n keywords?: readonly string[];\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: React.ReactNode;\n /** The search row's placeholder for compact triggers. A field (inside a `Field`) searches in itself and shows `placeholder`. */\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n /**\n * `default` inside a `Field` is a form field you type in to search. `ghost` (and the legacy `outline`/`link`),\n * or any variant outside a `Field`, is a compact trigger with the search inside the popup.\n */\n variant?: ComboboxVariant;\n /** Icon sizes (`icon-*`) render a chevron-only trigger with the search in the popup; pass `aria-label` to name it. */\n size?: ButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: PortalContainer;\n id?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n /** Which edge of the trigger the popup lines up with. `end` opens it leftwards (e.g. an icon trigger at the end of a row). */\n align?: 'start' | 'center' | 'end';\n /** A fixed popup width for long options (e.g. model ids). Without it the popup takes the trigger's width, at least 11rem. */\n popupWidth?: ComboboxPopupWidth;\n showChevron?: boolean;\n iconOnlyValue?: boolean;\n allowCustomValue?: boolean;\n /** Called with the search text as it changes (and with `''` after a compact trigger's selection resets it). */\n onInputValueChange?: (value: string) => void;\n /** @deprecated Wrap the combobox in `<Field invalid>` with a `FieldError`. */\n error?: string;\n /** @deprecated Only keyed the `error` message id; a `Field` links its error without one. */\n name?: string;\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 clearLabel?: string;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: readonly string[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\n/** The text a field shows for its value: a plain-text `displayLabel` wins over `label`. */\nfunction optionText(option: ComboboxOption) {\n return typeof option.displayLabel === 'string' ? option.displayLabel : option.label;\n}\n\n/** Inputs take a text placeholder only; a ReactNode placeholder keeps the compact trigger. */\nfunction textPlaceholder(placeholder: React.ReactNode) {\n return typeof placeholder === 'string' ? placeholder : undefined;\n}\n\n/**\n * How the combobox renders:\n * - `field`: a single select inside a `Field` searches in the field, like a text input.\n * - `chips`: a multiple select inside a `Field` shows its picks as chips and searches in the field.\n * - `trigger`: everything else (toolbars, breadcrumbs, inline pickers that callers lay out as a button)\n * keeps a compact trigger with the search inside the popup.\n */\ntype ComboboxShape = 'field' | 'chips' | 'trigger';\n\nfunction getComboboxShape({\n inFieldContext,\n multiple,\n variant,\n size,\n iconOnlyValue,\n showChevron,\n placeholder,\n}: {\n inFieldContext: boolean;\n multiple: boolean;\n variant: ComboboxVariant;\n size: ButtonSize;\n iconOnlyValue: boolean;\n showChevron: boolean;\n placeholder: React.ReactNode;\n}): ComboboxShape {\n if (!inFieldContext) return 'trigger';\n if (variant !== 'default') return 'trigger';\n if (isIconButtonSize(size)) return 'trigger';\n if (iconOnlyValue || !showChevron) return 'trigger';\n if (placeholder !== undefined && textPlaceholder(placeholder) === undefined) return 'trigger';\n if (!multiple) return 'field';\n // The chips field is tuned to the medium control height.\n if (size !== 'md') return 'trigger';\n return 'chips';\n}\n\n/** The value typed text stands for. The custom option and the value match in the filter both read it this way. */\nfunction typedValue(inputValue: string): string {\n return inputValue.trim();\n}\n\n/** A \"Use “text”\" option for typed text that isn't one of the options yet. */\nfunction getCustomOption(options: ComboboxOption[], inputValue: string): ComboboxOption | undefined {\n const value = typedValue(inputValue);\n if (!value) return undefined;\n // A field shows the selected option's text while it's closed; that isn't a new value.\n if (options.some(option => option.value === value || optionText(option) === value)) return undefined;\n return { label: `Use “${value}”`, value };\n}\n\n/**\n * Selected values that no option lists (typed ones, or ones the caller's options no longer include), in the\n * order given. Each shows its bare value, on its chip and in the popup.\n */\nfunction getUnlistedOptions(options: ComboboxOption[], values: readonly string[]): ComboboxOption[] {\n const listedValues = new Set(options.map(option => option.value));\n return [...new Set(values)].filter(value => !listedValues.has(value)).map(value => ({ label: value, value }));\n}\n\n/**\n * The selected values as options: listed ones in `options` order, then the unlisted ones. `onValueChange`\n * reports the values in this order too, with a new pick appended.\n */\nfunction getSelectedOptions(\n options: ComboboxOption[],\n values: readonly string[],\n unlistedOptions: ComboboxOption[],\n): ComboboxOption[] {\n const selectedValues = new Set(values);\n return [...options.filter(option => selectedValues.has(option.value)), ...unlistedOptions];\n}\n\n/** Matches options by value, because Base UI compares by reference and unlisted selections are rebuilt on every render. */\nfunction isSameOption(item: ComboboxOption, selected: ComboboxOption): boolean {\n return item.value === selected.value;\n}\n\n/**\n * Matches the label like Base UI's default filter, the text a field shows, and any keywords. With\n * `matchValue`, an option whose value is exactly the typed value matches too: `getCustomOption` holds back\n * typed text that is an existing value, so without this, typing a value whose label differs shows nothing.\n */\nfunction useOptionFilter({ matchValue }: { matchValue: boolean }) {\n const { contains } = BaseCombobox.useFilter();\n return (option: ComboboxOption, query: string) =>\n (matchValue && option.value === typedValue(query)) ||\n [option.label, optionText(option), ...(option.keywords ?? [])].some(text => contains(text, query));\n}\n\n/** Names the control when nothing else does: an `id` or a `Field` links a label to it instead. */\nfunction getFallbackAriaLabel({ hasLabel, multiple }: { hasLabel: boolean; multiple: boolean }) {\n if (hasLabel) return undefined;\n return multiple ? 'Select options' : 'Select option';\n}\n\nfunction getControlProps({\n id,\n ariaLabel,\n ariaDescribedBy,\n hasLabel,\n multiple,\n error,\n errorName,\n}: {\n id?: string;\n ariaLabel?: string;\n ariaDescribedBy?: string;\n hasLabel: boolean;\n multiple: boolean;\n error?: string;\n errorName: string;\n}) {\n const describedBy = [ariaDescribedBy, error ? fieldErrorId(errorName) : undefined].filter(Boolean).join(' ');\n return {\n id,\n 'aria-label': ariaLabel ?? getFallbackAriaLabel({ hasLabel, multiple }),\n ...keepOwnAccessibleName({ 'aria-label': ariaLabel }),\n ...deprecatedErrorAria(Boolean(error)),\n 'aria-describedby': describedBy || undefined,\n };\n}\n\ntype ControlProps = ReturnType<typeof getControlProps>;\n\nfunction triggerClassName({ iconOnlyValue, className }: { iconOnlyValue: boolean; className?: string }) {\n return cn(iconOnlyValue && 'w-auto px-2.5', className);\n}\n\n/** An option row's content: start slot, label over description, end slot. */\nfunction ComboboxOptionContent({ option }: { option: ComboboxOption }) {\n return (\n <>\n {option.start}\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 {option.end ? <span className={comboboxStyles.optionEnd}>{option.end}</span> : null}\n </>\n );\n}\n\nfunction ComboboxClearFooter({ label, onClear }: { label: string; onClear: () => void }) {\n return (\n <div className=\"border-t border-border p-1\">\n <Button\n type=\"button\"\n variant=\"destructive-ghost\"\n size=\"sm\"\n className=\"w-full justify-start\"\n onClick={onClear}\n icon={<IconCrossMedium />}\n >\n {label}\n </Button>\n </div>\n );\n}\n\n/** The popup: the search row for a compact trigger (a field searches in itself), then the options. */\nfunction ComboboxOptionsContent({\n popupWidth,\n showSearch,\n searchPlaceholder,\n emptyText,\n align,\n container,\n footer,\n}: {\n popupWidth?: ComboboxPopupWidth;\n showSearch: boolean;\n searchPlaceholder: string;\n emptyText: string;\n align: 'start' | 'center' | 'end';\n container?: PortalContainer;\n footer?: React.ReactNode;\n}) {\n return (\n <ComboboxContent align={align} container={container} className={popupWidth && comboboxPopupWidthClass[popupWidth]}>\n {showSearch ? <ComboboxSearch placeholder={searchPlaceholder} /> : null}\n <ComboboxEmpty>{emptyText}</ComboboxEmpty>\n <ComboboxList>\n {(option: ComboboxOption) => (\n <ComboboxItem key={option.value} value={option}>\n <ComboboxOptionContent option={option} />\n </ComboboxItem>\n )}\n </ComboboxList>\n {footer}\n </ComboboxContent>\n );\n}\n\ntype TriggerLookProps = {\n variant: ComboboxVariant;\n size: ButtonSize;\n showChevron: boolean;\n iconOnlyValue: boolean;\n className?: string;\n};\n\nfunction SingleComboboxControl({\n shape,\n controlProps,\n placeholder,\n selectedOption,\n look,\n}: {\n shape: ComboboxShape;\n controlProps: ControlProps;\n placeholder: React.ReactNode;\n selectedOption?: ComboboxOption;\n look: TriggerLookProps;\n}) {\n if (shape === 'field') {\n return (\n <ComboboxInput\n {...controlProps}\n size={isIconButtonSize(look.size) ? undefined : look.size}\n placeholder={textPlaceholder(placeholder)}\n start={selectedOption?.start}\n className={look.className}\n />\n );\n }\n\n return (\n <ComboboxTrigger\n {...controlProps}\n variant={look.variant}\n size={look.size}\n showChevron={look.showChevron}\n icon={isIconButtonSize(look.size) ? undefined : selectedOption?.start}\n className={triggerClassName(look)}\n >\n {selectedOption?.displayLabel ?? <ComboboxValue placeholder={placeholder} />}\n </ComboboxTrigger>\n );\n}\n\nfunction MultipleComboboxControl({\n shape,\n controlProps,\n placeholder,\n selectedCount,\n look,\n}: {\n shape: ComboboxShape;\n controlProps: ControlProps;\n placeholder: React.ReactNode;\n selectedCount: number;\n look: TriggerLookProps;\n}) {\n if (shape === 'chips') {\n return (\n <ComboboxChips className={look.className}>\n <ComboboxValue>\n {(items: ComboboxOption[]) => (\n <>\n {items.map(item => (\n <ComboboxChip key={item.value}>{item.label}</ComboboxChip>\n ))}\n <ComboboxChipsInput\n {...controlProps}\n placeholder={items.length === 0 ? textPlaceholder(placeholder) : undefined}\n />\n </>\n )}\n </ComboboxValue>\n </ComboboxChips>\n );\n }\n\n const text = selectedCount === 0 ? placeholder : `${selectedCount} selected`;\n return (\n <ComboboxTrigger\n {...controlProps}\n variant={look.variant}\n size={look.size}\n showChevron={look.showChevron}\n className={triggerClassName(look)}\n >\n <span className={cn(selectedCount === 0 && comboboxStyles.placeholder)}>{text}</span>\n </ComboboxTrigger>\n );\n}\n\ntype ShapeProps = { shape: ComboboxShape; controlProps: ControlProps };\n\nfunction SingleCombobox({\n shape,\n controlProps,\n options,\n value,\n onValueChange,\n placeholder = '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 align = 'start',\n popupWidth,\n showChevron = true,\n iconOnlyValue = false,\n allowCustomValue = false,\n onInputValueChange,\n}: ComboboxSingleProps & ShapeProps) {\n // The search text: a field's own text, or the compact trigger's popup search.\n const [inputValue, setInputValue] = React.useState('');\n const filter = useOptionFilter({ matchValue: allowCustomValue });\n const inField = shape === 'field';\n const selectedOption = options.find(option => option.value === value);\n const customOption = allowCustomValue ? getCustomOption(options, inputValue) : undefined;\n const items = customOption ? [customOption, ...options] : options;\n\n function handleInputValueChange(next: string) {\n setInputValue(next);\n onInputValueChange?.(next);\n }\n\n function handleValueChange(item: ComboboxOption | null) {\n if (!item) return;\n onValueChange?.(item.value);\n // A field shows the picked option; a compact trigger's popup search starts empty next time.\n if (!inField) handleInputValueChange('');\n }\n\n return (\n <ComboboxRoot\n autoHighlight\n items={items}\n filter={filter}\n itemToStringLabel={optionText}\n // Base UI's \"nothing selected\" is null.\n value={selectedOption ?? null}\n // A field owns its text (the selected option's, or the search); a compact trigger's search is reset here.\n inputValue={inField ? undefined : inputValue}\n onInputValueChange={handleInputValueChange}\n onValueChange={handleValueChange}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n <SingleComboboxControl\n shape={shape}\n controlProps={controlProps}\n placeholder={placeholder}\n selectedOption={selectedOption}\n look={{ variant, size, showChevron, iconOnlyValue, className }}\n />\n <ComboboxOptionsContent\n popupWidth={popupWidth}\n showSearch={!inField}\n searchPlaceholder={searchPlaceholder}\n emptyText={emptyText}\n align={align}\n container={container}\n />\n </ComboboxRoot>\n );\n}\n\n/**\n * A multiple select: picks show as chips (or a count on a compact trigger) and stay listed, checked, in the popup.\n * With `allowCustomValue` the typed text can be picked as a new value.\n */\nfunction MultipleCombobox({\n shape,\n controlProps,\n options,\n value = EMPTY_VALUES,\n onValueChange,\n clearLabel,\n placeholder = 'Select options',\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 align = 'start',\n popupWidth,\n showChevron = true,\n iconOnlyValue = false,\n allowCustomValue = false,\n onInputValueChange,\n}: ComboboxMultipleProps & ShapeProps) {\n // Mirrors the search text, which Base UI owns here, so the typed value can be offered as an option.\n const [inputValue, setInputValue] = React.useState('');\n const filter = useOptionFilter({ matchValue: allowCustomValue });\n const unlistedOptions = getUnlistedOptions(options, value);\n const selectedOptions = getSelectedOptions(options, value, unlistedOptions);\n // A typed value that is already picked is listed checked in the popup; offering it again would unpick it.\n const customOption = allowCustomValue ? getCustomOption([...options, ...unlistedOptions], inputValue) : undefined;\n // Unlisted picks go after the caller's options, which keep their order. Listing them lets a compact trigger,\n // which has no chips, untick them. The custom option comes last, unlike the single select: `autoHighlight`\n // highlights the first item, so someone who types \"gpt-4\" to narrow the list down to \"gpt-4o\" and presses\n // Enter picks \"gpt-4o\" instead of adding the literal text.\n const extraItems = customOption ? [...unlistedOptions, customOption] : unlistedOptions;\n const items = extraItems.length > 0 ? [...options, ...extraItems] : options;\n\n /** Keeps the mirrored search text in step with Base UI, which also clears it after each pick. */\n function handleInputValueChange(next: string) {\n setInputValue(next);\n onInputValueChange?.(next);\n }\n\n const footer =\n clearLabel && selectedOptions.length > 0 ? (\n <ComboboxClearFooter label={clearLabel} onClear={() => onValueChange?.([])} />\n ) : undefined;\n\n return (\n <ComboboxRoot\n multiple\n autoHighlight\n items={items}\n filter={filter}\n value={selectedOptions}\n isItemEqualToValue={isSameOption}\n onInputValueChange={handleInputValueChange}\n onValueChange={picked => onValueChange?.(picked.map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n <MultipleComboboxControl\n shape={shape}\n controlProps={controlProps}\n placeholder={placeholder}\n selectedCount={selectedOptions.length}\n look={{ variant, size, showChevron, iconOnlyValue, className }}\n />\n <ComboboxOptionsContent\n popupWidth={popupWidth}\n showSearch={shape !== 'chips'}\n searchPlaceholder={searchPlaceholder}\n emptyText={emptyText}\n align={align}\n container={container}\n footer={footer}\n />\n </ComboboxRoot>\n );\n}\n\n/**\n * A searchable select driven by `options`, built on the Combobox parts.\n *\n * Inside a `Field`, a `default` combobox searches right in the field: a text field for a single value,\n * removable chips for `multiple`. Everywhere else (outside a `Field`, `ghost` and icon-size triggers,\n * custom non-text placeholders) it keeps a compact trigger with the search inside the popup. For anything\n * these props don't cover (groups, rich items), compose the parts directly (`ComboboxRoot`, ...).\n */\nexport function Combobox(props: ComboboxProps) {\n const field = useFieldAriaIds();\n const generatedName = React.useId();\n const multiple = isMultipleCombobox(props);\n const shape = getComboboxShape({\n inFieldContext: Boolean(field),\n multiple,\n variant: props.variant ?? 'default',\n size: props.size ?? 'md',\n iconOnlyValue: props.iconOnlyValue ?? false,\n showChevron: props.showChevron ?? true,\n placeholder: props.placeholder,\n });\n const errorName = props.name ?? generatedName;\n const controlProps = getControlProps({\n id: props.id,\n ariaLabel: props['aria-label'],\n ariaDescribedBy: props['aria-describedby'],\n hasLabel: Boolean(props.id || field),\n multiple,\n error: props.error,\n errorName,\n });\n\n const root = isMultipleCombobox(props) ? (\n <MultipleCombobox {...props} shape={shape} controlProps={controlProps} />\n ) : (\n <SingleCombobox {...props} shape={shape} controlProps={controlProps} />\n );\n\n if (!props.error) return root;\n\n return (\n <div className={comboboxStyles.root}>\n {root}\n <FieldBlock.ErrorMsg name={errorName}>{props.error}</FieldBlock.ErrorMsg>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4FA,IAAM,eAAkC,CAAC;AAEzC,SAAS,mBAAmB,OAAsD;CAChF,OAAO,MAAM,aAAa;AAC5B;;AAGA,SAAS,WAAW,QAAwB;CAC1C,OAAO,OAAO,OAAO,iBAAiB,WAAW,OAAO,eAAe,OAAO;AAChF;;AAGA,SAAS,gBAAgB,aAA8B;CACrD,OAAO,OAAO,gBAAgB,WAAW,cAAc,KAAA;AACzD;AAWA,SAAS,iBAAiB,EACxB,gBACA,UACA,SACA,MACA,eACA,aACA,eASgB;CAChB,IAAI,CAAC,gBAAgB,OAAO;CAC5B,IAAI,YAAY,WAAW,OAAO;CAClC,IAAI,iBAAiB,IAAI,GAAG,OAAO;CACnC,IAAI,iBAAiB,CAAC,aAAa,OAAO;CAC1C,IAAI,gBAAgB,KAAA,KAAa,gBAAgB,WAAW,MAAM,KAAA,GAAW,OAAO;CACpF,IAAI,CAAC,UAAU,OAAO;CAEtB,IAAI,SAAS,MAAM,OAAO;CAC1B,OAAO;AACT;;AAGA,SAAS,WAAW,YAA4B;CAC9C,OAAO,WAAW,KAAK;AACzB;;AAGA,SAAS,gBAAgB,SAA2B,YAAgD;CAClG,MAAM,QAAQ,WAAW,UAAU;CACnC,IAAI,CAAC,OAAO,OAAO,KAAA;CAEnB,IAAI,QAAQ,MAAK,WAAU,OAAO,UAAU,SAAS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;EACA,SAAS,MAAM,WAAW;EAC1B,MAAM,MAAM,QAAQ;EACpB,eAAe,MAAM,iBAAiB;EACtC,aAAa,MAAM,eAAe;EAClC,aAAa,MAAM;CACrB,CAAC;CACD,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,eAAe,gBAAgB;EACnC,IAAI,MAAM;EACV,WAAW,MAAM;EACjB,iBAAiB,MAAM;EACvB,UAAU,QAAQ,MAAM,MAAM,KAAK;EACnC;EACA,OAAO,MAAM;EACb;CACF,CAAC;CAED,MAAM,OAAO,mBAAmB,KAAK,IACnC,oBAAC,kBAAD;EAAkB,GAAI;EAAc;EAAqB;CAAe,CAAA,IAExE,oBAAC,gBAAD;EAAgB,GAAI;EAAc;EAAqB;CAAe,CAAA;CAGxE,IAAI,CAAC,MAAM,OAAO,OAAO;CAEzB,OACE,qBAAC,OAAD;EAAK,WAAW,eAAe;EAA/B,UAAA,CACG,MACD,oBAAC,WAAW,UAAZ;GAAqB,MAAM;GAAY,UAAA,MAAM;EAA2B,CAAA,CACrE;;AAET"}
|
|
@@ -33,9 +33,13 @@ function getComboboxShape({ inFieldContext, multiple, variant, size, iconOnlyVal
|
|
|
33
33
|
if (size !== "md") return "trigger";
|
|
34
34
|
return "chips";
|
|
35
35
|
}
|
|
36
|
+
/** The value typed text stands for. The custom option and the value match in the filter both read it this way. */
|
|
37
|
+
function typedValue(inputValue) {
|
|
38
|
+
return inputValue.trim();
|
|
39
|
+
}
|
|
36
40
|
/** A "Use “text”" option for typed text that isn't one of the options yet. */
|
|
37
41
|
function getCustomOption(options, inputValue) {
|
|
38
|
-
const value = inputValue
|
|
42
|
+
const value = typedValue(inputValue);
|
|
39
43
|
if (!value) return void 0;
|
|
40
44
|
if (options.some((option) => option.value === value || optionText(option) === value)) return void 0;
|
|
41
45
|
return {
|
|
@@ -43,10 +47,37 @@ function getCustomOption(options, inputValue) {
|
|
|
43
47
|
value
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
|
-
/**
|
|
47
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Selected values that no option lists (typed ones, or ones the caller's options no longer include), in the
|
|
52
|
+
* order given. Each shows its bare value, on its chip and in the popup.
|
|
53
|
+
*/
|
|
54
|
+
function getUnlistedOptions(options, values) {
|
|
55
|
+
const listedValues = new Set(options.map((option) => option.value));
|
|
56
|
+
return [...new Set(values)].filter((value) => !listedValues.has(value)).map((value) => ({
|
|
57
|
+
label: value,
|
|
58
|
+
value
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The selected values as options: listed ones in `options` order, then the unlisted ones. `onValueChange`
|
|
63
|
+
* reports the values in this order too, with a new pick appended.
|
|
64
|
+
*/
|
|
65
|
+
function getSelectedOptions(options, values, unlistedOptions) {
|
|
66
|
+
const selectedValues = new Set(values);
|
|
67
|
+
return [...options.filter((option) => selectedValues.has(option.value)), ...unlistedOptions];
|
|
68
|
+
}
|
|
69
|
+
/** Matches options by value, because Base UI compares by reference and unlisted selections are rebuilt on every render. */
|
|
70
|
+
function isSameOption(item, selected) {
|
|
71
|
+
return item.value === selected.value;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Matches the label like Base UI's default filter, the text a field shows, and any keywords. With
|
|
75
|
+
* `matchValue`, an option whose value is exactly the typed value matches too: `getCustomOption` holds back
|
|
76
|
+
* typed text that is an existing value, so without this, typing a value whose label differs shows nothing.
|
|
77
|
+
*/
|
|
78
|
+
function useOptionFilter({ matchValue }) {
|
|
48
79
|
const { contains } = _base_ui_react_combobox.Combobox.useFilter();
|
|
49
|
-
return (option, query) => [
|
|
80
|
+
return (option, query) => matchValue && option.value === typedValue(query) || [
|
|
50
81
|
option.label,
|
|
51
82
|
optionText(option),
|
|
52
83
|
...option.keywords ?? []
|
|
@@ -165,7 +196,7 @@ function MultipleComboboxControl({ shape, controlProps, placeholder, selectedCou
|
|
|
165
196
|
}
|
|
166
197
|
function SingleCombobox({ shape, controlProps, options, value, onValueChange, placeholder = "Select option", searchPlaceholder = "Search", emptyText = "No option found.", className, disabled = false, variant = "default", size = "md", open, onOpenChange, container, align = "start", popupWidth, showChevron = true, iconOnlyValue = false, allowCustomValue = false, onInputValueChange }) {
|
|
167
198
|
const [inputValue, setInputValue] = react.useState("");
|
|
168
|
-
const filter = useOptionFilter();
|
|
199
|
+
const filter = useOptionFilter({ matchValue: allowCustomValue });
|
|
169
200
|
const inField = shape === "field";
|
|
170
201
|
const selectedOption = options.find((option) => option.value === value);
|
|
171
202
|
const customOption = allowCustomValue ? getCustomOption(options, inputValue) : void 0;
|
|
@@ -213,10 +244,23 @@ function SingleCombobox({ shape, controlProps, options, value, onValueChange, pl
|
|
|
213
244
|
})]
|
|
214
245
|
});
|
|
215
246
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
247
|
+
/**
|
|
248
|
+
* A multiple select: picks show as chips (or a count on a compact trigger) and stay listed, checked, in the popup.
|
|
249
|
+
* With `allowCustomValue` the typed text can be picked as a new value.
|
|
250
|
+
*/
|
|
251
|
+
function MultipleCombobox({ shape, controlProps, options, value = EMPTY_VALUES, onValueChange, clearLabel, placeholder = "Select options", searchPlaceholder = "Search", emptyText = "No option found.", className, disabled = false, variant = "default", size = "md", open, onOpenChange, container, align = "start", popupWidth, showChevron = true, iconOnlyValue = false, allowCustomValue = false, onInputValueChange }) {
|
|
252
|
+
const [inputValue, setInputValue] = react.useState("");
|
|
253
|
+
const filter = useOptionFilter({ matchValue: allowCustomValue });
|
|
254
|
+
const unlistedOptions = getUnlistedOptions(options, value);
|
|
255
|
+
const selectedOptions = getSelectedOptions(options, value, unlistedOptions);
|
|
256
|
+
const customOption = allowCustomValue ? getCustomOption([...options, ...unlistedOptions], inputValue) : void 0;
|
|
257
|
+
const extraItems = customOption ? [...unlistedOptions, customOption] : unlistedOptions;
|
|
258
|
+
const items = extraItems.length > 0 ? [...options, ...extraItems] : options;
|
|
259
|
+
/** Keeps the mirrored search text in step with Base UI, which also clears it after each pick. */
|
|
260
|
+
function handleInputValueChange(next) {
|
|
261
|
+
setInputValue(next);
|
|
262
|
+
onInputValueChange?.(next);
|
|
263
|
+
}
|
|
220
264
|
const footer = clearLabel && selectedOptions.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComboboxClearFooter, {
|
|
221
265
|
label: clearLabel,
|
|
222
266
|
onClear: () => onValueChange?.([])
|
|
@@ -224,10 +268,12 @@ function MultipleCombobox({ shape, controlProps, options, value = EMPTY_VALUES,
|
|
|
224
268
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_combobox_parts.ComboboxRoot, {
|
|
225
269
|
multiple: true,
|
|
226
270
|
autoHighlight: true,
|
|
227
|
-
items
|
|
271
|
+
items,
|
|
228
272
|
filter,
|
|
229
273
|
value: selectedOptions,
|
|
230
|
-
|
|
274
|
+
isItemEqualToValue: isSameOption,
|
|
275
|
+
onInputValueChange: handleInputValueChange,
|
|
276
|
+
onValueChange: (picked) => onValueChange?.(picked.map((item) => item.value)),
|
|
231
277
|
disabled,
|
|
232
278
|
open,
|
|
233
279
|
onOpenChange,
|
|
@@ -310,4 +356,4 @@ Object.defineProperty(exports, "Combobox", {
|
|
|
310
356
|
}
|
|
311
357
|
});
|
|
312
358
|
|
|
313
|
-
//# sourceMappingURL=combobox-
|
|
359
|
+
//# sourceMappingURL=combobox-CtEvUaJc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-CtEvUaJc.cjs","names":["isIconButtonSize","BaseCombobox","fieldErrorId","keepOwnAccessibleName","deprecatedErrorAria","cn","_Fragment","comboboxStyles","Button","IconCrossMedium","ComboboxContent","comboboxPopupWidthClass","ComboboxSearch","ComboboxEmpty","ComboboxList","ComboboxItem","ComboboxInput","ComboboxTrigger","ComboboxValue","ComboboxChips","ComboboxChip","ComboboxChipsInput","React","ComboboxRoot","useFieldAriaIds","FieldBlock"],"sources":["../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport * as React from 'react';\nimport {\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxRoot,\n ComboboxSearch,\n ComboboxTrigger,\n ComboboxValue,\n} from './combobox-parts';\nimport { comboboxPopupWidthClass, comboboxStyles } from './combobox-styles';\nimport type { ComboboxPopupWidth, ComboboxVariant } from './combobox-styles';\nimport { Button, isIconButtonSize } from '@/ds/components/Button/Button';\nimport type { ButtonSize } from '@/ds/components/Button/Button';\nimport { keepOwnAccessibleName, useFieldAriaIds } from '@/ds/components/Field/field-control-aria';\nimport { FieldBlock } from '@/ds/components/FormFieldBlocks/block/field-block';\nimport { fieldErrorId } from '@/ds/components/FormFieldBlocks/block/field-error-id';\nimport { IconCrossMedium } from '@/ds/icons/central/IconCrossMedium';\nimport { deprecatedErrorAria } from '@/ds/primitives/form-element';\nimport type { PortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxPopupWidth, ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n displayLabel?: React.ReactNode;\n start?: React.ReactNode;\n end?: React.ReactNode;\n /** Extra terms the search matches besides `label` (aliases, ids, a provider name). Never displayed. */\n keywords?: readonly string[];\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: React.ReactNode;\n /** The search row's placeholder for compact triggers. A field (inside a `Field`) searches in itself and shows `placeholder`. */\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n /**\n * `default` inside a `Field` is a form field you type in to search. `ghost` (and the legacy `outline`/`link`),\n * or any variant outside a `Field`, is a compact trigger with the search inside the popup.\n */\n variant?: ComboboxVariant;\n /** Icon sizes (`icon-*`) render a chevron-only trigger with the search in the popup; pass `aria-label` to name it. */\n size?: ButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: PortalContainer;\n id?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n /** Which edge of the trigger the popup lines up with. `end` opens it leftwards (e.g. an icon trigger at the end of a row). */\n align?: 'start' | 'center' | 'end';\n /** A fixed popup width for long options (e.g. model ids). Without it the popup takes the trigger's width, at least 11rem. */\n popupWidth?: ComboboxPopupWidth;\n showChevron?: boolean;\n iconOnlyValue?: boolean;\n allowCustomValue?: boolean;\n /** Called with the search text as it changes (and with `''` after a compact trigger's selection resets it). */\n onInputValueChange?: (value: string) => void;\n /** @deprecated Wrap the combobox in `<Field invalid>` with a `FieldError`. */\n error?: string;\n /** @deprecated Only keyed the `error` message id; a `Field` links its error without one. */\n name?: string;\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 clearLabel?: string;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: readonly string[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\n/** The text a field shows for its value: a plain-text `displayLabel` wins over `label`. */\nfunction optionText(option: ComboboxOption) {\n return typeof option.displayLabel === 'string' ? option.displayLabel : option.label;\n}\n\n/** Inputs take a text placeholder only; a ReactNode placeholder keeps the compact trigger. */\nfunction textPlaceholder(placeholder: React.ReactNode) {\n return typeof placeholder === 'string' ? placeholder : undefined;\n}\n\n/**\n * How the combobox renders:\n * - `field`: a single select inside a `Field` searches in the field, like a text input.\n * - `chips`: a multiple select inside a `Field` shows its picks as chips and searches in the field.\n * - `trigger`: everything else (toolbars, breadcrumbs, inline pickers that callers lay out as a button)\n * keeps a compact trigger with the search inside the popup.\n */\ntype ComboboxShape = 'field' | 'chips' | 'trigger';\n\nfunction getComboboxShape({\n inFieldContext,\n multiple,\n variant,\n size,\n iconOnlyValue,\n showChevron,\n placeholder,\n}: {\n inFieldContext: boolean;\n multiple: boolean;\n variant: ComboboxVariant;\n size: ButtonSize;\n iconOnlyValue: boolean;\n showChevron: boolean;\n placeholder: React.ReactNode;\n}): ComboboxShape {\n if (!inFieldContext) return 'trigger';\n if (variant !== 'default') return 'trigger';\n if (isIconButtonSize(size)) return 'trigger';\n if (iconOnlyValue || !showChevron) return 'trigger';\n if (placeholder !== undefined && textPlaceholder(placeholder) === undefined) return 'trigger';\n if (!multiple) return 'field';\n // The chips field is tuned to the medium control height.\n if (size !== 'md') return 'trigger';\n return 'chips';\n}\n\n/** The value typed text stands for. The custom option and the value match in the filter both read it this way. */\nfunction typedValue(inputValue: string): string {\n return inputValue.trim();\n}\n\n/** A \"Use “text”\" option for typed text that isn't one of the options yet. */\nfunction getCustomOption(options: ComboboxOption[], inputValue: string): ComboboxOption | undefined {\n const value = typedValue(inputValue);\n if (!value) return undefined;\n // A field shows the selected option's text while it's closed; that isn't a new value.\n if (options.some(option => option.value === value || optionText(option) === value)) return undefined;\n return { label: `Use “${value}”`, value };\n}\n\n/**\n * Selected values that no option lists (typed ones, or ones the caller's options no longer include), in the\n * order given. Each shows its bare value, on its chip and in the popup.\n */\nfunction getUnlistedOptions(options: ComboboxOption[], values: readonly string[]): ComboboxOption[] {\n const listedValues = new Set(options.map(option => option.value));\n return [...new Set(values)].filter(value => !listedValues.has(value)).map(value => ({ label: value, value }));\n}\n\n/**\n * The selected values as options: listed ones in `options` order, then the unlisted ones. `onValueChange`\n * reports the values in this order too, with a new pick appended.\n */\nfunction getSelectedOptions(\n options: ComboboxOption[],\n values: readonly string[],\n unlistedOptions: ComboboxOption[],\n): ComboboxOption[] {\n const selectedValues = new Set(values);\n return [...options.filter(option => selectedValues.has(option.value)), ...unlistedOptions];\n}\n\n/** Matches options by value, because Base UI compares by reference and unlisted selections are rebuilt on every render. */\nfunction isSameOption(item: ComboboxOption, selected: ComboboxOption): boolean {\n return item.value === selected.value;\n}\n\n/**\n * Matches the label like Base UI's default filter, the text a field shows, and any keywords. With\n * `matchValue`, an option whose value is exactly the typed value matches too: `getCustomOption` holds back\n * typed text that is an existing value, so without this, typing a value whose label differs shows nothing.\n */\nfunction useOptionFilter({ matchValue }: { matchValue: boolean }) {\n const { contains } = BaseCombobox.useFilter();\n return (option: ComboboxOption, query: string) =>\n (matchValue && option.value === typedValue(query)) ||\n [option.label, optionText(option), ...(option.keywords ?? [])].some(text => contains(text, query));\n}\n\n/** Names the control when nothing else does: an `id` or a `Field` links a label to it instead. */\nfunction getFallbackAriaLabel({ hasLabel, multiple }: { hasLabel: boolean; multiple: boolean }) {\n if (hasLabel) return undefined;\n return multiple ? 'Select options' : 'Select option';\n}\n\nfunction getControlProps({\n id,\n ariaLabel,\n ariaDescribedBy,\n hasLabel,\n multiple,\n error,\n errorName,\n}: {\n id?: string;\n ariaLabel?: string;\n ariaDescribedBy?: string;\n hasLabel: boolean;\n multiple: boolean;\n error?: string;\n errorName: string;\n}) {\n const describedBy = [ariaDescribedBy, error ? fieldErrorId(errorName) : undefined].filter(Boolean).join(' ');\n return {\n id,\n 'aria-label': ariaLabel ?? getFallbackAriaLabel({ hasLabel, multiple }),\n ...keepOwnAccessibleName({ 'aria-label': ariaLabel }),\n ...deprecatedErrorAria(Boolean(error)),\n 'aria-describedby': describedBy || undefined,\n };\n}\n\ntype ControlProps = ReturnType<typeof getControlProps>;\n\nfunction triggerClassName({ iconOnlyValue, className }: { iconOnlyValue: boolean; className?: string }) {\n return cn(iconOnlyValue && 'w-auto px-2.5', className);\n}\n\n/** An option row's content: start slot, label over description, end slot. */\nfunction ComboboxOptionContent({ option }: { option: ComboboxOption }) {\n return (\n <>\n {option.start}\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 {option.end ? <span className={comboboxStyles.optionEnd}>{option.end}</span> : null}\n </>\n );\n}\n\nfunction ComboboxClearFooter({ label, onClear }: { label: string; onClear: () => void }) {\n return (\n <div className=\"border-t border-border p-1\">\n <Button\n type=\"button\"\n variant=\"destructive-ghost\"\n size=\"sm\"\n className=\"w-full justify-start\"\n onClick={onClear}\n icon={<IconCrossMedium />}\n >\n {label}\n </Button>\n </div>\n );\n}\n\n/** The popup: the search row for a compact trigger (a field searches in itself), then the options. */\nfunction ComboboxOptionsContent({\n popupWidth,\n showSearch,\n searchPlaceholder,\n emptyText,\n align,\n container,\n footer,\n}: {\n popupWidth?: ComboboxPopupWidth;\n showSearch: boolean;\n searchPlaceholder: string;\n emptyText: string;\n align: 'start' | 'center' | 'end';\n container?: PortalContainer;\n footer?: React.ReactNode;\n}) {\n return (\n <ComboboxContent align={align} container={container} className={popupWidth && comboboxPopupWidthClass[popupWidth]}>\n {showSearch ? <ComboboxSearch placeholder={searchPlaceholder} /> : null}\n <ComboboxEmpty>{emptyText}</ComboboxEmpty>\n <ComboboxList>\n {(option: ComboboxOption) => (\n <ComboboxItem key={option.value} value={option}>\n <ComboboxOptionContent option={option} />\n </ComboboxItem>\n )}\n </ComboboxList>\n {footer}\n </ComboboxContent>\n );\n}\n\ntype TriggerLookProps = {\n variant: ComboboxVariant;\n size: ButtonSize;\n showChevron: boolean;\n iconOnlyValue: boolean;\n className?: string;\n};\n\nfunction SingleComboboxControl({\n shape,\n controlProps,\n placeholder,\n selectedOption,\n look,\n}: {\n shape: ComboboxShape;\n controlProps: ControlProps;\n placeholder: React.ReactNode;\n selectedOption?: ComboboxOption;\n look: TriggerLookProps;\n}) {\n if (shape === 'field') {\n return (\n <ComboboxInput\n {...controlProps}\n size={isIconButtonSize(look.size) ? undefined : look.size}\n placeholder={textPlaceholder(placeholder)}\n start={selectedOption?.start}\n className={look.className}\n />\n );\n }\n\n return (\n <ComboboxTrigger\n {...controlProps}\n variant={look.variant}\n size={look.size}\n showChevron={look.showChevron}\n icon={isIconButtonSize(look.size) ? undefined : selectedOption?.start}\n className={triggerClassName(look)}\n >\n {selectedOption?.displayLabel ?? <ComboboxValue placeholder={placeholder} />}\n </ComboboxTrigger>\n );\n}\n\nfunction MultipleComboboxControl({\n shape,\n controlProps,\n placeholder,\n selectedCount,\n look,\n}: {\n shape: ComboboxShape;\n controlProps: ControlProps;\n placeholder: React.ReactNode;\n selectedCount: number;\n look: TriggerLookProps;\n}) {\n if (shape === 'chips') {\n return (\n <ComboboxChips className={look.className}>\n <ComboboxValue>\n {(items: ComboboxOption[]) => (\n <>\n {items.map(item => (\n <ComboboxChip key={item.value}>{item.label}</ComboboxChip>\n ))}\n <ComboboxChipsInput\n {...controlProps}\n placeholder={items.length === 0 ? textPlaceholder(placeholder) : undefined}\n />\n </>\n )}\n </ComboboxValue>\n </ComboboxChips>\n );\n }\n\n const text = selectedCount === 0 ? placeholder : `${selectedCount} selected`;\n return (\n <ComboboxTrigger\n {...controlProps}\n variant={look.variant}\n size={look.size}\n showChevron={look.showChevron}\n className={triggerClassName(look)}\n >\n <span className={cn(selectedCount === 0 && comboboxStyles.placeholder)}>{text}</span>\n </ComboboxTrigger>\n );\n}\n\ntype ShapeProps = { shape: ComboboxShape; controlProps: ControlProps };\n\nfunction SingleCombobox({\n shape,\n controlProps,\n options,\n value,\n onValueChange,\n placeholder = '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 align = 'start',\n popupWidth,\n showChevron = true,\n iconOnlyValue = false,\n allowCustomValue = false,\n onInputValueChange,\n}: ComboboxSingleProps & ShapeProps) {\n // The search text: a field's own text, or the compact trigger's popup search.\n const [inputValue, setInputValue] = React.useState('');\n const filter = useOptionFilter({ matchValue: allowCustomValue });\n const inField = shape === 'field';\n const selectedOption = options.find(option => option.value === value);\n const customOption = allowCustomValue ? getCustomOption(options, inputValue) : undefined;\n const items = customOption ? [customOption, ...options] : options;\n\n function handleInputValueChange(next: string) {\n setInputValue(next);\n onInputValueChange?.(next);\n }\n\n function handleValueChange(item: ComboboxOption | null) {\n if (!item) return;\n onValueChange?.(item.value);\n // A field shows the picked option; a compact trigger's popup search starts empty next time.\n if (!inField) handleInputValueChange('');\n }\n\n return (\n <ComboboxRoot\n autoHighlight\n items={items}\n filter={filter}\n itemToStringLabel={optionText}\n // Base UI's \"nothing selected\" is null.\n value={selectedOption ?? null}\n // A field owns its text (the selected option's, or the search); a compact trigger's search is reset here.\n inputValue={inField ? undefined : inputValue}\n onInputValueChange={handleInputValueChange}\n onValueChange={handleValueChange}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n <SingleComboboxControl\n shape={shape}\n controlProps={controlProps}\n placeholder={placeholder}\n selectedOption={selectedOption}\n look={{ variant, size, showChevron, iconOnlyValue, className }}\n />\n <ComboboxOptionsContent\n popupWidth={popupWidth}\n showSearch={!inField}\n searchPlaceholder={searchPlaceholder}\n emptyText={emptyText}\n align={align}\n container={container}\n />\n </ComboboxRoot>\n );\n}\n\n/**\n * A multiple select: picks show as chips (or a count on a compact trigger) and stay listed, checked, in the popup.\n * With `allowCustomValue` the typed text can be picked as a new value.\n */\nfunction MultipleCombobox({\n shape,\n controlProps,\n options,\n value = EMPTY_VALUES,\n onValueChange,\n clearLabel,\n placeholder = 'Select options',\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 align = 'start',\n popupWidth,\n showChevron = true,\n iconOnlyValue = false,\n allowCustomValue = false,\n onInputValueChange,\n}: ComboboxMultipleProps & ShapeProps) {\n // Mirrors the search text, which Base UI owns here, so the typed value can be offered as an option.\n const [inputValue, setInputValue] = React.useState('');\n const filter = useOptionFilter({ matchValue: allowCustomValue });\n const unlistedOptions = getUnlistedOptions(options, value);\n const selectedOptions = getSelectedOptions(options, value, unlistedOptions);\n // A typed value that is already picked is listed checked in the popup; offering it again would unpick it.\n const customOption = allowCustomValue ? getCustomOption([...options, ...unlistedOptions], inputValue) : undefined;\n // Unlisted picks go after the caller's options, which keep their order. Listing them lets a compact trigger,\n // which has no chips, untick them. The custom option comes last, unlike the single select: `autoHighlight`\n // highlights the first item, so someone who types \"gpt-4\" to narrow the list down to \"gpt-4o\" and presses\n // Enter picks \"gpt-4o\" instead of adding the literal text.\n const extraItems = customOption ? [...unlistedOptions, customOption] : unlistedOptions;\n const items = extraItems.length > 0 ? [...options, ...extraItems] : options;\n\n /** Keeps the mirrored search text in step with Base UI, which also clears it after each pick. */\n function handleInputValueChange(next: string) {\n setInputValue(next);\n onInputValueChange?.(next);\n }\n\n const footer =\n clearLabel && selectedOptions.length > 0 ? (\n <ComboboxClearFooter label={clearLabel} onClear={() => onValueChange?.([])} />\n ) : undefined;\n\n return (\n <ComboboxRoot\n multiple\n autoHighlight\n items={items}\n filter={filter}\n value={selectedOptions}\n isItemEqualToValue={isSameOption}\n onInputValueChange={handleInputValueChange}\n onValueChange={picked => onValueChange?.(picked.map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n <MultipleComboboxControl\n shape={shape}\n controlProps={controlProps}\n placeholder={placeholder}\n selectedCount={selectedOptions.length}\n look={{ variant, size, showChevron, iconOnlyValue, className }}\n />\n <ComboboxOptionsContent\n popupWidth={popupWidth}\n showSearch={shape !== 'chips'}\n searchPlaceholder={searchPlaceholder}\n emptyText={emptyText}\n align={align}\n container={container}\n footer={footer}\n />\n </ComboboxRoot>\n );\n}\n\n/**\n * A searchable select driven by `options`, built on the Combobox parts.\n *\n * Inside a `Field`, a `default` combobox searches right in the field: a text field for a single value,\n * removable chips for `multiple`. Everywhere else (outside a `Field`, `ghost` and icon-size triggers,\n * custom non-text placeholders) it keeps a compact trigger with the search inside the popup. For anything\n * these props don't cover (groups, rich items), compose the parts directly (`ComboboxRoot`, ...).\n */\nexport function Combobox(props: ComboboxProps) {\n const field = useFieldAriaIds();\n const generatedName = React.useId();\n const multiple = isMultipleCombobox(props);\n const shape = getComboboxShape({\n inFieldContext: Boolean(field),\n multiple,\n variant: props.variant ?? 'default',\n size: props.size ?? 'md',\n iconOnlyValue: props.iconOnlyValue ?? false,\n showChevron: props.showChevron ?? true,\n placeholder: props.placeholder,\n });\n const errorName = props.name ?? generatedName;\n const controlProps = getControlProps({\n id: props.id,\n ariaLabel: props['aria-label'],\n ariaDescribedBy: props['aria-describedby'],\n hasLabel: Boolean(props.id || field),\n multiple,\n error: props.error,\n errorName,\n });\n\n const root = isMultipleCombobox(props) ? (\n <MultipleCombobox {...props} shape={shape} controlProps={controlProps} />\n ) : (\n <SingleCombobox {...props} shape={shape} controlProps={controlProps} />\n );\n\n if (!props.error) return root;\n\n return (\n <div className={comboboxStyles.root}>\n {root}\n <FieldBlock.ErrorMsg name={errorName}>{props.error}</FieldBlock.ErrorMsg>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA4FA,IAAM,eAAkC,CAAC;AAEzC,SAAS,mBAAmB,OAAsD;CAChF,OAAO,MAAM,aAAa;AAC5B;;AAGA,SAAS,WAAW,QAAwB;CAC1C,OAAO,OAAO,OAAO,iBAAiB,WAAW,OAAO,eAAe,OAAO;AAChF;;AAGA,SAAS,gBAAgB,aAA8B;CACrD,OAAO,OAAO,gBAAgB,WAAW,cAAc,KAAA;AACzD;AAWA,SAAS,iBAAiB,EACxB,gBACA,UACA,SACA,MACA,eACA,aACA,eASgB;CAChB,IAAI,CAAC,gBAAgB,OAAO;CAC5B,IAAI,YAAY,WAAW,OAAO;CAClC,IAAIA,eAAAA,iBAAiB,IAAI,GAAG,OAAO;CACnC,IAAI,iBAAiB,CAAC,aAAa,OAAO;CAC1C,IAAI,gBAAgB,KAAA,KAAa,gBAAgB,WAAW,MAAM,KAAA,GAAW,OAAO;CACpF,IAAI,CAAC,UAAU,OAAO;CAEtB,IAAI,SAAS,MAAM,OAAO;CAC1B,OAAO;AACT;;AAGA,SAAS,WAAW,YAA4B;CAC9C,OAAO,WAAW,KAA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,KAAK;EAC7B;EACA,SAAS,MAAM,WAAW;EAC1B,MAAM,MAAM,QAAQ;EACpB,eAAe,MAAM,iBAAiB;EACtC,aAAa,MAAM,eAAe;EAClC,aAAa,MAAM;CACrB,CAAC;CACD,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,eAAe,gBAAgB;EACnC,IAAI,MAAM;EACV,WAAW,MAAM;EACjB,iBAAiB,MAAM;EACvB,UAAU,QAAQ,MAAM,MAAM,KAAK;EACnC;EACA,OAAO,MAAM;EACb;CACF,CAAC;CAED,MAAM,OAAO,mBAAmB,KAAK,IACnC,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAc;EAAqB;CAAe,CAAA,IAExE,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;EAAgB,GAAI;EAAc;EAAqB;CAAe,CAAA;CAGxE,IAAI,CAAC,MAAM,OAAO,OAAO;CAEzB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAWf,uBAAAA,eAAe;EAA/B,UAAA,CACG,MACD,iBAAA,GAAA,kBAAA,IAAA,CAACkB,uBAAAA,WAAW,UAAZ;GAAqB,MAAM;GAAY,UAAA,MAAM;EAA2B,CAAA,CACrE;;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_combobox = require("../combobox-
|
|
2
|
+
const require_combobox = require("../combobox-CtEvUaJc.cjs");
|
|
3
3
|
const require_combobox_parts = require("../combobox-parts-DR1Qn6xm.cjs");
|
|
4
4
|
let _base_ui_react_combobox = require("@base-ui/react/combobox");
|
|
5
5
|
exports.Combobox = require_combobox.Combobox;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Combobox } from "../combobox-
|
|
1
|
+
import { t as Combobox } from "../combobox-BCB51kuy.js";
|
|
2
2
|
import { C as comboboxStyles, _ as ComboboxRoot, a as ComboboxCollection, b as ComboboxTrigger, c as ComboboxGroup, d as ComboboxItemContent, f as ComboboxItemDescription, g as ComboboxList, h as ComboboxLabel, i as ComboboxClear, l as ComboboxInput, m as ComboboxItemTitle, n as ComboboxChips, o as ComboboxContent, p as ComboboxItemEnd, r as ComboboxChipsInput, s as ComboboxEmpty, t as ComboboxChip, u as ComboboxItem, v as ComboboxSearch, x as ComboboxValue, y as ComboboxSeparator } from "../combobox-parts-BVuRAhY6.js";
|
|
3
3
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox";
|
|
4
4
|
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemContent, ComboboxItemDescription, ComboboxItemEnd, ComboboxItemTitle, ComboboxLabel, ComboboxList, ComboboxPrimitive, ComboboxRoot, ComboboxSearch, ComboboxSeparator, ComboboxTrigger, ComboboxValue, comboboxStyles };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_data_list = require("../data-list-BXe_ULaL.cjs");
|
|
3
3
|
const require_DataList = require("../DataList-BViBdMjt.cjs");
|
|
4
|
-
const require_tabbed_container = require("../tabbed-container-
|
|
4
|
+
const require_tabbed_container = require("../tabbed-container-DLntsyso.cjs");
|
|
5
5
|
const require_use_data_list_keyboard = require("../use-data-list-keyboard-BCLBdaWR.cjs");
|
|
6
6
|
exports.DataList = require_data_list.DataList;
|
|
7
7
|
exports.DataListSkeleton = require_DataList.DataListSkeleton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DataList } from "../data-list-BV-YCOhk.js";
|
|
2
2
|
import { i as DataListSkeletonRows, n as ScoresDataList, r as DataListSkeleton, t as TracesDataList } from "../DataList-Qh99bAyQ.js";
|
|
3
|
-
import { t as TabbedContainer } from "../tabbed-container-
|
|
3
|
+
import { t as TabbedContainer } from "../tabbed-container-CRPiA3RI.js";
|
|
4
4
|
import { t as useDataListKeyboard } from "../use-data-list-keyboard-fJXq2T3y.js";
|
|
5
5
|
export { DataList, DataListSkeleton, DataListSkeletonRows, ScoresDataList, TabbedContainer, TracesDataList, useDataListKeyboard };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_property_filter_applied = require("../property-filter-applied-W4RoXpXu.cjs");
|
|
3
3
|
const require_Button = require("../Button-Dnj_IjKV.cjs");
|
|
4
|
-
const require_combobox = require("../combobox-
|
|
4
|
+
const require_combobox = require("../combobox-CtEvUaJc.cjs");
|
|
5
5
|
const require_components_Field = require("./Field.cjs.js");
|
|
6
6
|
const require_popover = require("../popover-eezEX_lT.cjs");
|
|
7
7
|
const require_Txt = require("../Txt-_00wWxTd.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as PickMultiPanel, r as PropertyFilterActions, t as PropertyFilterApplied } from "../property-filter-applied-BrXPlQiN.js";
|
|
2
2
|
import { n as Button } from "../Button-DS5CxY8l.js";
|
|
3
|
-
import { t as Combobox } from "../combobox-
|
|
3
|
+
import { t as Combobox } from "../combobox-BCB51kuy.js";
|
|
4
4
|
import { Field, FieldError } from "./Field.es.js";
|
|
5
5
|
import { i as PopoverTrigger, n as Popover, r as PopoverContent } from "../popover-BpMi52Tb.js";
|
|
6
6
|
import { t as Txt } from "../Txt-5efBsb2p.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_combobox = require("../../combobox-
|
|
2
|
+
const require_combobox = require("../../combobox-CtEvUaJc.cjs");
|
|
3
3
|
const require_lib_framework = require("../../lib/framework.cjs.js");
|
|
4
4
|
const require_toast_api = require("../../toast-api-OXZMucsU.cjs");
|
|
5
5
|
let react = require("react");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Combobox } from "../../combobox-
|
|
1
|
+
import { t as Combobox } from "../../combobox-BCB51kuy.js";
|
|
2
2
|
import { useLinkComponent } from "../../lib/framework.es.js";
|
|
3
3
|
import { t as toast } from "../../toast-api-C7oY0pJy.js";
|
|
4
4
|
import { useEffect } from "react";
|