@plexui/vue 0.4.0 → 0.5.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.
@@ -116,6 +116,8 @@ const FieldComponent = defineComponent({
116
116
  orientation: String,
117
117
  /** One line of a FieldGroup: label at the start, control at the end. @default false */
118
118
  row: { type: Boolean, default: false },
119
+ /** On a `row`, the control takes the rest of the line after the label. @default false */
120
+ fill: { type: Boolean, default: false },
119
121
  /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */
120
122
  id: String,
121
123
  /** Optically aligns the control's text with surrounding content; passed to the control. */
@@ -172,6 +174,7 @@ const FieldComponent = defineComponent({
172
174
  "data-orientation": orientation,
173
175
  "data-optically-align": opticallyAlign,
174
176
  "data-row": row ? "" : undefined,
177
+ "data-fill": props.fill ? "" : undefined,
175
178
  }, [
176
179
  h("div", { class: s.LabelGroup }, [
177
180
  hasLabelAction
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/components/Field/Field.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,CAAC,EACD,OAAO,EACP,KAAK,GAMN,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,kDAAkD,CAAA;AAsChE,MAAM,aAAa,GAAyB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAE/G,mFAAmF;AACnF,MAAM,QAAQ,GAAG,CAAC,MAAuB,E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C,WAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;iBAC3G,CAAC;gBACF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC7B,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,gBAAgB,CAAC;oBAChD,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,YAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;iBACrF,CAAC;aACH,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,mFAAmF;AACnF,MAAM,CAAC,MAAM,KAAK,GAAG,cAA4E,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n Comment,\n Fragment,\n Static,\n Text,\n camelize,\n cloneVNode,\n defineComponent,\n h,\n isVNode,\n useId,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport type { ControlSize } from \"@plexui/styles/types\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/Field/Field.module.css\"\n\n// Vue port of packages/ui/src/components/Field/Field.tsx.\n//\n// - `label`, `description` and `errorMessage` take a string prop or a slot of\n// the same name (the slot wins), like React's ReactNode props.\n// - Children: React accepts an element, which Field clones with the field\n// props, or a render prop `(fieldProps) => ReactNode`, which it leaves alone.\n// Both are the default slot here, which receives the field props:\n// - a slot that reads them (`v-slot=\"fieldProps\"` + `v-bind=\"fieldProps\"`,\n// `v-slot=\"{ id }\"`, `(fieldProps) => h(...)`) is the render prop: its\n// content renders as it is.\n// - a slot that does not read them and holds exactly one element or\n// component gets it cloned like React's `cloneElement`: `opticallyAlign`\n// replaces the child's own, the child's own `id` stays and the label's\n// `for` follows it, `aria-describedby` is joined after the child's own\n// ids, and an explicit `aria-invalid` on the child wins. Template\n// comments do not count as children (JSX comments); the\n// placeholder of a `v-if` that renders nothing does, like `{false}` in a\n// React children array, so `<A v-if=\"x\" /><Input />` is not cloned.\n// - anything else (text, several roots, a `v-for` list) renders as it is,\n// like a React child that is not a single element.\n// - content a wrapper forwards with `<slot />` counts as its own roots, as\n// React's `children` passed on to Field are the elements themselves.\n// - As in React only `class` reaches the root element; other attributes are\n// dropped. On a `row` they all reach it, as React's rest props do.\n\nexport type FieldChildProps = {\n id: string\n /** The label's id. Bind it to a control that the label's `for` cannot name, such as a Select trigger. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n \"aria-invalid\"?: boolean\n opticallyAlign?: \"start\" | \"end\"\n}\n\ntype Props = Record<string, unknown>\n\nconst CONTROL_SIZES: ReadonlySet<unknown> = new Set([\"3xs\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\"])\n\n/** The slot props, recording whether the slot read them (the render-prop form). */\nconst trackUse = (target: FieldChildProps) => {\n const state = { used: false }\n const proxy = new Proxy(target, {\n get(object, key, receiver) {\n state.used = true\n return Reflect.get(object, key, receiver)\n },\n has(object, key) {\n state.used = true\n return Reflect.has(object, key)\n },\n ownKeys(object) {\n state.used = true\n return Reflect.ownKeys(object)\n },\n getOwnPropertyDescriptor(object, key) {\n state.used = true\n return Reflect.getOwnPropertyDescriptor(object, key)\n },\n })\n return { proxy, state }\n}\n\n/** Like React's `isValidElement` for a slot root: an element or a component. */\nconst isElementVNode = (node: VNode) => {\n const { type } = node\n if (type === Fragment || type === Text || type === Comment || type === Static) return false\n if (typeof type === \"object\" && type !== null && (\"__isTeleport\" in type || \"__isSuspense\" in type)) return false\n return true\n}\n\n/**\n * Template comments (`<!-- note -->`) are no children, like JSX comments.\n * The empty placeholder of a `v-if` that renders nothing (or of a `false`\n * child) still counts, like `{false}` in a React children array.\n */\nconst isTemplateComment = (node: VNodeArrayChildren[number]) =>\n isVNode(node) && node.type === Comment && !!node.children && node.children !== \"v-if\"\n\n/**\n * Unwraps content forwarded through a wrapper's `<slot />`: the fragment\n * `renderSlot` creates, keyed `_<slot name>`.\n */\nconst unwrapForwardedSlots = (nodes: VNodeArrayChildren): VNodeArrayChildren =>\n nodes.flatMap((node) =>\n isVNode(node) &&\n node.type === Fragment &&\n typeof node.key === \"string\" &&\n node.key.startsWith(\"_\") &&\n Array.isArray(node.children)\n ? unwrapForwardedSlots(node.children)\n : [node],\n )\n\n/** The one element a non-render-prop slot holds, if it holds exactly one. */\nconst singleElement = (nodes: VNodeArrayChildren): VNode | undefined => {\n const roots = unwrapForwardedSlots(nodes).filter((node) => !isTemplateComment(node))\n if (roots.length !== 1) return undefined\n const [root] = roots\n return isVNode(root) && isElementVNode(root) ? root : undefined\n}\n\n/** A child prop under its attribute name or its camelCase prop name. */\nconst childProp = (props: Props, name: string) => props[name] ?? props[camelize(name)]\n\n/**\n * `cloneElement(child, fieldProps)` with React Field's merging rules. A child\n * without its own name (`aria-label`, `aria-labelledby`, `label`, a `#label`\n * slot) is also labelled by the field's label, which names triggers `for`\n * cannot reach.\n */\nconst cloneWithFieldProps = (child: VNode, fieldChildProps: FieldChildProps, labelId: string): VNode => {\n const own: Props = { ...(child.props ?? {}) }\n const childDescribedBy = childProp(own, \"aria-describedby\") as string | undefined\n const childInvalid = childProp(own, \"aria-invalid\")\n const childSlots = child.children\n const childNamed =\n childProp(own, \"aria-label\") != null ||\n childProp(own, \"aria-labelledby\") != null ||\n own.label != null ||\n (childSlots != null && typeof childSlots === \"object\" && !Array.isArray(childSlots) && \"label\" in childSlots)\n\n const overrides: Props = {\n ...fieldChildProps,\n // Merge with the child's own associations instead of overwriting them\n \"aria-describedby\": [childDescribedBy, fieldChildProps[\"aria-describedby\"]].filter(Boolean).join(\" \") || undefined,\n \"aria-invalid\": childInvalid ?? fieldChildProps[\"aria-invalid\"],\n ...(!childNamed && { \"aria-labelledby\": labelId }),\n }\n\n // One spelling per prop, so the field's value is the one that applies\n for (const key of Object.keys(overrides)) {\n for (const spelling of [key, camelize(key), key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)]) {\n delete own[spelling]\n }\n }\n\n return cloneVNode({ ...child, props: own } as VNode, overrides)\n}\n\nconst FieldComponent = defineComponent({\n name: \"Field\",\n inheritAttrs: false,\n props: {\n /** Label text for the field (or the `label` slot) */\n label: String,\n /** Helper text below the label, linked via `aria-describedby` (or the `description` slot) */\n description: String,\n /**\n * Error message below the control (or the `errorMessage` slot). When set,\n * the control gets `aria-invalid=\"true\"`. Rendered with FieldError.\n */\n errorMessage: String,\n /** Content at the end of the label row, such as a link that acts on the field (or the `labelAction` slot) */\n labelAction: String,\n /** Font size of the label, to match the control's size. @default the child control's `size`, else \"md\" */\n size: String as PropType<ControlSize>,\n /** Shows a required asterisk after the label. Visual only: no `required` attribute. @default false */\n required: { type: Boolean, default: false },\n /** Layout direction of label and control. @default \"horizontal\" on a `row`, else \"vertical\" */\n orientation: String as PropType<\"vertical\" | \"horizontal\">,\n /** One line of a FieldGroup: label at the start, control at the end. @default false */\n row: { type: Boolean, default: false },\n /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */\n id: String,\n /** Optically aligns the control's text with surrounding content; passed to the control. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n },\n slots: Object as SlotsType<{\n /** The control. Read the props to render them yourself (React's render prop). */\n default?: (fieldProps: FieldChildProps) => VNodeChild\n label?: () => VNodeChild\n labelAction?: () => VNodeChild\n description?: () => VNodeChild\n errorMessage?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const generatedId = useId()\n\n return () => {\n const { required, row, opticallyAlign } = props\n const orientation = props.orientation ?? (row ? \"horizontal\" : \"vertical\")\n const fieldId = props.id || `field-${generatedId}`\n const labelId = `${fieldId}-label`\n\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const errorMessage = slots.errorMessage ? slots.errorMessage() : props.errorMessage\n const hasError = slots.errorMessage ? hasContent(errorMessage as VNodeArrayChildren) : !!errorMessage\n\n const descriptionId = hasDescription ? `${fieldId}-description` : undefined\n const errorId = hasError ? `${fieldId}-error` : undefined\n\n // Build aria-describedby from description + error IDs\n const ariaDescribedBy = [descriptionId, errorId].filter(Boolean).join(\" \") || undefined\n const invalid = hasError\n\n // Props to inject into the child control\n const fieldChildProps: FieldChildProps = {\n \"id\": fieldId,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": invalid || undefined,\n ...(opticallyAlign && { opticallyAlign }),\n }\n\n // Resolve the children\n let resolvedChildren: VNodeArrayChildren | undefined\n let childSize: unknown\n // The control's id, which the label's `for` has to match\n let controlId = fieldId\n if (slots.default) {\n const { proxy, state } = trackUse({ ...fieldChildProps, \"aria-labelledby\": labelId })\n const nodes = slots.default(proxy) as VNodeArrayChildren\n const child = state.used ? undefined : singleElement(nodes)\n childSize = child?.props?.size\n controlId = (child?.props?.id as string | undefined) || fieldId\n resolvedChildren = child ? [cloneWithFieldProps(child, { ...fieldChildProps, id: controlId }, labelId)] : nodes\n }\n const size = props.size ?? (CONTROL_SIZES.has(childSize) ? (childSize as ControlSize) : \"md\")\n\n const labelAction = slots.labelAction ? slots.labelAction() : props.labelAction\n const hasLabelAction = slots.labelAction ? hasContent(labelAction as VNodeArrayChildren) : !!labelAction\n const labelElement = h(\"label\", { class: s.Label, id: labelId, for: controlId }, [\n slots.label ? slots.label() : props.label,\n required ? h(\"span\", { \"class\": s.RequiredIndicator, \"aria-hidden\": \"true\" }, \"*\") : null,\n ])\n\n return h(\n \"div\",\n {\n ...(row && attrs),\n \"class\": clsx(s.Field, attrs.class as ClassValue),\n \"data-size\": size,\n \"data-orientation\": orientation,\n \"data-optically-align\": opticallyAlign,\n \"data-row\": row ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.LabelGroup }, [\n hasLabelAction\n ? h(\"div\", { class: s.LabelRow }, [labelElement, h(\"div\", { class: s.LabelAction }, [labelAction as VNodeChild])])\n : labelElement,\n hasDescription ? h(\"div\", { class: s.Description, id: descriptionId }, [description as VNodeChild]) : null,\n ]),\n h(\"div\", { class: s.Content }, [\n h(\"div\", { class: s.Control }, resolvedChildren),\n hasError ? h(FieldError, { id: errorId }, () => [errorMessage as VNodeChild]) : null,\n ]),\n ],\n )\n }\n },\n})\n\ntype FieldOwnProps = InstanceType<typeof FieldComponent>[\"$props\"]\n\n/** Field props; `class` reaches the root element. */\nexport type FieldProps = FieldOwnProps & { class?: ClassValue }\n\n/** Form field wrapper with label, description, error and accessibility linking. */\nexport const Field = FieldComponent as typeof FieldComponent & { new (): { $props: FieldProps } }\n"]}
1
+ {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/components/Field/Field.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,CAAC,EACD,OAAO,EACP,KAAK,GAMN,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,kDAAkD,CAAA;AAsChE,MAAM,aAAa,GAAyB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAE/G,mFAAmF;AACnF,MAAM,QAAQ,GAAG,CAAC,MAAuB,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;IAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,GAA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EAAE,EAAE,aAAa,EAAE,EAAE,CAAC,WAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;iBAC3G,CAAC;gBACF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC7B,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,gBAAgB,CAAC;oBAChD,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,YAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;iBACrF,CAAC;aACH,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,mFAAmF;AACnF,MAAM,CAAC,MAAM,KAAK,GAAG,cAA4E,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n Comment,\n Fragment,\n Static,\n Text,\n camelize,\n cloneVNode,\n defineComponent,\n h,\n isVNode,\n useId,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport type { ControlSize } from \"@plexui/styles/types\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/Field/Field.module.css\"\n\n// Vue port of packages/ui/src/components/Field/Field.tsx.\n//\n// - `label`, `description` and `errorMessage` take a string prop or a slot of\n// the same name (the slot wins), like React's ReactNode props.\n// - Children: React accepts an element, which Field clones with the field\n// props, or a render prop `(fieldProps) => ReactNode`, which it leaves alone.\n// Both are the default slot here, which receives the field props:\n// - a slot that reads them (`v-slot=\"fieldProps\"` + `v-bind=\"fieldProps\"`,\n// `v-slot=\"{ id }\"`, `(fieldProps) => h(...)`) is the render prop: its\n// content renders as it is.\n// - a slot that does not read them and holds exactly one element or\n// component gets it cloned like React's `cloneElement`: `opticallyAlign`\n// replaces the child's own, the child's own `id` stays and the label's\n// `for` follows it, `aria-describedby` is joined after the child's own\n// ids, and an explicit `aria-invalid` on the child wins. Template\n// comments do not count as children (JSX comments); the\n// placeholder of a `v-if` that renders nothing does, like `{false}` in a\n// React children array, so `<A v-if=\"x\" /><Input />` is not cloned.\n// - anything else (text, several roots, a `v-for` list) renders as it is,\n// like a React child that is not a single element.\n// - content a wrapper forwards with `<slot />` counts as its own roots, as\n// React's `children` passed on to Field are the elements themselves.\n// - As in React only `class` reaches the root element; other attributes are\n// dropped. On a `row` they all reach it, as React's rest props do.\n\nexport type FieldChildProps = {\n id: string\n /** The label's id. Bind it to a control that the label's `for` cannot name, such as a Select trigger. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n \"aria-invalid\"?: boolean\n opticallyAlign?: \"start\" | \"end\"\n}\n\ntype Props = Record<string, unknown>\n\nconst CONTROL_SIZES: ReadonlySet<unknown> = new Set([\"3xs\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\"])\n\n/** The slot props, recording whether the slot read them (the render-prop form). */\nconst trackUse = (target: FieldChildProps) => {\n const state = { used: false }\n const proxy = new Proxy(target, {\n get(object, key, receiver) {\n state.used = true\n return Reflect.get(object, key, receiver)\n },\n has(object, key) {\n state.used = true\n return Reflect.has(object, key)\n },\n ownKeys(object) {\n state.used = true\n return Reflect.ownKeys(object)\n },\n getOwnPropertyDescriptor(object, key) {\n state.used = true\n return Reflect.getOwnPropertyDescriptor(object, key)\n },\n })\n return { proxy, state }\n}\n\n/** Like React's `isValidElement` for a slot root: an element or a component. */\nconst isElementVNode = (node: VNode) => {\n const { type } = node\n if (type === Fragment || type === Text || type === Comment || type === Static) return false\n if (typeof type === \"object\" && type !== null && (\"__isTeleport\" in type || \"__isSuspense\" in type)) return false\n return true\n}\n\n/**\n * Template comments (`<!-- note -->`) are no children, like JSX comments.\n * The empty placeholder of a `v-if` that renders nothing (or of a `false`\n * child) still counts, like `{false}` in a React children array.\n */\nconst isTemplateComment = (node: VNodeArrayChildren[number]) =>\n isVNode(node) && node.type === Comment && !!node.children && node.children !== \"v-if\"\n\n/**\n * Unwraps content forwarded through a wrapper's `<slot />`: the fragment\n * `renderSlot` creates, keyed `_<slot name>`.\n */\nconst unwrapForwardedSlots = (nodes: VNodeArrayChildren): VNodeArrayChildren =>\n nodes.flatMap((node) =>\n isVNode(node) &&\n node.type === Fragment &&\n typeof node.key === \"string\" &&\n node.key.startsWith(\"_\") &&\n Array.isArray(node.children)\n ? unwrapForwardedSlots(node.children)\n : [node],\n )\n\n/** The one element a non-render-prop slot holds, if it holds exactly one. */\nconst singleElement = (nodes: VNodeArrayChildren): VNode | undefined => {\n const roots = unwrapForwardedSlots(nodes).filter((node) => !isTemplateComment(node))\n if (roots.length !== 1) return undefined\n const [root] = roots\n return isVNode(root) && isElementVNode(root) ? root : undefined\n}\n\n/** A child prop under its attribute name or its camelCase prop name. */\nconst childProp = (props: Props, name: string) => props[name] ?? props[camelize(name)]\n\n/**\n * `cloneElement(child, fieldProps)` with React Field's merging rules. A child\n * without its own name (`aria-label`, `aria-labelledby`, `label`, a `#label`\n * slot) is also labelled by the field's label, which names triggers `for`\n * cannot reach.\n */\nconst cloneWithFieldProps = (child: VNode, fieldChildProps: FieldChildProps, labelId: string): VNode => {\n const own: Props = { ...(child.props ?? {}) }\n const childDescribedBy = childProp(own, \"aria-describedby\") as string | undefined\n const childInvalid = childProp(own, \"aria-invalid\")\n const childSlots = child.children\n const childNamed =\n childProp(own, \"aria-label\") != null ||\n childProp(own, \"aria-labelledby\") != null ||\n own.label != null ||\n (childSlots != null && typeof childSlots === \"object\" && !Array.isArray(childSlots) && \"label\" in childSlots)\n\n const overrides: Props = {\n ...fieldChildProps,\n // Merge with the child's own associations instead of overwriting them\n \"aria-describedby\": [childDescribedBy, fieldChildProps[\"aria-describedby\"]].filter(Boolean).join(\" \") || undefined,\n \"aria-invalid\": childInvalid ?? fieldChildProps[\"aria-invalid\"],\n ...(!childNamed && { \"aria-labelledby\": labelId }),\n }\n\n // One spelling per prop, so the field's value is the one that applies\n for (const key of Object.keys(overrides)) {\n for (const spelling of [key, camelize(key), key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)]) {\n delete own[spelling]\n }\n }\n\n return cloneVNode({ ...child, props: own } as VNode, overrides)\n}\n\nconst FieldComponent = defineComponent({\n name: \"Field\",\n inheritAttrs: false,\n props: {\n /** Label text for the field (or the `label` slot) */\n label: String,\n /** Helper text below the label, linked via `aria-describedby` (or the `description` slot) */\n description: String,\n /**\n * Error message below the control (or the `errorMessage` slot). When set,\n * the control gets `aria-invalid=\"true\"`. Rendered with FieldError.\n */\n errorMessage: String,\n /** Content at the end of the label row, such as a link that acts on the field (or the `labelAction` slot) */\n labelAction: String,\n /** Font size of the label, to match the control's size. @default the child control's `size`, else \"md\" */\n size: String as PropType<ControlSize>,\n /** Shows a required asterisk after the label. Visual only: no `required` attribute. @default false */\n required: { type: Boolean, default: false },\n /** Layout direction of label and control. @default \"horizontal\" on a `row`, else \"vertical\" */\n orientation: String as PropType<\"vertical\" | \"horizontal\">,\n /** One line of a FieldGroup: label at the start, control at the end. @default false */\n row: { type: Boolean, default: false },\n /** On a `row`, the control takes the rest of the line after the label. @default false */\n fill: { type: Boolean, default: false },\n /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */\n id: String,\n /** Optically aligns the control's text with surrounding content; passed to the control. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n },\n slots: Object as SlotsType<{\n /** The control. Read the props to render them yourself (React's render prop). */\n default?: (fieldProps: FieldChildProps) => VNodeChild\n label?: () => VNodeChild\n labelAction?: () => VNodeChild\n description?: () => VNodeChild\n errorMessage?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const generatedId = useId()\n\n return () => {\n const { required, row, opticallyAlign } = props\n const orientation = props.orientation ?? (row ? \"horizontal\" : \"vertical\")\n const fieldId = props.id || `field-${generatedId}`\n const labelId = `${fieldId}-label`\n\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const errorMessage = slots.errorMessage ? slots.errorMessage() : props.errorMessage\n const hasError = slots.errorMessage ? hasContent(errorMessage as VNodeArrayChildren) : !!errorMessage\n\n const descriptionId = hasDescription ? `${fieldId}-description` : undefined\n const errorId = hasError ? `${fieldId}-error` : undefined\n\n // Build aria-describedby from description + error IDs\n const ariaDescribedBy = [descriptionId, errorId].filter(Boolean).join(\" \") || undefined\n const invalid = hasError\n\n // Props to inject into the child control\n const fieldChildProps: FieldChildProps = {\n \"id\": fieldId,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": invalid || undefined,\n ...(opticallyAlign && { opticallyAlign }),\n }\n\n // Resolve the children\n let resolvedChildren: VNodeArrayChildren | undefined\n let childSize: unknown\n // The control's id, which the label's `for` has to match\n let controlId = fieldId\n if (slots.default) {\n const { proxy, state } = trackUse({ ...fieldChildProps, \"aria-labelledby\": labelId })\n const nodes = slots.default(proxy) as VNodeArrayChildren\n const child = state.used ? undefined : singleElement(nodes)\n childSize = child?.props?.size\n controlId = (child?.props?.id as string | undefined) || fieldId\n resolvedChildren = child ? [cloneWithFieldProps(child, { ...fieldChildProps, id: controlId }, labelId)] : nodes\n }\n const size = props.size ?? (CONTROL_SIZES.has(childSize) ? (childSize as ControlSize) : \"md\")\n\n const labelAction = slots.labelAction ? slots.labelAction() : props.labelAction\n const hasLabelAction = slots.labelAction ? hasContent(labelAction as VNodeArrayChildren) : !!labelAction\n const labelElement = h(\"label\", { class: s.Label, id: labelId, for: controlId }, [\n slots.label ? slots.label() : props.label,\n required ? h(\"span\", { \"class\": s.RequiredIndicator, \"aria-hidden\": \"true\" }, \"*\") : null,\n ])\n\n return h(\n \"div\",\n {\n ...(row && attrs),\n \"class\": clsx(s.Field, attrs.class as ClassValue),\n \"data-size\": size,\n \"data-orientation\": orientation,\n \"data-optically-align\": opticallyAlign,\n \"data-row\": row ? \"\" : undefined,\n \"data-fill\": props.fill ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.LabelGroup }, [\n hasLabelAction\n ? h(\"div\", { class: s.LabelRow }, [labelElement, h(\"div\", { class: s.LabelAction }, [labelAction as VNodeChild])])\n : labelElement,\n hasDescription ? h(\"div\", { class: s.Description, id: descriptionId }, [description as VNodeChild]) : null,\n ]),\n h(\"div\", { class: s.Content }, [\n h(\"div\", { class: s.Control }, resolvedChildren),\n hasError ? h(FieldError, { id: errorId }, () => [errorMessage as VNodeChild]) : null,\n ]),\n ],\n )\n }\n },\n})\n\ntype FieldOwnProps = InstanceType<typeof FieldComponent>[\"$props\"]\n\n/** Field props; `class` reaches the root element. */\nexport type FieldProps = FieldOwnProps & { class?: ClassValue }\n\n/** Form field wrapper with label, description, error and accessibility linking. */\nexport const Field = FieldComponent as typeof FieldComponent & { new (): { $props: FieldProps } }\n"]}
@@ -71,12 +71,12 @@ const selectProps = {
71
71
  alignOffset: Number,
72
72
  /** Collision detection of the menu. @default true */
73
73
  avoidCollisions: { type: Boolean, default: true },
74
- /** Width of the menu. @default "auto" */
74
+ /** Width of the menu. @default the trigger width (fits the options when not block) */
75
75
  listWidth: [Number, String],
76
- /** `min-width` of the menu, in pixels. @default the trigger width (300 when not block) */
76
+ /** `min-width` of the menu, in pixels. @default the trigger width */
77
77
  listMinWidth: [Number, String],
78
- /** `max-width` of the menu, in pixels. @default "auto" */
79
- listMaxWidth: { type: [Number, String], default: "auto" },
78
+ /** `max-width` of the menu, in pixels. @default "auto" (300 when not block) */
79
+ listMaxWidth: [Number, String],
80
80
  /** Predicate used to filter searches */
81
81
  searchPredicate: Function,
82
82
  /** Placeholder of the search input */
@@ -149,8 +149,6 @@ const SelectComponent = defineComponent({
149
149
  const align = computed(() => props.align ?? (block.value ? "center" : "start"));
150
150
  // Flush with the trigger's edge, as the prop documents
151
151
  const alignOffset = computed(() => props.alignOffset ?? 0);
152
- // A menu is never narrower than the field it belongs to. Inline selects keep their 300px floor.
153
- const listMinWidth = computed(() => props.listMinWidth ?? (block.value ? undefined : 300));
154
152
  const change = (selection) => {
155
153
  emit("update:value", Array.isArray(selection) ? selection.map((option) => option.value) : selection.value);
156
154
  emit("change", selection);
@@ -196,6 +194,11 @@ const SelectComponent = defineComponent({
196
194
  });
197
195
  // Locking down searchable count to a single value
198
196
  const searchable = computed(() => optionsCount.value > 15);
197
+ // A block menu matches its field. An inline one fits its options: no narrower than
198
+ // its trigger (the CSS fallback reads the trigger width), no wider than 300px.
199
+ const fitsOptions = computed(() => !block.value && props.listWidth === undefined);
200
+ const listWidth = computed(() => props.listWidth ?? (fitsOptions.value ? "auto" : undefined));
201
+ const listMaxWidth = computed(() => props.listMaxWidth ?? (fitsOptions.value ? 300 : "auto"));
199
202
  const slotsVersion = ref(0);
200
203
  onBeforeUpdate(() => {
201
204
  slotsVersion.value++;
@@ -209,7 +212,8 @@ const SelectComponent = defineComponent({
209
212
  block,
210
213
  align,
211
214
  alignOffset,
212
- listMinWidth,
215
+ listWidth,
216
+ listMaxWidth,
213
217
  searchable,
214
218
  actions,
215
219
  onSelect,
@@ -518,7 +522,7 @@ const SelectContentElement = markRaw(defineComponent({
518
522
  const SelectPopoverContent = defineComponent({
519
523
  name: "SelectPopoverContent",
520
524
  setup() {
521
- const { props, align, alignOffset, listMinWidth } = useSelectContext();
525
+ const { props, align, alignOffset, listWidth, listMaxWidth } = useSelectContext();
522
526
  const { handleRootOpenChange, popoverTriggerEl } = inject(CustomSelectContextKey);
523
527
  // Radix (1.8.1) dismisses on the click that follows a primary pointer down outside
524
528
  const { onPointerDownOutside, onFocusOutside } = useDeferredPointerDownOutside((originalEvent) => {
@@ -545,9 +549,9 @@ const SelectPopoverContent = defineComponent({
545
549
  onPointerDownOutside,
546
550
  onFocusOutside,
547
551
  style: toCssVariables({
548
- "select-list-width": props.listWidth,
549
- "select-list-min-width": listMinWidth.value,
550
- "select-list-max-width": props.listMaxWidth,
552
+ "select-list-width": listWidth.value,
553
+ "select-list-min-width": props.listMinWidth,
554
+ "select-list-max-width": listMaxWidth.value,
551
555
  }),
552
556
  }, { default: () => h(CustomSelectMenu) });
553
557
  },
@@ -590,7 +594,7 @@ const focusMounted = (element) => {
590
594
  const CustomSelectMenu = defineComponent({
591
595
  name: "CustomSelectMenu",
592
596
  setup() {
593
- const { props, searchable, searchPredicate } = useSelectContext();
597
+ const { props, searchable, searchPredicate, listWidth } = useSelectContext();
594
598
  const { handleOpenChange } = inject(CustomSelectContextKey);
595
599
  const menuRef = shallowRef(null);
596
600
  const listRef = shallowRef(null);
@@ -758,6 +762,10 @@ const CustomSelectMenu = defineComponent({
758
762
  // On mount behavior
759
763
  onMounted(() => {
760
764
  syncActiveDescendant();
765
+ // A long list has a search field: the menu keeps the width of all its options as the results narrow.
766
+ if (searchable.value && listWidth.value === "auto" && menuRef.value) {
767
+ menuRef.value.style.minWidth = `${menuRef.value.offsetWidth}px`;
768
+ }
761
769
  // Like React's mount effect, the scroll target is the highlight at mount
762
770
  const initialHighlightedValue = highlightedValue.value;
763
771
  // Ensure initial highlighted option is in view
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/Select/Select.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,CAAC,EACD,MAAM,EACN,OAAO,EACP,QAAQ,EACR,eAAe,EACf,cAAc,EACd,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,GAWN,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,wBAAwB,EACxB,KAAK,IAAI,SAAS,GACnB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,gBAAg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AC;IACH,CAAC;IAED,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AA0BD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,eAA+E,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport {\n cloneVNode,\n computed,\n createCommentVNode,\n defineComponent,\n h,\n inject,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onBeforeUpdate,\n onMounted,\n provide,\n ref,\n shallowRef,\n toRaw,\n useId,\n watch,\n type Component,\n type ComponentPublicInstance,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n type ShallowRef,\n type Slots,\n type VNode,\n type VNodeChild,\n} from \"vue\"\nimport {\n PopoverAnchor as RekaPopoverAnchor,\n PopoverContent as RekaPopoverContent,\n PopoverPortal as RekaPopoverPortal,\n PopoverRoot as RekaPopoverRoot,\n injectPopoverRootContext,\n useId as useRekaId,\n} from \"reka-ui\"\nimport type { ControlSize } from \"@plexui/styles/types\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { preventDefaultHandler, pressHandlers, toCssVariables, waitForAnimationFrame } from \"../../lib/helpers.js\"\nimport { Check, Info, Search } from \"../Icon/index.js\"\nimport { Input } from \"../Input/index.js\"\nimport { useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { SelectControl, type DropdownIconType } from \"../SelectControl/index.js\"\nimport { Tooltip } from \"../Tooltip/index.js\"\nimport { withRadixVariableNames } from \"../Tooltip/Tooltip.js\"\nimport { composeEventHandlers, firstElementChild, mergeSlotProps } from \"../Tooltip/slot.js\"\nimport getDisableAnimations from \"../Transition/getDisableAnimations.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { overlayTiming } from \"../Transition/shared.js\"\nimport s from \"@plexui/styles/components/Select/Select.module.css\"\n\n// Vue port of packages/ui/src/components/Select/Select.tsx on Reka UI.\n//\n// API mapping:\n// - `value` + `update:value` (`v-model:value`): a string, or string[] with\n// `multiple`. `change` carries what React's `onChange` receives: the\n// selected option, or the selected options with `multiple`.\n// - Custom views are scoped slots, with React's component props kept as a\n// fallback: `#optionView=\"option\"` / `OptionView`, `#triggerView` /\n// `TriggerView` (receives the selected option, or `{ values, selectedAll }`\n// with `multiple`), `#trigger=\"{ open, onToggle }\"` / `trigger`, and\n// `#searchEmptyMessage` / `searchEmptyMessage`.\n// - An option's `description` and `tooltip.content` take a string, a VNode or\n// a render function (React: a ReactNode). Actions keep their `onSelect`\n// and `Icon` (a component) as in React.\n//\n// Reka keeps the popover state, positioning, the dismissable layer and the\n// focus scope. Where Reka's popover differs from Radix's, this port follows\n// Radix so the DOM and behaviour match React:\n// - The trigger is Radix's: its props are merged into the trigger (default\n// or custom) after the child's own handlers, the click toggle is skipped\n// when one called preventDefault(), it carries no `id` of Reka's and sets\n// `aria-controls` only while open (Radix 1.8.1).\n// - Open changes from Reka (dismiss, the trigger's click) are reported only\n// when the state changes, like Radix's controlled state.\n// - A primary pointer down outside dismisses on its click, as in Radix 1.8.1\n// (../Popover/deferredPointerDownOutside.ts).\n// - The content element is rendered here (Reka's `as`): Radix's custom\n// property names (`--radix-popover-*`), no `dir`, no `aria-labelledby`.\n// - React handles events of portalled content at <body>, so stopping one\n// there still runs <body>'s own listeners (the Escape stack). An action's\n// Escape key does the same here (see CustomSelectAction).\n\nexport type OptionContent = string | number | VNode | (() => VNodeChild)\n\nexport type Option<T extends string = string> = {\n value: T\n label: string\n /** Disable the option */\n disabled?: boolean\n /** Displayed as secondary text below the option `label` */\n description?: OptionContent\n tooltip?: {\n content: OptionContent\n maxWidth?: number\n }\n}\n\nexport type OptionGroup<T extends Option> = {\n label: string\n options: T[]\n optionsLimit?: {\n label: string\n limit: number\n }\n}\n\nexport type Options<T extends Option> = T[] | OptionGroup<T>[]\n\ntype CallbackWithActionId = (actionId: string) => void\ntype SearchPredicate<T extends Option> = (option: T, searchTerm: string) => boolean\n\nexport type SelectAction = {\n /** Unique ID to identify the action with */\n id: string\n /** Label display for the action */\n label: string\n /** Icon displayed to the left of the action */\n Icon?: Component\n /** Custom class applied to the action container */\n className?: string\n /** Callback invoked when the action is pressed */\n onSelect: CallbackWithActionId\n}\n\nexport type PopoverSide = \"top\" | \"bottom\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\nexport type CheckPosition = \"start\" | \"end\" | \"none\"\n\nexport type MultiSelectTriggerViewProps<T extends Option> = {\n values: T[]\n selectedAll: boolean\n}\n\nexport type SelectTriggerRenderProps = { open: boolean; onToggle: () => void }\n\ntype ListSize = number | \"auto\"\n\nconst selectProps = {\n /** Options or option groups. Should be a stable reference. */\n options: { type: Array as PropType<Options<Option>>, required: true as const },\n /** Selected value; an array of values with `multiple`. Bind `v-model:value`. */\n value: { type: [String, Array] as PropType<string | string[]>, required: true as const },\n /** Determines if the select should support multiple selection. @default false */\n multiple: { type: Boolean, default: false },\n /** Disables the select visually and from interactions. @default false */\n disabled: { type: Boolean, default: false },\n /** Id of the hidden input, so the select can be targeted with `for` */\n id: String,\n /** Marks the select as a required field when using native form submission */\n required: { type: Boolean, default: undefined },\n /** Creates the ability to query the value with `[name=\"${name}\"]` */\n name: String,\n /** Placeholder text for the select. @default \"Select...\" */\n placeholder: { type: String, default: \"Select...\" },\n /** Placeholder text while loading. @default \"Loading...\" */\n loadingPlaceholder: { type: String, default: \"Loading...\" },\n /** Text of a `multiple` trigger when every option is selected. @default \"All selected\" */\n allSelectedLabel: { type: String, default: \"All selected\" },\n /** Displays loading indicator on top of button contents. @default false */\n loading: { type: Boolean, default: false },\n /** Style variant for the select trigger. @default \"outline\" */\n variant: { type: String as PropType<\"soft\" | \"outline\" | \"ghost\">, default: \"outline\" },\n /** Fully rounded pill shape for the trigger. @default false */\n pill: { type: Boolean, default: false },\n /** Size of the trigger: `3xs` 22px up to `3xl` 48px. @default \"md\" */\n size: { type: String as PropType<ControlSize>, default: \"md\" },\n /** Icon displayed in the far right of the select trigger. @default \"dropdown\" */\n dropdownIconType: { type: String as PropType<DropdownIconType>, default: \"dropdown\" },\n /** Actions to display below the options list. Memoized by length. */\n actions: Array as PropType<SelectAction[]>,\n /** Custom class applied to option containers */\n optionClassName: String,\n /** Component rendering each option (the `#optionView` slot takes precedence) */\n OptionView: [Object, Function] as PropType<Component>,\n /** Component rendering the trigger content (the `#triggerView` slot takes precedence) */\n TriggerView: [Object, Function] as PropType<Component>,\n /** Icon displayed at the start of the select trigger */\n TriggerStartIcon: [Object, Function] as PropType<Component>,\n /** Custom class applied to the select trigger */\n triggerClassName: String,\n /** Applies a negative margin using the current gutter to optically align the trigger. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n /** Display a clear action that allows the select to be unset. @default false */\n clearable: { type: Boolean, default: false },\n /** Extends select to 100% of available width. @default true, except for the ghost variant */\n block: { type: Boolean, default: undefined },\n /** Preferred side of the trigger to render against when open. @default \"bottom\" */\n side: { type: String as PropType<PopoverSide>, default: \"bottom\" },\n /** Preferred alignment against the trigger. @default \"center\" when block, otherwise \"start\" */\n align: String as PropType<PopoverAlign>,\n /** Offset in pixels from the \"start\" or \"end\" alignment. @default 0 */\n alignOffset: Number,\n /** Collision detection of the menu. @default true */\n avoidCollisions: { type: Boolean, default: true },\n /** Width of the menu. @default \"auto\" */\n listWidth: [Number, String] as PropType<ListSize>,\n /** `min-width` of the menu, in pixels. @default the trigger width (300 when not block) */\n listMinWidth: [Number, String] as PropType<ListSize>,\n /** `max-width` of the menu, in pixels. @default \"auto\" */\n listMaxWidth: { type: [Number, String] as PropType<ListSize>, default: \"auto\" },\n /** Predicate used to filter searches */\n searchPredicate: Function as PropType<SearchPredicate<Option>>,\n /** Placeholder of the search input */\n searchPlaceholder: { type: String, default: \"\" },\n /** Accessible name of the search input, independent of the trigger label. @default \"Search options\" */\n searchAriaLabel: { type: String, default: \"Search options\" },\n /** Size of the search input in the menu, such as `2xl` for 44px touch targets on phones. @default \"md\" */\n searchSize: String as PropType<ControlSize>,\n /** Message displayed when search results are empty (or the `#searchEmptyMessage` slot) */\n searchEmptyMessage: { type: [String, Number, Object] as PropType<string | number | VNode>, default: \"No results found.\" },\n /** Position of the check indicator in the option list. @default \"start\" */\n checkPosition: { type: String as PropType<CheckPosition>, default: \"start\" },\n /** Renders a custom trigger (or the `#trigger` slot), wrapped as the popover trigger */\n trigger: Function as PropType<(props: SelectTriggerRenderProps) => VNodeChild>,\n \"ariaLabel\": String,\n \"ariaLabelledby\": String,\n \"ariaDescribedby\": String,\n \"ariaInvalid\": { type: [Boolean, String] as PropType<boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\">, default: undefined },\n}\n\ntype SelectPropsValue = {\n readonly [K in keyof typeof selectProps]: unknown\n} & {\n options: Options<Option>\n value: string | string[]\n multiple: boolean\n disabled: boolean\n id?: string\n required?: boolean\n name?: string\n placeholder: string\n loadingPlaceholder: string\n allSelectedLabel: string\n loading: boolean\n variant: \"soft\" | \"outline\" | \"ghost\"\n pill: boolean\n size: ControlSize\n dropdownIconType: DropdownIconType\n actions?: SelectAction[]\n optionClassName?: string\n OptionView?: Component\n TriggerView?: Component\n TriggerStartIcon?: Component\n triggerClassName?: string\n opticallyAlign?: \"start\" | \"end\"\n clearable: boolean\n block?: boolean\n side: PopoverSide\n align?: PopoverAlign\n alignOffset?: number\n avoidCollisions: boolean\n listWidth?: ListSize\n listMinWidth?: ListSize\n listMaxWidth: ListSize\n searchPredicate?: SearchPredicate<Option>\n searchPlaceholder: string\n searchAriaLabel: string\n searchSize?: ControlSize\n searchEmptyMessage: string | number | VNode\n checkPosition: CheckPosition\n trigger?: (props: SelectTriggerRenderProps) => VNodeChild\n ariaLabel?: string\n ariaLabelledby?: string\n ariaDescribedby?: string\n ariaInvalid?: boolean | string\n}\n\n// ============================================================\n// Contexts\n// ============================================================\n\ntype SelectContextValue = {\n props: SelectPropsValue\n slots: Slots\n /**\n * Bumped on every Select update. Slots are not reactive, so the parts that\n * render one read it to follow a slot that was added, removed or replaced.\n */\n slotsVersion: Ref<number>\n triggerId: string\n /** The default trigger's element (React looks it up by `triggerId`) */\n triggerEl: ShallowRef<HTMLElement | null>\n block: ComputedRef<boolean>\n align: ComputedRef<PopoverAlign>\n alignOffset: ComputedRef<number>\n listMinWidth: ComputedRef<ListSize | undefined>\n searchable: ComputedRef<boolean>\n actions: ShallowRef<SelectAction[]>\n onSelect: (option: Option, removeOption?: boolean) => void\n onActionSelect: CallbackWithActionId\n /** The latest predicate, read without tracking (React keeps it in a ref) */\n searchPredicate: () => SearchPredicate<Option>\n}\n\nconst SelectContextKey: InjectionKey<SelectContextValue> = Symbol(\"PlexUISelect\")\n\nconst useSelectContext = () => {\n const context = inject(SelectContextKey, null)\n\n if (!context) {\n throw new Error(\"Select components must be wrapped in <Select />\")\n }\n\n return context\n}\n\ntype CustomSelectContextValue = {\n open: Ref<boolean>\n handleOpenChange: (maybeNextState?: boolean) => void\n /** Radix's `onOpenChange` of the popover root: reports changes only */\n handleRootOpenChange: (nextState: boolean) => void\n selectContentRef: ShallowRef<HTMLElement | null>\n /** The trigger element, default or custom (React's ref on Popover.Trigger) */\n popoverTriggerEl: ShallowRef<HTMLElement | null>\n}\n\nconst CustomSelectContextKey: InjectionKey<CustomSelectContextValue> = Symbol(\"PlexUICustomSelect\")\n\n// Radix decides \"focus outside\" on the React tree, where a Select opened next\n// to another one is outside it: focus entering the second one's menu closes\n// the first. Reka decides on the DOM and counts a layer later in the document\n// as nested, so the first would stay open. Each Select records its logical\n// parent (the Select whose menu renders it) and its content element, and\n// closes when focus enters the content of a Select not nested in it.\ntype SelectLayer = {\n parent: SelectLayer | null\n content: ShallowRef<HTMLElement | null>\n}\n\nconst SelectLayerKey: InjectionKey<SelectLayer> = Symbol(\"PlexUISelectLayer\")\n\nconst mountedSelectLayers = new Set<SelectLayer>()\n\nconst isNestedIn = (layer: SelectLayer, ancestor: SelectLayer) => {\n for (let parent = layer.parent; parent; parent = parent.parent) {\n if (parent === ancestor) return true\n }\n return false\n}\n\ntype CustomSelectMenuContextValue = {\n openingValue: string\n listId: string\n requestClose: () => void\n listRef: ShallowRef<HTMLElement | null>\n // Highlighting\n highlightedValue: Ref<string>\n // Search\n searchTerm: Ref<string>\n searchInputRef: ShallowRef<HTMLInputElement | null>\n}\n\nconst CustomSelectMenuContextKey: InjectionKey<CustomSelectMenuContextValue> = Symbol(\"PlexUICustomSelectMenu\")\n\nconst useCustomSelectMenuContext = () => {\n const context = inject(CustomSelectMenuContextKey, null)\n\n if (!context) {\n throw new Error(\"CustomSelectMenu components must be wrapped in <CustomSelectMenu />\")\n }\n\n return context\n}\n\nconst renderContent = (content: unknown): VNodeChild =>\n typeof content === \"function\" ? (content as () => VNodeChild)() : (content as VNodeChild)\n\nconst defaultMultiTriggerView = ({ values, selectedAll }: MultiSelectTriggerViewProps<Option>, allSelectedLabel: string) =>\n selectedAll\n ? allSelectedLabel\n : values.length === 0\n ? // NOTE: Zero length is impossible - an empty option with `placeholder` is always returned\n \"Select...\"\n : values.length === 1\n ? values[0]!.label\n : `${values.length} selected`\n\n// ============================================================\n// Select\n// ============================================================\n\nconst SelectComponent = defineComponent({\n name: \"Select\",\n inheritAttrs: false,\n props: selectProps,\n // Untyped here: SelectProps (below) types the payloads by `multiple`, and\n // typed emits would also require each listener to take both shapes\n emits: [\"update:value\", \"change\"],\n setup(rawProps, { emit, slots }) {\n const props = rawProps as unknown as SelectPropsValue\n // Block default is dynamic, based on `variant`\n const block = computed(() => props.block ?? props.variant !== \"ghost\")\n // Align default is dynamic, based on `block`\n const align = computed<PopoverAlign>(() => props.align ?? (block.value ? \"center\" : \"start\"))\n // Flush with the trigger's edge, as the prop documents\n const alignOffset = computed(() => props.alignOffset ?? 0)\n // A menu is never narrower than the field it belongs to. Inline selects keep their 300px floor.\n const listMinWidth = computed(() => props.listMinWidth ?? (block.value ? undefined : 300))\n\n const change = (selection: Option | Option[]) => {\n emit(\"update:value\", Array.isArray(selection) ? selection.map((option) => option.value) : selection.value)\n emit(\"change\", selection)\n }\n\n const onSelect = (selectedOption: Option, removeOption?: boolean) => {\n const { multiple, options } = props\n const value = props.value as string[]\n\n if (multiple) {\n // When clearing values, the value is an empty string\n if (!selectedOption.value) {\n change([])\n return\n }\n\n if (removeOption) {\n const nextValues = value.filter((v) => v !== selectedOption.value)\n change(getOptionsByValues(options, nextValues))\n } else {\n change(getOptionsByValues(options, value).concat(selectedOption))\n }\n } else {\n change(selectedOption)\n }\n }\n\n // It should be exceedingly uncommon to change actions dynamically: like\n // React's memo, the rendered actions only follow a change of length.\n const actions = shallowRef<SelectAction[]>(props.actions ?? [])\n watch(\n () => (props.actions ?? []).length,\n () => {\n actions.value = props.actions ?? []\n },\n )\n // Action callbacks always come from the latest actions\n const onActionSelect = (actionId: string) => {\n ;(props.actions ?? []).find((a) => a.id === actionId)?.onSelect(actionId)\n }\n\n // Determine when custom selects should be used\n const optionsCount = computed(() => {\n const { options } = props\n return isOptionGroupArray(options)\n ? options.reduce((acc: number, group) => acc + group.options.length, 0)\n : options.length\n })\n\n // Locking down searchable count to a single value\n const searchable = computed(() => optionsCount.value > 15)\n\n const slotsVersion = ref(0)\n onBeforeUpdate(() => {\n slotsVersion.value++\n })\n\n provide(SelectContextKey, {\n props,\n slots,\n slotsVersion,\n triggerId: `select-trigger-${useId()}`,\n triggerEl: shallowRef(null),\n block,\n align,\n alignOffset,\n listMinWidth,\n searchable,\n actions,\n onSelect,\n onActionSelect,\n searchPredicate: () => (toRaw(rawProps) as SelectPropsValue).searchPredicate ?? defaultSearchPredicate,\n })\n\n return () => h(CustomSelect)\n },\n})\n\n// ============================================================\n// Trigger\n// ============================================================\n\nconst SelectTrigger = defineComponent({\n name: \"SelectTrigger\",\n inheritAttrs: false,\n props: {\n onOpenChange: Function as PropType<(maybeNextState?: boolean) => void>,\n },\n setup(ownProps, { attrs }) {\n const { props, slots, slotsVersion, triggerId, triggerEl, block, onSelect } = useSelectContext()\n const typeahead = createTypeahead()\n\n const setTriggerEl = (instance: unknown) => {\n triggerEl.value = ((instance as ComponentPublicInstance | null)?.$el as HTMLElement | undefined) ?? null\n }\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const key = evt.key\n const { multiple, value, options } = props\n const firstValue = multiple ? (value as string[])[0] : (value as string)\n\n // If not a command, check for typeahead\n // NOTE: Typeahead not supported in multi-select\n if (!multiple && isTypeaheadKey(evt)) {\n const currentTypeaheadValue = typeahead(key)\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value\n // NOTE: We don't look at current highlighted value as a means to start the search\n const firstMatchingOption = getTypeaheadOption(options, currentTypeaheadValue, firstValue)\n\n if (firstMatchingOption) {\n onSelect(firstMatchingOption)\n }\n }\n }\n\n const handleClearClick = () => {\n onSelect({ value: \"\", label: \"\" })\n // Ensure open state is closed\n ownProps.onOpenChange?.(false)\n }\n\n return () => {\n void slotsVersion.value\n const { multiple, options, loading } = props\n const value = props.value\n const firstValue = multiple ? (value as string[])[0] : (value as string)\n const placeholderValue = loading ? props.loadingPlaceholder : props.placeholder\n const hasSelectedValue = multiple ? (value as string[]).length > 0 : !!value\n const isPlaceholder = loading || !hasSelectedValue\n\n const renderTriggerView = () => {\n let viewProps: Option | MultiSelectTriggerViewProps<Option>\n\n if (multiple) {\n const currentSelectedOptions = getOptionsByValues(options, value as string[])\n const flatOptions = options.flatMap((o) => (\"options\" in o ? o.options : o))\n viewProps = {\n values: currentSelectedOptions.length ? currentSelectedOptions : [{ value: \"\", label: placeholderValue }],\n selectedAll: flatOptions.length <= (value as string[]).length,\n }\n } else {\n viewProps = getOptionByValue(options, firstValue as string) || { value: \"\", label: placeholderValue }\n }\n\n if (slots.triggerView) return slots.triggerView(viewProps)\n if (props.TriggerView) return h(props.TriggerView, viewProps)\n return multiple\n ? defaultMultiTriggerView(viewProps as MultiSelectTriggerViewProps<Option>, props.allSelectedLabel)\n : (viewProps as Option).label\n }\n\n return h(\n SelectControl as Component,\n {\n \"ref\": setTriggerEl,\n \"id\": triggerId,\n \"aria-label\": props.ariaLabel,\n \"aria-labelledby\": props.ariaLabelledby ? `${props.ariaLabelledby} ${triggerId}-value` : undefined,\n \"aria-describedby\": props.ariaDescribedby,\n \"aria-invalid\": props.ariaInvalid,\n \"class\": props.triggerClassName,\n \"selected\": !isPlaceholder,\n \"variant\": props.variant,\n \"pill\": props.pill,\n \"block\": block.value,\n \"size\": props.size,\n \"disabled\": props.disabled,\n \"loading\": loading,\n \"StartIcon\": props.TriggerStartIcon,\n \"opticallyAlign\": props.opticallyAlign,\n \"dropdownIconType\": props.dropdownIconType,\n \"onClearClick\": props.clearable ? handleClearClick : undefined,\n \"onInteract\": ownProps.onOpenChange,\n \"interactOnEnter\": true,\n \"onKeydown\": handleKeyDown,\n // pass along props from the popover trigger\n ...attrs,\n },\n {\n default: () => [\n props.ariaLabelledby ? h(\"span\", { id: `${triggerId}-value` }, [renderTriggerView()]) : renderTriggerView(),\n props.name || props.id\n ? // One input per selected value, so a form submits every value of a\n // multi-select; an empty one keeps `id` and `required` working\n (multiple && (value as string[]).length ? (value as string[]) : [firstValue ?? \"\"]).map((formValue, index) =>\n h(\"input\", {\n \"key\": index,\n \"id\": index === 0 ? props.id : undefined,\n \"name\": props.name,\n \"value\": formValue,\n // A disabled select is neither validated nor submitted\n \"disabled\": props.disabled,\n \"tabindex\": -1,\n \"onFocus\": () => {\n triggerEl.value?.focus()\n },\n // A label's `for` lands here, and its click opens the list like a press on the trigger\n \"onClick\": () => {\n if (!loading) {\n ownProps.onOpenChange?.(true)\n }\n },\n // don't make this readOnly because that prevents the value from being required\n \"required\": props.required,\n \"class\": s.FormInput,\n \"aria-hidden\": \"true\",\n }),\n )\n : null,\n ],\n },\n )\n }\n },\n})\n\n/**\n * Radix's `Popover.Trigger asChild`: Radix's trigger props merged into the\n * child (the default trigger or a custom one), its click toggle after the\n * child's own handlers.\n */\nconst SelectPopoverTrigger = defineComponent({\n name: \"SelectPopoverTrigger\",\n setup(_props, { slots }) {\n const rootContext = injectPopoverRootContext()\n rootContext.contentId ||= useRekaId(undefined, \"reka-popover-content\")\n const { popoverTriggerEl } = inject(CustomSelectContextKey)!\n\n // React's ref on Popover.Trigger: the element the child gives its ref\n // (FloatingLabelSelect's field). Focus returns here on close, the content\n // anchors to it, and pointer-downs on it are not \"outside\".\n const setTriggerRef = (instance: unknown) => {\n popoverTriggerEl.value = resolveElement(instance)\n rootContext.triggerElement.value = popoverTriggerEl.value ?? undefined\n }\n\n const onClick = composeEventHandlers(undefined, () => rootContext.onOpenToggle())\n\n return () => {\n const child = firstElementChild(slots.default?.())\n if (!child) return null\n\n const isOpen = rootContext.open.value\n return h(RekaPopoverAnchor, { asChild: true, reference: popoverTriggerEl.value ?? undefined }, {\n default: () =>\n cloneVNode(\n mergeSlotProps(child, {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? rootContext.contentId : undefined,\n \"data-state\": isOpen ? \"open\" : \"closed\",\n onClick,\n }),\n { ref: setTriggerRef },\n // Keep the child's own ref\n true,\n ),\n })\n }\n },\n})\n\n// ============================================================\n// Custom Select\n// ============================================================\n\nconst CustomSelect = defineComponent({\n name: \"CustomSelect\",\n setup() {\n const { props, slots, slotsVersion, triggerEl } = useSelectContext()\n const open = ref(false)\n const selectContentRef = shallowRef<HTMLElement | null>(null)\n const popoverTriggerEl = shallowRef<HTMLElement | null>(null)\n // Not before mount: server rendering and hydration render no teleport,\n // as Radix's Portal renders nothing before mount\n const mounted = ref(false)\n\n const handleOpenChange = (maybeNextState?: boolean) => {\n // Toggle the current state when called without a specific state\n const nextState = maybeNextState === undefined ? !open.value : maybeNextState\n open.value = nextState\n\n // When we're closing, manage focus back to trigger manually\n if (!nextState) {\n // Read this now: with animations disabled the menu unmounts before the\n // timeout below runs, so selectContentRef is already null by then\n const focusWasInMenu = !!selectContentRef.value?.contains(document.activeElement)\n\n // Wait until the next tick to determine if another element has become focused\n setTimeout(() => {\n const activeElement = document.activeElement\n const menu = selectContentRef.value\n const focusInMenu = !!menu && !!activeElement && menu.contains(activeElement)\n // Focus dropped with the closing menu lands on <body>: it was lost, not moved\n const focusLost = !activeElement || activeElement === document.body\n\n // Focus that moved to another element outside the menu stays there\n if (focusInMenu || (focusWasInMenu && focusLost)) {\n popoverTriggerEl.value?.focus()\n }\n })\n }\n }\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n const handleRootOpenChange = (nextState: boolean) => {\n // Radix's controlled state reports changes only\n if (nextState === open.value) return\n\n // Prevent opening while loading\n if (props.loading && nextState) {\n return\n }\n\n handleOpenChange(nextState)\n }\n\n provide(CustomSelectContextKey, {\n open,\n handleOpenChange,\n handleRootOpenChange,\n selectContentRef,\n popoverTriggerEl,\n })\n\n const layer: SelectLayer = { parent: inject(SelectLayerKey, null), content: selectContentRef }\n provide(SelectLayerKey, layer)\n\n // Focus entering another Select's menu is outside this one, unless that\n // Select is nested in this one's menu (see SelectLayer)\n const handleFocusIn = (evt: FocusEvent) => {\n const target = evt.target as Node | null\n if (!open.value || !target) return\n for (const other of mountedSelectLayers) {\n if (other !== layer && other.content.value?.contains(target) && !isNestedIn(other, layer)) {\n handleRootOpenChange(false)\n return\n }\n }\n }\n\n let listenerDocument: Document | null = null\n onMounted(() => {\n mounted.value = true\n mountedSelectLayers.add(layer)\n listenerDocument = triggerEl.value?.ownerDocument ?? document\n listenerDocument.addEventListener(\"focusin\", handleFocusIn)\n })\n onBeforeUnmount(() => {\n mountedSelectLayers.delete(layer)\n listenerDocument?.removeEventListener(\"focusin\", handleFocusIn)\n listenerDocument = null\n })\n\n const renderTrigger = () => {\n const renderProps: SelectTriggerRenderProps = {\n open: open.value,\n onToggle: () => {\n open.value = !open.value\n },\n }\n if (slots.trigger) return slots.trigger(renderProps)\n if (props.trigger) return props.trigger(renderProps)\n return h(SelectTrigger, { onOpenChange: handleOpenChange })\n }\n\n return () => {\n void slotsVersion.value\n return h(\n RekaPopoverRoot,\n { \"open\": open.value, \"onUpdate:open\": handleRootOpenChange, \"modal\": false },\n {\n default: () => [\n h(SelectPopoverTrigger, null, { default: renderTrigger }),\n // Without animations React replaces the menu's wrapper when it\n // opens or closes (see TransitionGroup), so React DOM appends the\n // new one to <body>. A Teleport keeps its place in <body>: a new\n // one per state moves the wrapper to the end the same way. With\n // animations the group has to stay, to run the exit.\n h(RekaPopoverPortal, { key: !getDisableAnimations() || open.value ? \"open\" : \"closed\", forceMount: mounted.value }, {\n default: () => [\n h(\n TransitionGroup,\n { class: s.Menu, ...overlayTiming, overlay: true },\n { default: () => [open.value ? h(SelectPopoverContent, { key: \"dropdown\" }) : createCommentVNode()] },\n ),\n ],\n }),\n ],\n },\n )\n }\n },\n})\n\n// The element Reka's content renders (`as`). Raw: Reka passes `as` through\n// reactive props, and Vue warns about a component made reactive.\nconst SelectContentElement = markRaw(\n defineComponent({\n name: \"SelectContentElement\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const { selectContentRef } = inject(CustomSelectContextKey)!\n const setContentRef = (el: unknown) => {\n selectContentRef.value = (el as HTMLElement | null) ?? null\n }\n\n return () => {\n const { \"dir\": _dir, \"aria-labelledby\": _labelledBy, \"forceMount\": _forceMount, style, ...rest } = attrs\n return h(\"div\", { ...rest, style: withRadixVariableNames(style, \"popover\"), ref: setContentRef }, slots.default?.())\n }\n },\n }),\n)\n\nconst SelectPopoverContent = defineComponent({\n name: \"SelectPopoverContent\",\n setup() {\n const { props, align, alignOffset, listMinWidth } = useSelectContext()\n const { handleRootOpenChange, popoverTriggerEl } = inject(CustomSelectContextKey)!\n // Radix (1.8.1) dismisses on the click that follows a primary pointer down outside\n const { onPointerDownOutside, onFocusOutside } = useDeferredPointerDownOutside((originalEvent) => {\n // The trigger is not outside: Radix's non-modal content keeps the popover open\n if (popoverTriggerEl.value?.contains(originalEvent.target as Node | null)) return\n handleRootOpenChange(false)\n })\n\n return () =>\n h(\n RekaPopoverContent,\n {\n forceMount: true,\n as: SelectContentElement,\n class: s.MenuList,\n \"data-pill\": props.pill ? \"\" : undefined,\n side: props.side,\n sideOffset: 5,\n align: align.value,\n alignOffset: alignOffset.value,\n avoidCollisions: props.avoidCollisions,\n collisionPadding: { bottom: 30, top: 30 },\n // Prevent Reka's auto focus so we can handle our own from within <CustomSelectMenu />\n onOpenAutoFocus: preventDefaultHandler,\n onCloseAutoFocus: preventDefaultHandler,\n onEscapeKeyDown: preventDefaultHandler,\n onPointerDownOutside,\n onFocusOutside,\n style: toCssVariables({\n \"select-list-width\": props.listWidth,\n \"select-list-min-width\": listMinWidth.value,\n \"select-list-max-width\": props.listMaxWidth,\n }),\n },\n { default: () => h(CustomSelectMenu) },\n )\n },\n})\n\n/**\n * Focuses an element that mounted in this tick. Vue skips a listener for an\n * event stamped (`_vts`) no later than the moment the listener was attached\n * (a time cached for the tick), so a focus fired within the millisecond the\n * menu mounted would not reach the search Input's own focus listener once\n * Reka's capture listener has stamped it: its `data-focused` would stay\n * \"false\", while React's onFocus always runs. The focus events are stamped\n * one millisecond later for the listeners on their way.\n *\n * `_vts` is a private field of Vue's runtime-dom event invoker. Deferring the\n * focus instead was tried and breaks parity, because React focuses\n * synchronously in its mount effect: in the next animation frame, keys and\n * Escape pressed right after opening reach the trigger, not the menu; in a\n * 1ms timeout (a 0ms one fires within the same millisecond and is skipped\n * too), a menu opened and closed quickly takes focus after closing. Should\n * Vue drop the field, the stamp is ignored and only the search input's\n * `data-focused` is affected.\n */\nconst focusMounted = (element: HTMLElement) => {\n const view = element.ownerDocument.defaultView\n const stamp = (event: Event) => {\n const vueEvent = event as Event & { _vts?: number }\n if (event.target === element && !vueEvent._vts) vueEvent._vts = Date.now() + 1\n }\n\n view?.addEventListener(\"focus\", stamp, { capture: true })\n view?.addEventListener(\"focusin\", stamp, { capture: true })\n try {\n element.focus({ preventScroll: true })\n } finally {\n view?.removeEventListener(\"focus\", stamp, { capture: true })\n view?.removeEventListener(\"focusin\", stamp, { capture: true })\n }\n}\n\nconst CustomSelectMenu = defineComponent({\n name: \"CustomSelectMenu\",\n setup() {\n const { props, searchable, searchPredicate } = useSelectContext()\n const { handleOpenChange } = inject(CustomSelectContextKey)!\n const menuRef = shallowRef<HTMLElement | null>(null)\n const listRef = shallowRef<HTMLElement | null>(null)\n const searchInputRef = shallowRef<HTMLInputElement | null>(null)\n const searchTerm = ref(\"\")\n const multiple = props.multiple\n const value = props.value\n const highlightedValue = ref<string>(\n ((multiple ? (value as string[])[0] : (value as string)) || getFirstValidOption(props.options)?.value) ?? \"\",\n )\n const typeahead = createTypeahead()\n const listId = `select-list-${useId()}`\n\n // Lock `value` for a given open to prevent janky change during close animation\n // MultiSelect reads its live selection instead of this per-open snapshot.\n const openingValue = multiple ? \"\" : (value as string)\n\n // Trim and lowercase search value\n const literalSearchTerm = computed(() => searchTerm.value.trim().toLocaleLowerCase())\n const filteredOptions = computed(() => filterOptions(props.options, literalSearchTerm.value, searchPredicate()))\n const firstOption = computed(() => getFirstValidOption(filteredOptions.value))\n\n const requestClose = () => handleOpenChange(false)\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const key = evt.key\n const multiple = props.multiple\n const value = props.value\n const firstValue = multiple ? (value as string[])[0] : (value as string)\n const currentHighlightedValue = highlightedValue.value\n const targetValue = currentHighlightedValue || firstOption.value?.value || firstValue\n const isFocusedInSearch = document.activeElement === searchInputRef.value\n\n const menuElement = menuRef.value\n\n // Should be generally impossible for the menu element to not exist\n if (!menuElement) {\n return\n }\n\n const triggerHighlightedOption = () => {\n const pointerUpEvent = new PointerEvent(\"pointerup\", {\n bubbles: true,\n cancelable: true,\n pointerType: \"mouse\",\n })\n\n // Find the current highlighted option\n const selectedOption = findOptionByValue(currentHighlightedValue, menuElement)\n selectedOption?.dispatchEvent(pointerUpEvent)\n }\n\n const highlightOption = (val: string, element: Element) => {\n highlightedValue.value = val\n element.scrollIntoView({ block: \"nearest\" })\n }\n\n const highlightSelectedOrFirstOption = () => {\n // Attempt to move highlight to selected item\n const maybeFirstValue = multiple ? (value as string[])[0] : (value as string)\n\n if (maybeFirstValue) {\n const selectedElement = findOptionByValue(maybeFirstValue, menuElement)\n\n if (selectedElement) {\n highlightOption(maybeFirstValue, selectedElement)\n return\n }\n }\n\n // If value isn't set, or the selected node wasn't found in the DOM,\n // attempt to move focus to the first valid option.\n const firstValidOption = getFirstValidOption(props.options)\n\n if (firstValidOption) {\n const firstValidOptionElement = findOptionByValue(firstValidOption.value, menuElement)\n if (firstValidOptionElement) {\n highlightOption(firstValidOption.value, firstValidOptionElement)\n }\n }\n }\n\n // Commands\n switch (key) {\n case \"ArrowDown\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!currentHighlightedValue || !findOptionByValue(currentHighlightedValue, menuElement)) {\n highlightSelectedOrFirstOption()\n return\n }\n\n // Otherwise, move to the next option\n const nextElement = findNextOption(currentHighlightedValue, menuElement)\n const nextValue = nextElement?.getAttribute(\"data-option-id\")\n if (nextElement && nextValue) {\n highlightOption(nextValue, nextElement)\n }\n\n return\n }\n case \"ArrowUp\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!currentHighlightedValue || !findOptionByValue(currentHighlightedValue, menuElement)) {\n highlightSelectedOrFirstOption()\n return\n }\n\n const previousElement = findPreviousOption(targetValue as string, menuElement)\n const previousValue = previousElement?.getAttribute(\"data-option-id\")\n if (previousElement && previousValue) {\n highlightOption(previousValue, previousElement)\n }\n\n return\n }\n case \"Enter\":\n // Prevent default enter behavior from the search input, if present\n evt.preventDefault()\n\n // Send a pointerup event into the currently highlighted option\n triggerHighlightedOption()\n\n return\n case \" \":\n // Allow spaces in search, and don't treat as enter\n // if there is a valid literalSearchTerm.\n if (literalSearchTerm.value && isFocusedInSearch) {\n return\n }\n\n // Prevent space from entering search input\n evt.preventDefault()\n\n // Send a pointerup event into the currently highlighted option\n triggerHighlightedOption()\n\n return\n default:\n break\n }\n\n // If not a command, check for typeahead\n if (isTypeaheadKey(evt)) {\n // Skip typeahead logic when we're focused in the search input\n if (isFocusedInSearch) {\n return\n }\n\n // Extend the current typeahead and get the latest value\n const currentTypeaheadValue = typeahead(key)\n\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value, starting at the highlighted value\n const firstMatchingOption = getTypeaheadOption(props.options, currentTypeaheadValue, currentHighlightedValue)\n\n if (firstMatchingOption) {\n const matchedNode = findOptionByValue(firstMatchingOption.value, menuElement)\n\n // Only change the highlight if we found the actual node\n if (matchedNode) {\n highlightedValue.value = firstMatchingOption.value\n // Ensure the newly highlighted option is scrolled into view\n matchedNode.scrollIntoView({ block: \"nearest\" })\n }\n }\n }\n }\n\n provide(CustomSelectMenuContextKey, {\n openingValue,\n listId,\n requestClose,\n listRef,\n highlightedValue,\n searchTerm,\n searchInputRef,\n })\n\n // The focused element (the search input, or the list without one) points\n // assistive tech at the highlighted option, when that option is rendered\n const syncActiveDescendant = () => {\n const target = searchInputRef.value || listRef.value\n if (!target || !menuRef.value) {\n return\n }\n\n const highlightedOption = highlightedValue.value ? findOptionByValue(highlightedValue.value, menuRef.value) : null\n if (highlightedOption?.id) {\n target.setAttribute(\"aria-activedescendant\", highlightedOption.id)\n } else {\n target.removeAttribute(\"aria-activedescendant\")\n }\n }\n watch([highlightedValue, filteredOptions], syncActiveDescendant, { flush: \"post\" })\n\n // On mount behavior\n onMounted(() => {\n syncActiveDescendant()\n\n // Like React's mount effect, the scroll target is the highlight at mount\n const initialHighlightedValue = highlightedValue.value\n\n // Ensure initial highlighted option is in view\n // NOTE: Allowing for a render frame ensures content is positioned correctly before scrolling it into view.\n waitForAnimationFrame(() => {\n if (!menuRef.value) {\n return\n }\n\n // Ensure the highlighted option is in view\n const currentOption = findOptionByValue(initialHighlightedValue, menuRef.value)\n // Scroll the selected item into view, and its bottom edge.\n currentOption?.scrollIntoView({ block: \"center\" })\n })\n\n // Send initial focus to the search input, or the list without one (the\n // menu container when there are no options), to capture key events\n const autoFocusTarget = searchInputRef.value || listRef.value || menuRef.value\n // A tick later: until Reka's focus scope here has registered, a Dialog\n // around the menu sends the focus straight back, and the menu takes that\n // for focus moving outside and closes. No key can come between.\n if (autoFocusTarget) nextTick(() => focusMounted(autoFocusTarget))\n })\n\n // On search behavior (React's layout effect on `filteredOptions`, skipped on mount)\n watch(\n filteredOptions,\n (nextFilteredOptions, previousFilteredOptions) => {\n // Impossible while mounted, list ref will exist\n if (!listRef.value) {\n return\n }\n\n // The same list again, as after a pick in a multiple list: nothing moves\n if (optionValues(nextFilteredOptions) === optionValues(previousFilteredOptions)) {\n return\n }\n\n // Reset scroll position to the top\n listRef.value.scrollTop = 0\n\n // Highlight first item in the list\n const maybeFirstOption = getFirstValidOption(nextFilteredOptions)\n if (maybeFirstOption) highlightedValue.value = maybeFirstOption.value\n },\n { flush: \"post\" },\n )\n\n return () =>\n h(\n \"div\",\n {\n class: s.MenuInner,\n onKeydown: handleKeyDown,\n ref: menuRef,\n // Without search, the list takes focus (and the tab stop); the container\n // stays focusable so a click on it keeps the keys here\n tabindex: !searchable.value && filteredOptions.value.length ? -1 : 0,\n },\n [\n searchable.value\n ? h(CustomSelectSearch, {\n \"value\": searchTerm.value,\n \"hasResults\": !!filteredOptions.value.length,\n \"onUpdate:value\": (next: string) => {\n searchTerm.value = next\n },\n })\n : null,\n h(CustomSelectList, { filteredOptions: filteredOptions.value }),\n h(CustomSelectActions),\n ],\n )\n },\n})\n\nconst CustomSelectSearch = defineComponent({\n name: \"CustomSelectSearch\",\n props: {\n value: { type: String, required: true },\n /** Whether the list is rendered, for `aria-controls` */\n hasResults: { type: Boolean, required: true },\n },\n emits: {\n \"update:value\": (_value: string) => true,\n },\n setup(props, { emit }) {\n const { props: selectProps } = useSelectContext()\n const { listId, searchInputRef } = useCustomSelectMenuContext()\n const searchRef = shallowRef<HTMLElement | null>(null)\n\n // React's `ref` on Input is its <input>. Read before the menu's mount\n // focus runs (child mounted hooks run first); an exposed component ref\n // is not populated that early.\n onMounted(() => {\n searchInputRef.value = searchRef.value?.querySelector(\"input\") ?? null\n })\n onBeforeUnmount(() => {\n searchInputRef.value = null\n })\n\n return () =>\n h(\"div\", { class: s.Search, ref: searchRef }, [\n h(\n Input,\n {\n \"value\": props.value,\n \"size\": selectProps.searchSize,\n \"variant\": \"ghost\",\n \"pill\": true,\n \"placeholder\": selectProps.searchPlaceholder,\n \"aria-label\": selectProps.searchAriaLabel,\n \"onUpdate:value\": (next: string) => emit(\"update:value\", next),\n // The native attribute: it reaches the <input> whether or not\n // Input forwards its `autoComplete` prop (React's Input does)\n \"autocomplete\": \"off\",\n \"autocorrect\": \"off\",\n \"spellcheck\": false,\n \"aria-autocomplete\": \"list\",\n \"role\": \"combobox\",\n // The list, while there is one: with no results it is not rendered\n \"aria-controls\": props.hasResults ? listId : undefined,\n \"aria-expanded\": true,\n },\n {\n startAdornment: () =>\n h(Search, { width: 16, height: 16, class: \"fill-secondary\", fill: \"var(--color-text-secondary)\" }),\n },\n ),\n ])\n },\n})\n\nconst isOptionGroup = <T extends Option>(mixedOption: T | OptionGroup<T>): mixedOption is OptionGroup<T> => {\n return \"options\" in mixedOption\n}\n\nconst isOptionGroupArray = <T extends Option>(arr: Options<T>): arr is OptionGroup<T>[] => {\n return !!arr[0] && isOptionGroup(arr[0])\n}\n\nconst optionValues = <T extends Option>(options: Options<T>) =>\n (isOptionGroupArray(options) ? options.flatMap((group) => group.options) : options)\n .map((option) => option.value)\n .join(\"\\n\")\n\nconst HARD_OPTIONS_LIMIT = 300\n\nconst CustomSelectList = defineComponent({\n name: \"CustomSelectList\",\n props: {\n filteredOptions: { type: Array as PropType<Options<Option>>, required: true },\n },\n setup(props) {\n const { props: selectProps, slots, slotsVersion, triggerId, searchable } = useSelectContext()\n const { listId, listRef } = useCustomSelectMenuContext()\n const setListRef = (el: unknown) => {\n listRef.value = (el as HTMLElement | null) ?? null\n }\n\n return () => {\n void slotsVersion.value\n const { filteredOptions } = props\n\n if (!filteredOptions.length) {\n if (slots.searchEmptyMessage) {\n return h(\"div\", { class: s.SearchEmpty }, slots.searchEmptyMessage())\n }\n\n const { searchEmptyMessage } = selectProps\n return typeof searchEmptyMessage === \"string\"\n ? h(\"p\", { \"class\": s.SearchEmpty, \"data-text-only\": \"true\" }, searchEmptyMessage)\n : h(\"div\", { class: s.SearchEmpty }, [searchEmptyMessage as VNodeChild])\n }\n\n // We hard limit within groups, so at this level we will only limit flat arrays\n const isGrouped = isOptionGroupArray(filteredOptions)\n const hasHardLimit = !isGrouped && filteredOptions.length > HARD_OPTIONS_LIMIT\n\n const options = isGrouped\n ? filteredOptions.map((group) => h(CustomSelectGroup, { key: group.label, group }))\n : (filteredOptions as Option[])\n .slice(0, HARD_OPTIONS_LIMIT)\n .map((option) => h(CustomSelectOption, { key: option.value, option }))\n\n const { ariaLabel, ariaLabelledby } = selectProps\n const customTrigger = !!(slots.trigger || selectProps.trigger)\n return h(\n \"div\",\n {\n \"id\": listId,\n \"class\": s.OptionsList,\n \"ref\": setListRef,\n \"role\": \"listbox\",\n // Named like the trigger: its label, or the default trigger itself\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby ?? (ariaLabel || customTrigger ? undefined : triggerId),\n \"aria-multiselectable\": selectProps.multiple || undefined,\n // Without search, the list is the focused element\n \"tabindex\": searchable.value ? undefined : 0,\n },\n [\n ...options,\n hasHardLimit ? h(CustomSelectHardLimit, { numHidden: filteredOptions.length - HARD_OPTIONS_LIMIT }) : null,\n ],\n )\n }\n },\n})\n\nconst DEFAULT_OPTIONS_LIMIT = {\n limit: 100,\n label: \"Show all\",\n}\n\nconst CustomSelectGroup = defineComponent({\n name: \"CustomSelectGroup\",\n props: {\n group: { type: Object as PropType<OptionGroup<Option>>, required: true },\n },\n setup(props) {\n const groupId = useId()\n const headingId = useId()\n const { searchTerm, highlightedValue } = useCustomSelectMenuContext()\n const limitExpanded = ref(false)\n\n return () => {\n const { label, options, optionsLimit = DEFAULT_OPTIONS_LIMIT } = props.group\n const hasExpandableLimit = optionsLimit.limit < options.length && !searchTerm.value && !limitExpanded.value\n const hasHardLimit = HARD_OPTIONS_LIMIT < options.length && !hasExpandableLimit\n\n let maybeLimitedOptions = options\n if (hasExpandableLimit) {\n maybeLimitedOptions = options.slice(0, optionsLimit.limit)\n } else if (hasHardLimit) {\n maybeLimitedOptions = options.slice(0, HARD_OPTIONS_LIMIT)\n }\n\n const handleLimitExpanded = () => {\n // Expand options\n limitExpanded.value = true\n\n // Set highlight to the first option from the newly expanded list\n highlightedValue.value = options[optionsLimit.limit]!.value\n }\n\n // A group named by its heading. NOTE: The arrow keys walk every option in\n // document order (findNextOption), so they cross from group to group.\n return h(\"div\", { \"role\": \"group\", \"aria-labelledby\": headingId, \"class\": s.OptionGroup }, [\n // No indicator slot: the heading labels the whole section\n h(\"div\", { id: headingId, class: s.OptionGroupHeading }, label),\n ...maybeLimitedOptions.map((option) => h(CustomSelectOption, { key: option.value, option })),\n hasExpandableLimit\n ? h(CustomSelectExpandableLimit, {\n value: `group-limit-${groupId}`,\n label: optionsLimit.label,\n onPointerUp: handleLimitExpanded,\n })\n : null,\n hasHardLimit ? h(CustomSelectHardLimit, { numHidden: options.length - HARD_OPTIONS_LIMIT }) : null,\n ])\n }\n },\n})\n\nconst CustomSelectHardLimit = defineComponent({\n name: \"CustomSelectHardLimit\",\n props: {\n numHidden: { type: Number, required: true },\n },\n setup(props) {\n const { props: selectProps } = useSelectContext()\n\n return () =>\n h(\"div\", { class: s.OptionHardLimitHeading }, [\n // The note lines up with the option labels above it, so it borrows their indicator column.\n selectProps.checkPosition === \"start\" ? h(\"div\", { class: s.OptionIndicatorSlot }) : null,\n `…and ${props.numHidden.toLocaleString()} more options. Use search to refine results further.`,\n ])\n },\n})\n\nconst CustomSelectExpandableLimit = defineComponent({\n name: \"CustomSelectExpandableLimit\",\n props: {\n value: { type: String, required: true },\n label: { type: String, required: true },\n onPointerUp: { type: Function as PropType<() => void>, required: true },\n },\n setup(props) {\n const { props: selectProps } = useSelectContext()\n const { highlightedValue } = useCustomSelectMenuContext()\n const optionId = useId()\n\n const handlePointerMove = () => {\n if (props.value === highlightedValue.value) {\n return\n }\n\n highlightedValue.value = props.value\n }\n\n const handlePointerLeave = () => {\n // Clear the highlight only if it is this one\n if (highlightedValue.value === props.value) {\n highlightedValue.value = \"\"\n }\n }\n\n // This component acts a LOT like an Option, but has enough bespoke behavior\n // that it cannot literally be one.\n return () => {\n const isHighlighted = props.value === highlightedValue.value\n\n return h(\n \"div\",\n {\n \"id\": optionId,\n \"class\": clsx(s.Option, s.OptionsLimit),\n \"data-option-id\": props.value,\n \"data-highlight\": isHighlighted ? \"\" : undefined,\n // Not selectable: no aria-selected\n \"role\": \"option\",\n \"onPointerup\": props.onPointerUp,\n \"onPointermove\": handlePointerMove,\n \"onPointerleave\": handlePointerLeave,\n },\n [\n h(\"div\", { class: clsx(s.PressableInner, s.OptionInner) }, [\n // The row lines up with the option labels above it, so it borrows their indicator column.\n selectProps.checkPosition === \"start\" ? h(\"div\", { class: s.OptionIndicatorSlot }) : null,\n props.label,\n ]),\n ],\n )\n }\n },\n})\n\nconst INTERNAL_DOM_SELECTION_DATA_ATTR = \"data-option-id\"\n\nconst CustomSelectOption = defineComponent({\n name: \"CustomSelectOption\",\n props: {\n option: { type: Object as PropType<Option>, required: true },\n },\n setup(props) {\n const { props: selectProps, slots, slotsVersion, onSelect } = useSelectContext()\n const { openingValue, requestClose, highlightedValue } = useCustomSelectMenuContext()\n // Referenced by the list's aria-activedescendant while highlighted\n const optionId = useId()\n\n // NOTE: SingleSelect mode keeps the opening value instead of the live value\n // to avoid selecting the item as the select closes.\n const isSelected = () =>\n selectProps.multiple\n ? (selectProps.value as string[]).includes(props.option.value)\n : props.option.value === openingValue\n\n const handlePointerUp = () => {\n if (selectProps.multiple) {\n // Trigger the change, optionally as a remove\n onSelect(props.option, isSelected())\n } else {\n onSelect(props.option)\n // Request the dropdown to close\n requestClose()\n }\n }\n\n const handlePointerMove = () => {\n if (props.option.value === highlightedValue.value) {\n return\n }\n\n highlightedValue.value = props.option.value\n }\n\n const handlePointerLeave = () => {\n // Clear the highlight only if it is this one, removing the active highlight on the menu.\n if (highlightedValue.value === props.option.value) {\n highlightedValue.value = \"\"\n }\n }\n\n const renderOptionView = (option: Option): VNodeChild => {\n if (slots.optionView) return slots.optionView(option)\n if (selectProps.OptionView) return h(selectProps.OptionView, option)\n return option.label\n }\n\n const renderTooltip = (tooltip: NonNullable<Option[\"tooltip\"]>) => {\n const content = tooltip.content\n return typeof content === \"function\"\n ? h(Tooltip, { maxWidth: tooltip.maxWidth, side: \"right\" }, { default: () => h(Info), content })\n : h(Tooltip, { content, maxWidth: tooltip.maxWidth, side: \"right\" }, { default: () => h(Info) })\n }\n\n return () => {\n void slotsVersion.value\n const { option } = props\n const { value, disabled, tooltip } = option\n const selected = isSelected()\n const isHighlighted = value === highlightedValue.value\n const checkPosition = selectProps.checkPosition\n\n return h(\n \"div\",\n {\n \"id\": optionId,\n \"class\": clsx(s.Option, selectProps.optionClassName),\n \"data-highlight\": isHighlighted ? \"\" : undefined,\n \"role\": \"option\",\n // The selection; the highlight is the list's aria-activedescendant\n \"aria-selected\": selected,\n \"data-selected\": selected ? \"\" : undefined,\n // Internal attribute for selecting DOM nodes\n [INTERNAL_DOM_SELECTION_DATA_ATTR]: value,\n // Allow options to behave like a native select, when you can open and select an item in a single click\n ...(disabled ? {} : pressHandlers(handlePointerUp)),\n // Pointer move prevents contention between keyboard presses and a still mouse\n \"onPointermove\": disabled ? undefined : handlePointerMove,\n \"onPointerleave\": disabled ? undefined : handlePointerLeave,\n \"aria-disabled\": disabled,\n \"data-disabled\": disabled ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.PressableInner }, [\n checkPosition === \"start\"\n ? h(\"div\", { \"class\": s.OptionIndicatorSlot, \"data-position\": \"start\" }, [\n selected ? h(Check, { class: s.OptionCheck }) : null,\n ])\n : null,\n h(\"div\", { class: s.OptionLeading }, [\n h(\"div\", { class: s.OptionInner }, [renderOptionView(option), tooltip ? renderTooltip(tooltip) : null]),\n // React's `description && ...`: a 0 (or NaN) renders as text\n option.description &&\n h(\"div\", { class: clsx(s.OptionInner, s.OptionDescription) }, [renderContent(option.description)]),\n ]),\n checkPosition === \"end\"\n ? h(\"div\", { \"class\": s.OptionIndicatorSlot, \"data-position\": \"end\" }, [\n selected ? h(Check, { class: s.OptionCheck }) : null,\n ])\n : null,\n ]),\n ],\n )\n }\n },\n})\n\nconst CustomSelectActions = defineComponent({\n name: \"CustomSelectActions\",\n setup() {\n const { actions } = useSelectContext()\n\n return () => {\n if (actions.value.length === 0) {\n return null\n }\n\n return h(\n \"div\",\n { class: s.ActionsContainer },\n actions.value.map((action) => h(CustomSelectAction, { key: action.id, action })),\n )\n }\n },\n})\n\n/**\n * React handles events of the portalled menu at <body> and stops a synthetic\n * event there: <body>'s own listeners (the Escape stack) still run, the\n * document's and window's do not. Stopping the native event here instead\n * would keep it from <body>.\n */\nconst stopAfterBody = (evt: Event) => {\n const body = (evt.currentTarget as Node | null)?.ownerDocument?.body\n if (!body) {\n evt.stopPropagation()\n return\n }\n body.addEventListener(\n evt.type,\n (event) => {\n if (event === evt) event.stopPropagation()\n },\n { once: true },\n )\n}\n\nconst CustomSelectAction = defineComponent({\n name: \"CustomSelectAction\",\n props: {\n action: { type: Object as PropType<SelectAction>, required: true },\n },\n setup(props) {\n const { onActionSelect } = useSelectContext()\n const { requestClose } = useCustomSelectMenuContext()\n\n const handlePointerUp = () => {\n // Trigger the action through the context helper, not the method on this action (it may be a stale reference)\n onActionSelect(props.action.id)\n // Request to close the dropdown\n requestClose()\n }\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const key = evt.key\n\n switch (key) {\n case \"Tab\":\n // Allow tabbing to pass propagation as normal, which bubbles up to the focus scope\n break\n case \"Enter\":\n case \" \":\n evt.stopPropagation()\n handlePointerUp()\n break\n case \"Escape\":\n // The menu's key handler ignores Escape; the Escape stack on <body> closes the menu\n stopAfterBody(evt)\n break\n default:\n evt.stopPropagation()\n }\n }\n\n return () => {\n const { label, Icon, className } = props.action\n return h(\"div\", { class: s.Action, ...pressHandlers(handlePointerUp), onKeydown: handleKeyDown, tabindex: 0 }, [\n h(\"div\", { class: clsx(s.ActionInner, className) }, [Icon ? h(Icon, { role: \"presentation\" }) : null, label]),\n ])\n }\n },\n})\n\n// ============================================================\n// Utilities\n// ============================================================\nconst defaultSearchPredicate = (option: Option, searchTerm: string) => option.label.toLowerCase().includes(searchTerm)\n\nconst filterOptions = <T extends Option>(\n options: Options<T>,\n searchTerm: string,\n searchIterator: SearchPredicate<T>,\n): Options<T> => {\n const searchValue = searchTerm.trim().toLocaleLowerCase()\n\n if (!searchValue) {\n return options\n }\n\n const filterOption = (option: T): boolean => searchIterator(option, searchValue)\n\n if (isOptionGroupArray(options)) {\n return options.reduce((acc, group) => {\n const filtered = group.options.filter(filterOption)\n\n if (filtered.length) {\n acc.push({\n ...group,\n options: filtered,\n })\n }\n return acc\n }, [] as OptionGroup<T>[])\n } else {\n return (options as T[]).reduce((acc, option) => {\n if (filterOption(option)) acc.push(option)\n return acc\n }, [] as T[])\n }\n}\n\nconst getFirstValidOption = <T extends Option>(options: Options<T>): T | undefined => {\n if (!options.length) {\n return undefined\n }\n\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const firstNonDisabled = opt.options.find((i) => !i.disabled)\n if (firstNonDisabled) {\n found = firstNonDisabled\n break\n }\n } else {\n if (!opt.disabled) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionByValue = <T extends Option>(options: Options<T>, value: string): T | undefined => {\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.find((i) => i.value === value)\n if (exists) {\n found = exists\n break\n }\n } else {\n if (opt.value === value) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionsByValues = <T extends Option>(options: Options<T>, values: string[]): T[] => {\n let found: T[] = []\n const lookup = new Set(values)\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.filter((i) => lookup.has(i.value))\n found = found.concat(exists)\n } else {\n if (lookup.has(opt.value)) {\n found.push(opt)\n }\n }\n }\n\n return found\n}\n\nconst MAX_DOM_CRAWLS = 40\n\nconst findOptionByValue = (currentValue: string, container: HTMLElement) =>\n container.querySelector(`[data-option-id=\"${CSS.escape(currentValue)}\"]`)\n\nconst isValidOptionNode = (node: Element) => node.matches(\"[data-option-id]:not([data-disabled])\")\n\n// Steps from the current option to the nearest enabled one, one option row at a\n// time in document order: across groups (siblings would stop at a group's\n// edge), skipping disabled rows, at most MAX_DOM_CRAWLS rows away\nconst findAdjacentOption = (currentValue: string, container: HTMLElement, step: 1 | -1) => {\n const currentOption = findOptionByValue(currentValue, container)\n const rows = Array.from(container.querySelectorAll(\"[data-option-id]\"))\n\n let index = currentOption ? rows.indexOf(currentOption) : -1\n if (index === -1) {\n return undefined\n }\n\n for (let maxSteps = 0; maxSteps < MAX_DOM_CRAWLS; maxSteps += 1) {\n index += step\n const nextNode = rows[index]\n\n if (!nextNode) {\n return undefined\n }\n\n if (isValidOptionNode(nextNode)) {\n return nextNode\n }\n }\n}\n\nconst findNextOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, 1)\n\nconst findPreviousOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, -1)\n\nconst createTypeahead = () => {\n let currentValue: string = \"\"\n let timeoutId: ReturnType<typeof setTimeout> | undefined\n\n return (char: string) => {\n // Searching is case-insensitive\n char = char.toLowerCase()\n\n // Add the new character to the current value\n currentValue += char\n\n // Clear the previous timeout if there was one\n if (timeoutId) clearTimeout(timeoutId)\n\n // Reset the value after a brief delay\n timeoutId = setTimeout(() => {\n currentValue = \"\"\n }, 500)\n\n // When a user is typing the same value, like \"llll\", assume they are cycling through items starting with \"l\"\n const isCycling = char.repeat(currentValue.length) === currentValue\n\n // Return the typeahead value\n return isCycling ? char : currentValue\n }\n}\n\nconst isValidTypeaheadChar = (char: string): boolean => /^[a-zA-Z0-9]$/.test(char)\n\n// A shortcut (Ctrl+C, Cmd+A, Alt+letter) or a key another handler took is not typeahead\nconst isTypeaheadKey = (evt: KeyboardEvent): boolean =>\n isValidTypeaheadChar(evt.key) && !evt.ctrlKey && !evt.metaKey && !evt.altKey && !evt.defaultPrevented\n\nconst resolveElement = (instance: unknown): HTMLElement | null => {\n const node = instance && typeof instance === \"object\" && \"$el\" in instance ? (instance as { $el: unknown }).$el : instance\n // A multi-root component's $el is the text node opening its fragment; the\n // element follows it (as in Reka)\n const element = node instanceof Text ? node.nextElementSibling : node\n return element instanceof HTMLElement ? element : null\n}\n\nconst getTypeaheadOption = <T extends Option>(\n options: Options<T>,\n typeaheadValue: string,\n currentHighlightValue?: string,\n): T | undefined => {\n // Ensure options actually exist\n if (!options.length) {\n return undefined\n }\n\n let matchBeforeHighlight: T | undefined\n // If we aren't provided a highlighted value, start from the top (e.g., act like it's found)\n let foundHighlightedValue: boolean = !currentHighlightValue\n\n const optionValidAndMatches = ({ disabled, label, value }: T) => {\n // Side effect of looping\n if (value === currentHighlightValue) {\n foundHighlightedValue = true\n // Don't return highlighted value\n return false\n }\n\n return !disabled && label.toLowerCase().startsWith(typeaheadValue)\n }\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n for (const option of opt.options) {\n if (optionValidAndMatches(option)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match, in any group\n return option\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || option\n }\n }\n }\n } else {\n if (optionValidAndMatches(opt)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match\n return opt\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || opt\n }\n }\n }\n }\n\n return matchBeforeHighlight\n}\n\ntype SelectOwnProps = InstanceType<typeof SelectComponent>[\"$props\"]\n\ntype SingleSelectProps = {\n /** Determines if the select should support multiple selection. @default false */\n multiple?: false\n /** Selected value. Bind `v-model:value`. */\n value: string\n onChange?: (option: Option) => void\n \"onUpdate:value\"?: (value: string) => void\n}\n\ntype MultiSelectProps = {\n /** Determines if the select should support multiple selection. @default false */\n multiple: true\n /** Selected values. Bind `v-model:value`. */\n value: string[]\n onChange?: (options: Option[]) => void\n \"onUpdate:value\"?: (value: string[]) => void\n}\n\n/** As in React, `multiple` decides the type of `value` and of the `change` and `update:value` payloads. */\nexport type SelectProps = Omit<SelectOwnProps, \"multiple\" | \"value\" | \"onChange\" | \"onUpdate:value\"> &\n (SingleSelectProps | MultiSelectProps)\n\n/**\n * Select dropdown with option groups, descriptions, search (over 15\n * options), multiple selection and actions. Bind `v-model:value`.\n */\nexport const Select = SelectComponent as typeof SelectComponent & { new (): { $props: SelectProps } }\n"]}
1
+ {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/Select/Select.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,CAAC,EACD,MAAM,EACN,OAAO,EACP,QAAQ,EACR,eAAe,EACf,cAAc,EACd,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,GAWN,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,wBAAwB,EACxB,KAAK,IAAI,SAAS,GACnB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAClH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAA;AACxF,OAAO,EAAE,aAAa,E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AE,CAAC;gBAC/B,IAAI,qBAAqB,EAAE,CAAC;oBAC1B,8CAA8C;oBAC9C,OAAO,GAAG,CAAA;gBACZ,CAAC;qBAAM,CAAC;oBACN,sCAAsC;oBACtC,oBAAoB,GAAG,oBAAoB,IAAI,GAAG,CAAA;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AA0BD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,eAA+E,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport {\n cloneVNode,\n computed,\n createCommentVNode,\n defineComponent,\n h,\n inject,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onBeforeUpdate,\n onMounted,\n provide,\n ref,\n shallowRef,\n toRaw,\n useId,\n watch,\n type Component,\n type ComponentPublicInstance,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n type ShallowRef,\n type Slots,\n type VNode,\n type VNodeChild,\n} from \"vue\"\nimport {\n PopoverAnchor as RekaPopoverAnchor,\n PopoverContent as RekaPopoverContent,\n PopoverPortal as RekaPopoverPortal,\n PopoverRoot as RekaPopoverRoot,\n injectPopoverRootContext,\n useId as useRekaId,\n} from \"reka-ui\"\nimport type { ControlSize } from \"@plexui/styles/types\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { preventDefaultHandler, pressHandlers, toCssVariables, waitForAnimationFrame } from \"../../lib/helpers.js\"\nimport { Check, Info, Search } from \"../Icon/index.js\"\nimport { Input } from \"../Input/index.js\"\nimport { useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { SelectControl, type DropdownIconType } from \"../SelectControl/index.js\"\nimport { Tooltip } from \"../Tooltip/index.js\"\nimport { withRadixVariableNames } from \"../Tooltip/Tooltip.js\"\nimport { composeEventHandlers, firstElementChild, mergeSlotProps } from \"../Tooltip/slot.js\"\nimport getDisableAnimations from \"../Transition/getDisableAnimations.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { overlayTiming } from \"../Transition/shared.js\"\nimport s from \"@plexui/styles/components/Select/Select.module.css\"\n\n// Vue port of packages/ui/src/components/Select/Select.tsx on Reka UI.\n//\n// API mapping:\n// - `value` + `update:value` (`v-model:value`): a string, or string[] with\n// `multiple`. `change` carries what React's `onChange` receives: the\n// selected option, or the selected options with `multiple`.\n// - Custom views are scoped slots, with React's component props kept as a\n// fallback: `#optionView=\"option\"` / `OptionView`, `#triggerView` /\n// `TriggerView` (receives the selected option, or `{ values, selectedAll }`\n// with `multiple`), `#trigger=\"{ open, onToggle }\"` / `trigger`, and\n// `#searchEmptyMessage` / `searchEmptyMessage`.\n// - An option's `description` and `tooltip.content` take a string, a VNode or\n// a render function (React: a ReactNode). Actions keep their `onSelect`\n// and `Icon` (a component) as in React.\n//\n// Reka keeps the popover state, positioning, the dismissable layer and the\n// focus scope. Where Reka's popover differs from Radix's, this port follows\n// Radix so the DOM and behaviour match React:\n// - The trigger is Radix's: its props are merged into the trigger (default\n// or custom) after the child's own handlers, the click toggle is skipped\n// when one called preventDefault(), it carries no `id` of Reka's and sets\n// `aria-controls` only while open (Radix 1.8.1).\n// - Open changes from Reka (dismiss, the trigger's click) are reported only\n// when the state changes, like Radix's controlled state.\n// - A primary pointer down outside dismisses on its click, as in Radix 1.8.1\n// (../Popover/deferredPointerDownOutside.ts).\n// - The content element is rendered here (Reka's `as`): Radix's custom\n// property names (`--radix-popover-*`), no `dir`, no `aria-labelledby`.\n// - React handles events of portalled content at <body>, so stopping one\n// there still runs <body>'s own listeners (the Escape stack). An action's\n// Escape key does the same here (see CustomSelectAction).\n\nexport type OptionContent = string | number | VNode | (() => VNodeChild)\n\nexport type Option<T extends string = string> = {\n value: T\n label: string\n /** Disable the option */\n disabled?: boolean\n /** Displayed as secondary text below the option `label` */\n description?: OptionContent\n tooltip?: {\n content: OptionContent\n maxWidth?: number\n }\n}\n\nexport type OptionGroup<T extends Option> = {\n label: string\n options: T[]\n optionsLimit?: {\n label: string\n limit: number\n }\n}\n\nexport type Options<T extends Option> = T[] | OptionGroup<T>[]\n\ntype CallbackWithActionId = (actionId: string) => void\ntype SearchPredicate<T extends Option> = (option: T, searchTerm: string) => boolean\n\nexport type SelectAction = {\n /** Unique ID to identify the action with */\n id: string\n /** Label display for the action */\n label: string\n /** Icon displayed to the left of the action */\n Icon?: Component\n /** Custom class applied to the action container */\n className?: string\n /** Callback invoked when the action is pressed */\n onSelect: CallbackWithActionId\n}\n\nexport type PopoverSide = \"top\" | \"bottom\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\nexport type CheckPosition = \"start\" | \"end\" | \"none\"\n\nexport type MultiSelectTriggerViewProps<T extends Option> = {\n values: T[]\n selectedAll: boolean\n}\n\nexport type SelectTriggerRenderProps = { open: boolean; onToggle: () => void }\n\ntype ListSize = number | \"auto\"\n\nconst selectProps = {\n /** Options or option groups. Should be a stable reference. */\n options: { type: Array as PropType<Options<Option>>, required: true as const },\n /** Selected value; an array of values with `multiple`. Bind `v-model:value`. */\n value: { type: [String, Array] as PropType<string | string[]>, required: true as const },\n /** Determines if the select should support multiple selection. @default false */\n multiple: { type: Boolean, default: false },\n /** Disables the select visually and from interactions. @default false */\n disabled: { type: Boolean, default: false },\n /** Id of the hidden input, so the select can be targeted with `for` */\n id: String,\n /** Marks the select as a required field when using native form submission */\n required: { type: Boolean, default: undefined },\n /** Creates the ability to query the value with `[name=\"${name}\"]` */\n name: String,\n /** Placeholder text for the select. @default \"Select...\" */\n placeholder: { type: String, default: \"Select...\" },\n /** Placeholder text while loading. @default \"Loading...\" */\n loadingPlaceholder: { type: String, default: \"Loading...\" },\n /** Text of a `multiple` trigger when every option is selected. @default \"All selected\" */\n allSelectedLabel: { type: String, default: \"All selected\" },\n /** Displays loading indicator on top of button contents. @default false */\n loading: { type: Boolean, default: false },\n /** Style variant for the select trigger. @default \"outline\" */\n variant: { type: String as PropType<\"soft\" | \"outline\" | \"ghost\">, default: \"outline\" },\n /** Fully rounded pill shape for the trigger. @default false */\n pill: { type: Boolean, default: false },\n /** Size of the trigger: `3xs` 22px up to `3xl` 48px. @default \"md\" */\n size: { type: String as PropType<ControlSize>, default: \"md\" },\n /** Icon displayed in the far right of the select trigger. @default \"dropdown\" */\n dropdownIconType: { type: String as PropType<DropdownIconType>, default: \"dropdown\" },\n /** Actions to display below the options list. Memoized by length. */\n actions: Array as PropType<SelectAction[]>,\n /** Custom class applied to option containers */\n optionClassName: String,\n /** Component rendering each option (the `#optionView` slot takes precedence) */\n OptionView: [Object, Function] as PropType<Component>,\n /** Component rendering the trigger content (the `#triggerView` slot takes precedence) */\n TriggerView: [Object, Function] as PropType<Component>,\n /** Icon displayed at the start of the select trigger */\n TriggerStartIcon: [Object, Function] as PropType<Component>,\n /** Custom class applied to the select trigger */\n triggerClassName: String,\n /** Applies a negative margin using the current gutter to optically align the trigger. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n /** Display a clear action that allows the select to be unset. @default false */\n clearable: { type: Boolean, default: false },\n /** Extends select to 100% of available width. @default true, except for the ghost variant */\n block: { type: Boolean, default: undefined },\n /** Preferred side of the trigger to render against when open. @default \"bottom\" */\n side: { type: String as PropType<PopoverSide>, default: \"bottom\" },\n /** Preferred alignment against the trigger. @default \"center\" when block, otherwise \"start\" */\n align: String as PropType<PopoverAlign>,\n /** Offset in pixels from the \"start\" or \"end\" alignment. @default 0 */\n alignOffset: Number,\n /** Collision detection of the menu. @default true */\n avoidCollisions: { type: Boolean, default: true },\n /** Width of the menu. @default the trigger width (fits the options when not block) */\n listWidth: [Number, String] as PropType<ListSize>,\n /** `min-width` of the menu, in pixels. @default the trigger width */\n listMinWidth: [Number, String] as PropType<ListSize>,\n /** `max-width` of the menu, in pixels. @default \"auto\" (300 when not block) */\n listMaxWidth: [Number, String] as PropType<ListSize>,\n /** Predicate used to filter searches */\n searchPredicate: Function as PropType<SearchPredicate<Option>>,\n /** Placeholder of the search input */\n searchPlaceholder: { type: String, default: \"\" },\n /** Accessible name of the search input, independent of the trigger label. @default \"Search options\" */\n searchAriaLabel: { type: String, default: \"Search options\" },\n /** Size of the search input in the menu, such as `2xl` for 44px touch targets on phones. @default \"md\" */\n searchSize: String as PropType<ControlSize>,\n /** Message displayed when search results are empty (or the `#searchEmptyMessage` slot) */\n searchEmptyMessage: { type: [String, Number, Object] as PropType<string | number | VNode>, default: \"No results found.\" },\n /** Position of the check indicator in the option list. @default \"start\" */\n checkPosition: { type: String as PropType<CheckPosition>, default: \"start\" },\n /** Renders a custom trigger (or the `#trigger` slot), wrapped as the popover trigger */\n trigger: Function as PropType<(props: SelectTriggerRenderProps) => VNodeChild>,\n \"ariaLabel\": String,\n \"ariaLabelledby\": String,\n \"ariaDescribedby\": String,\n \"ariaInvalid\": { type: [Boolean, String] as PropType<boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\">, default: undefined },\n}\n\ntype SelectPropsValue = {\n readonly [K in keyof typeof selectProps]: unknown\n} & {\n options: Options<Option>\n value: string | string[]\n multiple: boolean\n disabled: boolean\n id?: string\n required?: boolean\n name?: string\n placeholder: string\n loadingPlaceholder: string\n allSelectedLabel: string\n loading: boolean\n variant: \"soft\" | \"outline\" | \"ghost\"\n pill: boolean\n size: ControlSize\n dropdownIconType: DropdownIconType\n actions?: SelectAction[]\n optionClassName?: string\n OptionView?: Component\n TriggerView?: Component\n TriggerStartIcon?: Component\n triggerClassName?: string\n opticallyAlign?: \"start\" | \"end\"\n clearable: boolean\n block?: boolean\n side: PopoverSide\n align?: PopoverAlign\n alignOffset?: number\n avoidCollisions: boolean\n listWidth?: ListSize\n listMinWidth?: ListSize\n listMaxWidth?: ListSize\n searchPredicate?: SearchPredicate<Option>\n searchPlaceholder: string\n searchAriaLabel: string\n searchSize?: ControlSize\n searchEmptyMessage: string | number | VNode\n checkPosition: CheckPosition\n trigger?: (props: SelectTriggerRenderProps) => VNodeChild\n ariaLabel?: string\n ariaLabelledby?: string\n ariaDescribedby?: string\n ariaInvalid?: boolean | string\n}\n\n// ============================================================\n// Contexts\n// ============================================================\n\ntype SelectContextValue = {\n props: SelectPropsValue\n slots: Slots\n /**\n * Bumped on every Select update. Slots are not reactive, so the parts that\n * render one read it to follow a slot that was added, removed or replaced.\n */\n slotsVersion: Ref<number>\n triggerId: string\n /** The default trigger's element (React looks it up by `triggerId`) */\n triggerEl: ShallowRef<HTMLElement | null>\n block: ComputedRef<boolean>\n align: ComputedRef<PopoverAlign>\n alignOffset: ComputedRef<number>\n listWidth: ComputedRef<ListSize | undefined>\n listMaxWidth: ComputedRef<ListSize>\n searchable: ComputedRef<boolean>\n actions: ShallowRef<SelectAction[]>\n onSelect: (option: Option, removeOption?: boolean) => void\n onActionSelect: CallbackWithActionId\n /** The latest predicate, read without tracking (React keeps it in a ref) */\n searchPredicate: () => SearchPredicate<Option>\n}\n\nconst SelectContextKey: InjectionKey<SelectContextValue> = Symbol(\"PlexUISelect\")\n\nconst useSelectContext = () => {\n const context = inject(SelectContextKey, null)\n\n if (!context) {\n throw new Error(\"Select components must be wrapped in <Select />\")\n }\n\n return context\n}\n\ntype CustomSelectContextValue = {\n open: Ref<boolean>\n handleOpenChange: (maybeNextState?: boolean) => void\n /** Radix's `onOpenChange` of the popover root: reports changes only */\n handleRootOpenChange: (nextState: boolean) => void\n selectContentRef: ShallowRef<HTMLElement | null>\n /** The trigger element, default or custom (React's ref on Popover.Trigger) */\n popoverTriggerEl: ShallowRef<HTMLElement | null>\n}\n\nconst CustomSelectContextKey: InjectionKey<CustomSelectContextValue> = Symbol(\"PlexUICustomSelect\")\n\n// Radix decides \"focus outside\" on the React tree, where a Select opened next\n// to another one is outside it: focus entering the second one's menu closes\n// the first. Reka decides on the DOM and counts a layer later in the document\n// as nested, so the first would stay open. Each Select records its logical\n// parent (the Select whose menu renders it) and its content element, and\n// closes when focus enters the content of a Select not nested in it.\ntype SelectLayer = {\n parent: SelectLayer | null\n content: ShallowRef<HTMLElement | null>\n}\n\nconst SelectLayerKey: InjectionKey<SelectLayer> = Symbol(\"PlexUISelectLayer\")\n\nconst mountedSelectLayers = new Set<SelectLayer>()\n\nconst isNestedIn = (layer: SelectLayer, ancestor: SelectLayer) => {\n for (let parent = layer.parent; parent; parent = parent.parent) {\n if (parent === ancestor) return true\n }\n return false\n}\n\ntype CustomSelectMenuContextValue = {\n openingValue: string\n listId: string\n requestClose: () => void\n listRef: ShallowRef<HTMLElement | null>\n // Highlighting\n highlightedValue: Ref<string>\n // Search\n searchTerm: Ref<string>\n searchInputRef: ShallowRef<HTMLInputElement | null>\n}\n\nconst CustomSelectMenuContextKey: InjectionKey<CustomSelectMenuContextValue> = Symbol(\"PlexUICustomSelectMenu\")\n\nconst useCustomSelectMenuContext = () => {\n const context = inject(CustomSelectMenuContextKey, null)\n\n if (!context) {\n throw new Error(\"CustomSelectMenu components must be wrapped in <CustomSelectMenu />\")\n }\n\n return context\n}\n\nconst renderContent = (content: unknown): VNodeChild =>\n typeof content === \"function\" ? (content as () => VNodeChild)() : (content as VNodeChild)\n\nconst defaultMultiTriggerView = ({ values, selectedAll }: MultiSelectTriggerViewProps<Option>, allSelectedLabel: string) =>\n selectedAll\n ? allSelectedLabel\n : values.length === 0\n ? // NOTE: Zero length is impossible - an empty option with `placeholder` is always returned\n \"Select...\"\n : values.length === 1\n ? values[0]!.label\n : `${values.length} selected`\n\n// ============================================================\n// Select\n// ============================================================\n\nconst SelectComponent = defineComponent({\n name: \"Select\",\n inheritAttrs: false,\n props: selectProps,\n // Untyped here: SelectProps (below) types the payloads by `multiple`, and\n // typed emits would also require each listener to take both shapes\n emits: [\"update:value\", \"change\"],\n setup(rawProps, { emit, slots }) {\n const props = rawProps as unknown as SelectPropsValue\n // Block default is dynamic, based on `variant`\n const block = computed(() => props.block ?? props.variant !== \"ghost\")\n // Align default is dynamic, based on `block`\n const align = computed<PopoverAlign>(() => props.align ?? (block.value ? \"center\" : \"start\"))\n // Flush with the trigger's edge, as the prop documents\n const alignOffset = computed(() => props.alignOffset ?? 0)\n\n const change = (selection: Option | Option[]) => {\n emit(\"update:value\", Array.isArray(selection) ? selection.map((option) => option.value) : selection.value)\n emit(\"change\", selection)\n }\n\n const onSelect = (selectedOption: Option, removeOption?: boolean) => {\n const { multiple, options } = props\n const value = props.value as string[]\n\n if (multiple) {\n // When clearing values, the value is an empty string\n if (!selectedOption.value) {\n change([])\n return\n }\n\n if (removeOption) {\n const nextValues = value.filter((v) => v !== selectedOption.value)\n change(getOptionsByValues(options, nextValues))\n } else {\n change(getOptionsByValues(options, value).concat(selectedOption))\n }\n } else {\n change(selectedOption)\n }\n }\n\n // It should be exceedingly uncommon to change actions dynamically: like\n // React's memo, the rendered actions only follow a change of length.\n const actions = shallowRef<SelectAction[]>(props.actions ?? [])\n watch(\n () => (props.actions ?? []).length,\n () => {\n actions.value = props.actions ?? []\n },\n )\n // Action callbacks always come from the latest actions\n const onActionSelect = (actionId: string) => {\n ;(props.actions ?? []).find((a) => a.id === actionId)?.onSelect(actionId)\n }\n\n // Determine when custom selects should be used\n const optionsCount = computed(() => {\n const { options } = props\n return isOptionGroupArray(options)\n ? options.reduce((acc: number, group) => acc + group.options.length, 0)\n : options.length\n })\n\n // Locking down searchable count to a single value\n const searchable = computed(() => optionsCount.value > 15)\n\n // A block menu matches its field. An inline one fits its options: no narrower than\n // its trigger (the CSS fallback reads the trigger width), no wider than 300px.\n const fitsOptions = computed(() => !block.value && props.listWidth === undefined)\n const listWidth = computed(() => props.listWidth ?? (fitsOptions.value ? \"auto\" : undefined))\n const listMaxWidth = computed(() => props.listMaxWidth ?? (fitsOptions.value ? 300 : \"auto\"))\n\n const slotsVersion = ref(0)\n onBeforeUpdate(() => {\n slotsVersion.value++\n })\n\n provide(SelectContextKey, {\n props,\n slots,\n slotsVersion,\n triggerId: `select-trigger-${useId()}`,\n triggerEl: shallowRef(null),\n block,\n align,\n alignOffset,\n listWidth,\n listMaxWidth,\n searchable,\n actions,\n onSelect,\n onActionSelect,\n searchPredicate: () => (toRaw(rawProps) as SelectPropsValue).searchPredicate ?? defaultSearchPredicate,\n })\n\n return () => h(CustomSelect)\n },\n})\n\n// ============================================================\n// Trigger\n// ============================================================\n\nconst SelectTrigger = defineComponent({\n name: \"SelectTrigger\",\n inheritAttrs: false,\n props: {\n onOpenChange: Function as PropType<(maybeNextState?: boolean) => void>,\n },\n setup(ownProps, { attrs }) {\n const { props, slots, slotsVersion, triggerId, triggerEl, block, onSelect } = useSelectContext()\n const typeahead = createTypeahead()\n\n const setTriggerEl = (instance: unknown) => {\n triggerEl.value = ((instance as ComponentPublicInstance | null)?.$el as HTMLElement | undefined) ?? null\n }\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const key = evt.key\n const { multiple, value, options } = props\n const firstValue = multiple ? (value as string[])[0] : (value as string)\n\n // If not a command, check for typeahead\n // NOTE: Typeahead not supported in multi-select\n if (!multiple && isTypeaheadKey(evt)) {\n const currentTypeaheadValue = typeahead(key)\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value\n // NOTE: We don't look at current highlighted value as a means to start the search\n const firstMatchingOption = getTypeaheadOption(options, currentTypeaheadValue, firstValue)\n\n if (firstMatchingOption) {\n onSelect(firstMatchingOption)\n }\n }\n }\n\n const handleClearClick = () => {\n onSelect({ value: \"\", label: \"\" })\n // Ensure open state is closed\n ownProps.onOpenChange?.(false)\n }\n\n return () => {\n void slotsVersion.value\n const { multiple, options, loading } = props\n const value = props.value\n const firstValue = multiple ? (value as string[])[0] : (value as string)\n const placeholderValue = loading ? props.loadingPlaceholder : props.placeholder\n const hasSelectedValue = multiple ? (value as string[]).length > 0 : !!value\n const isPlaceholder = loading || !hasSelectedValue\n\n const renderTriggerView = () => {\n let viewProps: Option | MultiSelectTriggerViewProps<Option>\n\n if (multiple) {\n const currentSelectedOptions = getOptionsByValues(options, value as string[])\n const flatOptions = options.flatMap((o) => (\"options\" in o ? o.options : o))\n viewProps = {\n values: currentSelectedOptions.length ? currentSelectedOptions : [{ value: \"\", label: placeholderValue }],\n selectedAll: flatOptions.length <= (value as string[]).length,\n }\n } else {\n viewProps = getOptionByValue(options, firstValue as string) || { value: \"\", label: placeholderValue }\n }\n\n if (slots.triggerView) return slots.triggerView(viewProps)\n if (props.TriggerView) return h(props.TriggerView, viewProps)\n return multiple\n ? defaultMultiTriggerView(viewProps as MultiSelectTriggerViewProps<Option>, props.allSelectedLabel)\n : (viewProps as Option).label\n }\n\n return h(\n SelectControl as Component,\n {\n \"ref\": setTriggerEl,\n \"id\": triggerId,\n \"aria-label\": props.ariaLabel,\n \"aria-labelledby\": props.ariaLabelledby ? `${props.ariaLabelledby} ${triggerId}-value` : undefined,\n \"aria-describedby\": props.ariaDescribedby,\n \"aria-invalid\": props.ariaInvalid,\n \"class\": props.triggerClassName,\n \"selected\": !isPlaceholder,\n \"variant\": props.variant,\n \"pill\": props.pill,\n \"block\": block.value,\n \"size\": props.size,\n \"disabled\": props.disabled,\n \"loading\": loading,\n \"StartIcon\": props.TriggerStartIcon,\n \"opticallyAlign\": props.opticallyAlign,\n \"dropdownIconType\": props.dropdownIconType,\n \"onClearClick\": props.clearable ? handleClearClick : undefined,\n \"onInteract\": ownProps.onOpenChange,\n \"interactOnEnter\": true,\n \"onKeydown\": handleKeyDown,\n // pass along props from the popover trigger\n ...attrs,\n },\n {\n default: () => [\n props.ariaLabelledby ? h(\"span\", { id: `${triggerId}-value` }, [renderTriggerView()]) : renderTriggerView(),\n props.name || props.id\n ? // One input per selected value, so a form submits every value of a\n // multi-select; an empty one keeps `id` and `required` working\n (multiple && (value as string[]).length ? (value as string[]) : [firstValue ?? \"\"]).map((formValue, index) =>\n h(\"input\", {\n \"key\": index,\n \"id\": index === 0 ? props.id : undefined,\n \"name\": props.name,\n \"value\": formValue,\n // A disabled select is neither validated nor submitted\n \"disabled\": props.disabled,\n \"tabindex\": -1,\n \"onFocus\": () => {\n triggerEl.value?.focus()\n },\n // A label's `for` lands here, and its click opens the list like a press on the trigger\n \"onClick\": () => {\n if (!loading) {\n ownProps.onOpenChange?.(true)\n }\n },\n // don't make this readOnly because that prevents the value from being required\n \"required\": props.required,\n \"class\": s.FormInput,\n \"aria-hidden\": \"true\",\n }),\n )\n : null,\n ],\n },\n )\n }\n },\n})\n\n/**\n * Radix's `Popover.Trigger asChild`: Radix's trigger props merged into the\n * child (the default trigger or a custom one), its click toggle after the\n * child's own handlers.\n */\nconst SelectPopoverTrigger = defineComponent({\n name: \"SelectPopoverTrigger\",\n setup(_props, { slots }) {\n const rootContext = injectPopoverRootContext()\n rootContext.contentId ||= useRekaId(undefined, \"reka-popover-content\")\n const { popoverTriggerEl } = inject(CustomSelectContextKey)!\n\n // React's ref on Popover.Trigger: the element the child gives its ref\n // (FloatingLabelSelect's field). Focus returns here on close, the content\n // anchors to it, and pointer-downs on it are not \"outside\".\n const setTriggerRef = (instance: unknown) => {\n popoverTriggerEl.value = resolveElement(instance)\n rootContext.triggerElement.value = popoverTriggerEl.value ?? undefined\n }\n\n const onClick = composeEventHandlers(undefined, () => rootContext.onOpenToggle())\n\n return () => {\n const child = firstElementChild(slots.default?.())\n if (!child) return null\n\n const isOpen = rootContext.open.value\n return h(RekaPopoverAnchor, { asChild: true, reference: popoverTriggerEl.value ?? undefined }, {\n default: () =>\n cloneVNode(\n mergeSlotProps(child, {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? rootContext.contentId : undefined,\n \"data-state\": isOpen ? \"open\" : \"closed\",\n onClick,\n }),\n { ref: setTriggerRef },\n // Keep the child's own ref\n true,\n ),\n })\n }\n },\n})\n\n// ============================================================\n// Custom Select\n// ============================================================\n\nconst CustomSelect = defineComponent({\n name: \"CustomSelect\",\n setup() {\n const { props, slots, slotsVersion, triggerEl } = useSelectContext()\n const open = ref(false)\n const selectContentRef = shallowRef<HTMLElement | null>(null)\n const popoverTriggerEl = shallowRef<HTMLElement | null>(null)\n // Not before mount: server rendering and hydration render no teleport,\n // as Radix's Portal renders nothing before mount\n const mounted = ref(false)\n\n const handleOpenChange = (maybeNextState?: boolean) => {\n // Toggle the current state when called without a specific state\n const nextState = maybeNextState === undefined ? !open.value : maybeNextState\n open.value = nextState\n\n // When we're closing, manage focus back to trigger manually\n if (!nextState) {\n // Read this now: with animations disabled the menu unmounts before the\n // timeout below runs, so selectContentRef is already null by then\n const focusWasInMenu = !!selectContentRef.value?.contains(document.activeElement)\n\n // Wait until the next tick to determine if another element has become focused\n setTimeout(() => {\n const activeElement = document.activeElement\n const menu = selectContentRef.value\n const focusInMenu = !!menu && !!activeElement && menu.contains(activeElement)\n // Focus dropped with the closing menu lands on <body>: it was lost, not moved\n const focusLost = !activeElement || activeElement === document.body\n\n // Focus that moved to another element outside the menu stays there\n if (focusInMenu || (focusWasInMenu && focusLost)) {\n popoverTriggerEl.value?.focus()\n }\n })\n }\n }\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n const handleRootOpenChange = (nextState: boolean) => {\n // Radix's controlled state reports changes only\n if (nextState === open.value) return\n\n // Prevent opening while loading\n if (props.loading && nextState) {\n return\n }\n\n handleOpenChange(nextState)\n }\n\n provide(CustomSelectContextKey, {\n open,\n handleOpenChange,\n handleRootOpenChange,\n selectContentRef,\n popoverTriggerEl,\n })\n\n const layer: SelectLayer = { parent: inject(SelectLayerKey, null), content: selectContentRef }\n provide(SelectLayerKey, layer)\n\n // Focus entering another Select's menu is outside this one, unless that\n // Select is nested in this one's menu (see SelectLayer)\n const handleFocusIn = (evt: FocusEvent) => {\n const target = evt.target as Node | null\n if (!open.value || !target) return\n for (const other of mountedSelectLayers) {\n if (other !== layer && other.content.value?.contains(target) && !isNestedIn(other, layer)) {\n handleRootOpenChange(false)\n return\n }\n }\n }\n\n let listenerDocument: Document | null = null\n onMounted(() => {\n mounted.value = true\n mountedSelectLayers.add(layer)\n listenerDocument = triggerEl.value?.ownerDocument ?? document\n listenerDocument.addEventListener(\"focusin\", handleFocusIn)\n })\n onBeforeUnmount(() => {\n mountedSelectLayers.delete(layer)\n listenerDocument?.removeEventListener(\"focusin\", handleFocusIn)\n listenerDocument = null\n })\n\n const renderTrigger = () => {\n const renderProps: SelectTriggerRenderProps = {\n open: open.value,\n onToggle: () => {\n open.value = !open.value\n },\n }\n if (slots.trigger) return slots.trigger(renderProps)\n if (props.trigger) return props.trigger(renderProps)\n return h(SelectTrigger, { onOpenChange: handleOpenChange })\n }\n\n return () => {\n void slotsVersion.value\n return h(\n RekaPopoverRoot,\n { \"open\": open.value, \"onUpdate:open\": handleRootOpenChange, \"modal\": false },\n {\n default: () => [\n h(SelectPopoverTrigger, null, { default: renderTrigger }),\n // Without animations React replaces the menu's wrapper when it\n // opens or closes (see TransitionGroup), so React DOM appends the\n // new one to <body>. A Teleport keeps its place in <body>: a new\n // one per state moves the wrapper to the end the same way. With\n // animations the group has to stay, to run the exit.\n h(RekaPopoverPortal, { key: !getDisableAnimations() || open.value ? \"open\" : \"closed\", forceMount: mounted.value }, {\n default: () => [\n h(\n TransitionGroup,\n { class: s.Menu, ...overlayTiming, overlay: true },\n { default: () => [open.value ? h(SelectPopoverContent, { key: \"dropdown\" }) : createCommentVNode()] },\n ),\n ],\n }),\n ],\n },\n )\n }\n },\n})\n\n// The element Reka's content renders (`as`). Raw: Reka passes `as` through\n// reactive props, and Vue warns about a component made reactive.\nconst SelectContentElement = markRaw(\n defineComponent({\n name: \"SelectContentElement\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const { selectContentRef } = inject(CustomSelectContextKey)!\n const setContentRef = (el: unknown) => {\n selectContentRef.value = (el as HTMLElement | null) ?? null\n }\n\n return () => {\n const { \"dir\": _dir, \"aria-labelledby\": _labelledBy, \"forceMount\": _forceMount, style, ...rest } = attrs\n return h(\"div\", { ...rest, style: withRadixVariableNames(style, \"popover\"), ref: setContentRef }, slots.default?.())\n }\n },\n }),\n)\n\nconst SelectPopoverContent = defineComponent({\n name: \"SelectPopoverContent\",\n setup() {\n const { props, align, alignOffset, listWidth, listMaxWidth } = useSelectContext()\n const { handleRootOpenChange, popoverTriggerEl } = inject(CustomSelectContextKey)!\n // Radix (1.8.1) dismisses on the click that follows a primary pointer down outside\n const { onPointerDownOutside, onFocusOutside } = useDeferredPointerDownOutside((originalEvent) => {\n // The trigger is not outside: Radix's non-modal content keeps the popover open\n if (popoverTriggerEl.value?.contains(originalEvent.target as Node | null)) return\n handleRootOpenChange(false)\n })\n\n return () =>\n h(\n RekaPopoverContent,\n {\n forceMount: true,\n as: SelectContentElement,\n class: s.MenuList,\n \"data-pill\": props.pill ? \"\" : undefined,\n side: props.side,\n sideOffset: 5,\n align: align.value,\n alignOffset: alignOffset.value,\n avoidCollisions: props.avoidCollisions,\n collisionPadding: { bottom: 30, top: 30 },\n // Prevent Reka's auto focus so we can handle our own from within <CustomSelectMenu />\n onOpenAutoFocus: preventDefaultHandler,\n onCloseAutoFocus: preventDefaultHandler,\n onEscapeKeyDown: preventDefaultHandler,\n onPointerDownOutside,\n onFocusOutside,\n style: toCssVariables({\n \"select-list-width\": listWidth.value,\n \"select-list-min-width\": props.listMinWidth,\n \"select-list-max-width\": listMaxWidth.value,\n }),\n },\n { default: () => h(CustomSelectMenu) },\n )\n },\n})\n\n/**\n * Focuses an element that mounted in this tick. Vue skips a listener for an\n * event stamped (`_vts`) no later than the moment the listener was attached\n * (a time cached for the tick), so a focus fired within the millisecond the\n * menu mounted would not reach the search Input's own focus listener once\n * Reka's capture listener has stamped it: its `data-focused` would stay\n * \"false\", while React's onFocus always runs. The focus events are stamped\n * one millisecond later for the listeners on their way.\n *\n * `_vts` is a private field of Vue's runtime-dom event invoker. Deferring the\n * focus instead was tried and breaks parity, because React focuses\n * synchronously in its mount effect: in the next animation frame, keys and\n * Escape pressed right after opening reach the trigger, not the menu; in a\n * 1ms timeout (a 0ms one fires within the same millisecond and is skipped\n * too), a menu opened and closed quickly takes focus after closing. Should\n * Vue drop the field, the stamp is ignored and only the search input's\n * `data-focused` is affected.\n */\nconst focusMounted = (element: HTMLElement) => {\n const view = element.ownerDocument.defaultView\n const stamp = (event: Event) => {\n const vueEvent = event as Event & { _vts?: number }\n if (event.target === element && !vueEvent._vts) vueEvent._vts = Date.now() + 1\n }\n\n view?.addEventListener(\"focus\", stamp, { capture: true })\n view?.addEventListener(\"focusin\", stamp, { capture: true })\n try {\n element.focus({ preventScroll: true })\n } finally {\n view?.removeEventListener(\"focus\", stamp, { capture: true })\n view?.removeEventListener(\"focusin\", stamp, { capture: true })\n }\n}\n\nconst CustomSelectMenu = defineComponent({\n name: \"CustomSelectMenu\",\n setup() {\n const { props, searchable, searchPredicate, listWidth } = useSelectContext()\n const { handleOpenChange } = inject(CustomSelectContextKey)!\n const menuRef = shallowRef<HTMLElement | null>(null)\n const listRef = shallowRef<HTMLElement | null>(null)\n const searchInputRef = shallowRef<HTMLInputElement | null>(null)\n const searchTerm = ref(\"\")\n const multiple = props.multiple\n const value = props.value\n const highlightedValue = ref<string>(\n ((multiple ? (value as string[])[0] : (value as string)) || getFirstValidOption(props.options)?.value) ?? \"\",\n )\n const typeahead = createTypeahead()\n const listId = `select-list-${useId()}`\n\n // Lock `value` for a given open to prevent janky change during close animation\n // MultiSelect reads its live selection instead of this per-open snapshot.\n const openingValue = multiple ? \"\" : (value as string)\n\n // Trim and lowercase search value\n const literalSearchTerm = computed(() => searchTerm.value.trim().toLocaleLowerCase())\n const filteredOptions = computed(() => filterOptions(props.options, literalSearchTerm.value, searchPredicate()))\n const firstOption = computed(() => getFirstValidOption(filteredOptions.value))\n\n const requestClose = () => handleOpenChange(false)\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const key = evt.key\n const multiple = props.multiple\n const value = props.value\n const firstValue = multiple ? (value as string[])[0] : (value as string)\n const currentHighlightedValue = highlightedValue.value\n const targetValue = currentHighlightedValue || firstOption.value?.value || firstValue\n const isFocusedInSearch = document.activeElement === searchInputRef.value\n\n const menuElement = menuRef.value\n\n // Should be generally impossible for the menu element to not exist\n if (!menuElement) {\n return\n }\n\n const triggerHighlightedOption = () => {\n const pointerUpEvent = new PointerEvent(\"pointerup\", {\n bubbles: true,\n cancelable: true,\n pointerType: \"mouse\",\n })\n\n // Find the current highlighted option\n const selectedOption = findOptionByValue(currentHighlightedValue, menuElement)\n selectedOption?.dispatchEvent(pointerUpEvent)\n }\n\n const highlightOption = (val: string, element: Element) => {\n highlightedValue.value = val\n element.scrollIntoView({ block: \"nearest\" })\n }\n\n const highlightSelectedOrFirstOption = () => {\n // Attempt to move highlight to selected item\n const maybeFirstValue = multiple ? (value as string[])[0] : (value as string)\n\n if (maybeFirstValue) {\n const selectedElement = findOptionByValue(maybeFirstValue, menuElement)\n\n if (selectedElement) {\n highlightOption(maybeFirstValue, selectedElement)\n return\n }\n }\n\n // If value isn't set, or the selected node wasn't found in the DOM,\n // attempt to move focus to the first valid option.\n const firstValidOption = getFirstValidOption(props.options)\n\n if (firstValidOption) {\n const firstValidOptionElement = findOptionByValue(firstValidOption.value, menuElement)\n if (firstValidOptionElement) {\n highlightOption(firstValidOption.value, firstValidOptionElement)\n }\n }\n }\n\n // Commands\n switch (key) {\n case \"ArrowDown\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!currentHighlightedValue || !findOptionByValue(currentHighlightedValue, menuElement)) {\n highlightSelectedOrFirstOption()\n return\n }\n\n // Otherwise, move to the next option\n const nextElement = findNextOption(currentHighlightedValue, menuElement)\n const nextValue = nextElement?.getAttribute(\"data-option-id\")\n if (nextElement && nextValue) {\n highlightOption(nextValue, nextElement)\n }\n\n return\n }\n case \"ArrowUp\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!currentHighlightedValue || !findOptionByValue(currentHighlightedValue, menuElement)) {\n highlightSelectedOrFirstOption()\n return\n }\n\n const previousElement = findPreviousOption(targetValue as string, menuElement)\n const previousValue = previousElement?.getAttribute(\"data-option-id\")\n if (previousElement && previousValue) {\n highlightOption(previousValue, previousElement)\n }\n\n return\n }\n case \"Enter\":\n // Prevent default enter behavior from the search input, if present\n evt.preventDefault()\n\n // Send a pointerup event into the currently highlighted option\n triggerHighlightedOption()\n\n return\n case \" \":\n // Allow spaces in search, and don't treat as enter\n // if there is a valid literalSearchTerm.\n if (literalSearchTerm.value && isFocusedInSearch) {\n return\n }\n\n // Prevent space from entering search input\n evt.preventDefault()\n\n // Send a pointerup event into the currently highlighted option\n triggerHighlightedOption()\n\n return\n default:\n break\n }\n\n // If not a command, check for typeahead\n if (isTypeaheadKey(evt)) {\n // Skip typeahead logic when we're focused in the search input\n if (isFocusedInSearch) {\n return\n }\n\n // Extend the current typeahead and get the latest value\n const currentTypeaheadValue = typeahead(key)\n\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value, starting at the highlighted value\n const firstMatchingOption = getTypeaheadOption(props.options, currentTypeaheadValue, currentHighlightedValue)\n\n if (firstMatchingOption) {\n const matchedNode = findOptionByValue(firstMatchingOption.value, menuElement)\n\n // Only change the highlight if we found the actual node\n if (matchedNode) {\n highlightedValue.value = firstMatchingOption.value\n // Ensure the newly highlighted option is scrolled into view\n matchedNode.scrollIntoView({ block: \"nearest\" })\n }\n }\n }\n }\n\n provide(CustomSelectMenuContextKey, {\n openingValue,\n listId,\n requestClose,\n listRef,\n highlightedValue,\n searchTerm,\n searchInputRef,\n })\n\n // The focused element (the search input, or the list without one) points\n // assistive tech at the highlighted option, when that option is rendered\n const syncActiveDescendant = () => {\n const target = searchInputRef.value || listRef.value\n if (!target || !menuRef.value) {\n return\n }\n\n const highlightedOption = highlightedValue.value ? findOptionByValue(highlightedValue.value, menuRef.value) : null\n if (highlightedOption?.id) {\n target.setAttribute(\"aria-activedescendant\", highlightedOption.id)\n } else {\n target.removeAttribute(\"aria-activedescendant\")\n }\n }\n watch([highlightedValue, filteredOptions], syncActiveDescendant, { flush: \"post\" })\n\n // On mount behavior\n onMounted(() => {\n syncActiveDescendant()\n\n // A long list has a search field: the menu keeps the width of all its options as the results narrow.\n if (searchable.value && listWidth.value === \"auto\" && menuRef.value) {\n menuRef.value.style.minWidth = `${menuRef.value.offsetWidth}px`\n }\n\n // Like React's mount effect, the scroll target is the highlight at mount\n const initialHighlightedValue = highlightedValue.value\n\n // Ensure initial highlighted option is in view\n // NOTE: Allowing for a render frame ensures content is positioned correctly before scrolling it into view.\n waitForAnimationFrame(() => {\n if (!menuRef.value) {\n return\n }\n\n // Ensure the highlighted option is in view\n const currentOption = findOptionByValue(initialHighlightedValue, menuRef.value)\n // Scroll the selected item into view, and its bottom edge.\n currentOption?.scrollIntoView({ block: \"center\" })\n })\n\n // Send initial focus to the search input, or the list without one (the\n // menu container when there are no options), to capture key events\n const autoFocusTarget = searchInputRef.value || listRef.value || menuRef.value\n // A tick later: until Reka's focus scope here has registered, a Dialog\n // around the menu sends the focus straight back, and the menu takes that\n // for focus moving outside and closes. No key can come between.\n if (autoFocusTarget) nextTick(() => focusMounted(autoFocusTarget))\n })\n\n // On search behavior (React's layout effect on `filteredOptions`, skipped on mount)\n watch(\n filteredOptions,\n (nextFilteredOptions, previousFilteredOptions) => {\n // Impossible while mounted, list ref will exist\n if (!listRef.value) {\n return\n }\n\n // The same list again, as after a pick in a multiple list: nothing moves\n if (optionValues(nextFilteredOptions) === optionValues(previousFilteredOptions)) {\n return\n }\n\n // Reset scroll position to the top\n listRef.value.scrollTop = 0\n\n // Highlight first item in the list\n const maybeFirstOption = getFirstValidOption(nextFilteredOptions)\n if (maybeFirstOption) highlightedValue.value = maybeFirstOption.value\n },\n { flush: \"post\" },\n )\n\n return () =>\n h(\n \"div\",\n {\n class: s.MenuInner,\n onKeydown: handleKeyDown,\n ref: menuRef,\n // Without search, the list takes focus (and the tab stop); the container\n // stays focusable so a click on it keeps the keys here\n tabindex: !searchable.value && filteredOptions.value.length ? -1 : 0,\n },\n [\n searchable.value\n ? h(CustomSelectSearch, {\n \"value\": searchTerm.value,\n \"hasResults\": !!filteredOptions.value.length,\n \"onUpdate:value\": (next: string) => {\n searchTerm.value = next\n },\n })\n : null,\n h(CustomSelectList, { filteredOptions: filteredOptions.value }),\n h(CustomSelectActions),\n ],\n )\n },\n})\n\nconst CustomSelectSearch = defineComponent({\n name: \"CustomSelectSearch\",\n props: {\n value: { type: String, required: true },\n /** Whether the list is rendered, for `aria-controls` */\n hasResults: { type: Boolean, required: true },\n },\n emits: {\n \"update:value\": (_value: string) => true,\n },\n setup(props, { emit }) {\n const { props: selectProps } = useSelectContext()\n const { listId, searchInputRef } = useCustomSelectMenuContext()\n const searchRef = shallowRef<HTMLElement | null>(null)\n\n // React's `ref` on Input is its <input>. Read before the menu's mount\n // focus runs (child mounted hooks run first); an exposed component ref\n // is not populated that early.\n onMounted(() => {\n searchInputRef.value = searchRef.value?.querySelector(\"input\") ?? null\n })\n onBeforeUnmount(() => {\n searchInputRef.value = null\n })\n\n return () =>\n h(\"div\", { class: s.Search, ref: searchRef }, [\n h(\n Input,\n {\n \"value\": props.value,\n \"size\": selectProps.searchSize,\n \"variant\": \"ghost\",\n \"pill\": true,\n \"placeholder\": selectProps.searchPlaceholder,\n \"aria-label\": selectProps.searchAriaLabel,\n \"onUpdate:value\": (next: string) => emit(\"update:value\", next),\n // The native attribute: it reaches the <input> whether or not\n // Input forwards its `autoComplete` prop (React's Input does)\n \"autocomplete\": \"off\",\n \"autocorrect\": \"off\",\n \"spellcheck\": false,\n \"aria-autocomplete\": \"list\",\n \"role\": \"combobox\",\n // The list, while there is one: with no results it is not rendered\n \"aria-controls\": props.hasResults ? listId : undefined,\n \"aria-expanded\": true,\n },\n {\n startAdornment: () =>\n h(Search, { width: 16, height: 16, class: \"fill-secondary\", fill: \"var(--color-text-secondary)\" }),\n },\n ),\n ])\n },\n})\n\nconst isOptionGroup = <T extends Option>(mixedOption: T | OptionGroup<T>): mixedOption is OptionGroup<T> => {\n return \"options\" in mixedOption\n}\n\nconst isOptionGroupArray = <T extends Option>(arr: Options<T>): arr is OptionGroup<T>[] => {\n return !!arr[0] && isOptionGroup(arr[0])\n}\n\nconst optionValues = <T extends Option>(options: Options<T>) =>\n (isOptionGroupArray(options) ? options.flatMap((group) => group.options) : options)\n .map((option) => option.value)\n .join(\"\\n\")\n\nconst HARD_OPTIONS_LIMIT = 300\n\nconst CustomSelectList = defineComponent({\n name: \"CustomSelectList\",\n props: {\n filteredOptions: { type: Array as PropType<Options<Option>>, required: true },\n },\n setup(props) {\n const { props: selectProps, slots, slotsVersion, triggerId, searchable } = useSelectContext()\n const { listId, listRef } = useCustomSelectMenuContext()\n const setListRef = (el: unknown) => {\n listRef.value = (el as HTMLElement | null) ?? null\n }\n\n return () => {\n void slotsVersion.value\n const { filteredOptions } = props\n\n if (!filteredOptions.length) {\n if (slots.searchEmptyMessage) {\n return h(\"div\", { class: s.SearchEmpty }, slots.searchEmptyMessage())\n }\n\n const { searchEmptyMessage } = selectProps\n return typeof searchEmptyMessage === \"string\"\n ? h(\"p\", { \"class\": s.SearchEmpty, \"data-text-only\": \"true\" }, searchEmptyMessage)\n : h(\"div\", { class: s.SearchEmpty }, [searchEmptyMessage as VNodeChild])\n }\n\n // We hard limit within groups, so at this level we will only limit flat arrays\n const isGrouped = isOptionGroupArray(filteredOptions)\n const hasHardLimit = !isGrouped && filteredOptions.length > HARD_OPTIONS_LIMIT\n\n const options = isGrouped\n ? filteredOptions.map((group) => h(CustomSelectGroup, { key: group.label, group }))\n : (filteredOptions as Option[])\n .slice(0, HARD_OPTIONS_LIMIT)\n .map((option) => h(CustomSelectOption, { key: option.value, option }))\n\n const { ariaLabel, ariaLabelledby } = selectProps\n const customTrigger = !!(slots.trigger || selectProps.trigger)\n return h(\n \"div\",\n {\n \"id\": listId,\n \"class\": s.OptionsList,\n \"ref\": setListRef,\n \"role\": \"listbox\",\n // Named like the trigger: its label, or the default trigger itself\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby ?? (ariaLabel || customTrigger ? undefined : triggerId),\n \"aria-multiselectable\": selectProps.multiple || undefined,\n // Without search, the list is the focused element\n \"tabindex\": searchable.value ? undefined : 0,\n },\n [\n ...options,\n hasHardLimit ? h(CustomSelectHardLimit, { numHidden: filteredOptions.length - HARD_OPTIONS_LIMIT }) : null,\n ],\n )\n }\n },\n})\n\nconst DEFAULT_OPTIONS_LIMIT = {\n limit: 100,\n label: \"Show all\",\n}\n\nconst CustomSelectGroup = defineComponent({\n name: \"CustomSelectGroup\",\n props: {\n group: { type: Object as PropType<OptionGroup<Option>>, required: true },\n },\n setup(props) {\n const groupId = useId()\n const headingId = useId()\n const { searchTerm, highlightedValue } = useCustomSelectMenuContext()\n const limitExpanded = ref(false)\n\n return () => {\n const { label, options, optionsLimit = DEFAULT_OPTIONS_LIMIT } = props.group\n const hasExpandableLimit = optionsLimit.limit < options.length && !searchTerm.value && !limitExpanded.value\n const hasHardLimit = HARD_OPTIONS_LIMIT < options.length && !hasExpandableLimit\n\n let maybeLimitedOptions = options\n if (hasExpandableLimit) {\n maybeLimitedOptions = options.slice(0, optionsLimit.limit)\n } else if (hasHardLimit) {\n maybeLimitedOptions = options.slice(0, HARD_OPTIONS_LIMIT)\n }\n\n const handleLimitExpanded = () => {\n // Expand options\n limitExpanded.value = true\n\n // Set highlight to the first option from the newly expanded list\n highlightedValue.value = options[optionsLimit.limit]!.value\n }\n\n // A group named by its heading. NOTE: The arrow keys walk every option in\n // document order (findNextOption), so they cross from group to group.\n return h(\"div\", { \"role\": \"group\", \"aria-labelledby\": headingId, \"class\": s.OptionGroup }, [\n // No indicator slot: the heading labels the whole section\n h(\"div\", { id: headingId, class: s.OptionGroupHeading }, label),\n ...maybeLimitedOptions.map((option) => h(CustomSelectOption, { key: option.value, option })),\n hasExpandableLimit\n ? h(CustomSelectExpandableLimit, {\n value: `group-limit-${groupId}`,\n label: optionsLimit.label,\n onPointerUp: handleLimitExpanded,\n })\n : null,\n hasHardLimit ? h(CustomSelectHardLimit, { numHidden: options.length - HARD_OPTIONS_LIMIT }) : null,\n ])\n }\n },\n})\n\nconst CustomSelectHardLimit = defineComponent({\n name: \"CustomSelectHardLimit\",\n props: {\n numHidden: { type: Number, required: true },\n },\n setup(props) {\n const { props: selectProps } = useSelectContext()\n\n return () =>\n h(\"div\", { class: s.OptionHardLimitHeading }, [\n // The note lines up with the option labels above it, so it borrows their indicator column.\n selectProps.checkPosition === \"start\" ? h(\"div\", { class: s.OptionIndicatorSlot }) : null,\n `…and ${props.numHidden.toLocaleString()} more options. Use search to refine results further.`,\n ])\n },\n})\n\nconst CustomSelectExpandableLimit = defineComponent({\n name: \"CustomSelectExpandableLimit\",\n props: {\n value: { type: String, required: true },\n label: { type: String, required: true },\n onPointerUp: { type: Function as PropType<() => void>, required: true },\n },\n setup(props) {\n const { props: selectProps } = useSelectContext()\n const { highlightedValue } = useCustomSelectMenuContext()\n const optionId = useId()\n\n const handlePointerMove = () => {\n if (props.value === highlightedValue.value) {\n return\n }\n\n highlightedValue.value = props.value\n }\n\n const handlePointerLeave = () => {\n // Clear the highlight only if it is this one\n if (highlightedValue.value === props.value) {\n highlightedValue.value = \"\"\n }\n }\n\n // This component acts a LOT like an Option, but has enough bespoke behavior\n // that it cannot literally be one.\n return () => {\n const isHighlighted = props.value === highlightedValue.value\n\n return h(\n \"div\",\n {\n \"id\": optionId,\n \"class\": clsx(s.Option, s.OptionsLimit),\n \"data-option-id\": props.value,\n \"data-highlight\": isHighlighted ? \"\" : undefined,\n // Not selectable: no aria-selected\n \"role\": \"option\",\n \"onPointerup\": props.onPointerUp,\n \"onPointermove\": handlePointerMove,\n \"onPointerleave\": handlePointerLeave,\n },\n [\n h(\"div\", { class: clsx(s.PressableInner, s.OptionInner) }, [\n // The row lines up with the option labels above it, so it borrows their indicator column.\n selectProps.checkPosition === \"start\" ? h(\"div\", { class: s.OptionIndicatorSlot }) : null,\n props.label,\n ]),\n ],\n )\n }\n },\n})\n\nconst INTERNAL_DOM_SELECTION_DATA_ATTR = \"data-option-id\"\n\nconst CustomSelectOption = defineComponent({\n name: \"CustomSelectOption\",\n props: {\n option: { type: Object as PropType<Option>, required: true },\n },\n setup(props) {\n const { props: selectProps, slots, slotsVersion, onSelect } = useSelectContext()\n const { openingValue, requestClose, highlightedValue } = useCustomSelectMenuContext()\n // Referenced by the list's aria-activedescendant while highlighted\n const optionId = useId()\n\n // NOTE: SingleSelect mode keeps the opening value instead of the live value\n // to avoid selecting the item as the select closes.\n const isSelected = () =>\n selectProps.multiple\n ? (selectProps.value as string[]).includes(props.option.value)\n : props.option.value === openingValue\n\n const handlePointerUp = () => {\n if (selectProps.multiple) {\n // Trigger the change, optionally as a remove\n onSelect(props.option, isSelected())\n } else {\n onSelect(props.option)\n // Request the dropdown to close\n requestClose()\n }\n }\n\n const handlePointerMove = () => {\n if (props.option.value === highlightedValue.value) {\n return\n }\n\n highlightedValue.value = props.option.value\n }\n\n const handlePointerLeave = () => {\n // Clear the highlight only if it is this one, removing the active highlight on the menu.\n if (highlightedValue.value === props.option.value) {\n highlightedValue.value = \"\"\n }\n }\n\n const renderOptionView = (option: Option): VNodeChild => {\n if (slots.optionView) return slots.optionView(option)\n if (selectProps.OptionView) return h(selectProps.OptionView, option)\n return option.label\n }\n\n const renderTooltip = (tooltip: NonNullable<Option[\"tooltip\"]>) => {\n const content = tooltip.content\n return typeof content === \"function\"\n ? h(Tooltip, { maxWidth: tooltip.maxWidth, side: \"right\" }, { default: () => h(Info), content })\n : h(Tooltip, { content, maxWidth: tooltip.maxWidth, side: \"right\" }, { default: () => h(Info) })\n }\n\n return () => {\n void slotsVersion.value\n const { option } = props\n const { value, disabled, tooltip } = option\n const selected = isSelected()\n const isHighlighted = value === highlightedValue.value\n const checkPosition = selectProps.checkPosition\n\n return h(\n \"div\",\n {\n \"id\": optionId,\n \"class\": clsx(s.Option, selectProps.optionClassName),\n \"data-highlight\": isHighlighted ? \"\" : undefined,\n \"role\": \"option\",\n // The selection; the highlight is the list's aria-activedescendant\n \"aria-selected\": selected,\n \"data-selected\": selected ? \"\" : undefined,\n // Internal attribute for selecting DOM nodes\n [INTERNAL_DOM_SELECTION_DATA_ATTR]: value,\n // Allow options to behave like a native select, when you can open and select an item in a single click\n ...(disabled ? {} : pressHandlers(handlePointerUp)),\n // Pointer move prevents contention between keyboard presses and a still mouse\n \"onPointermove\": disabled ? undefined : handlePointerMove,\n \"onPointerleave\": disabled ? undefined : handlePointerLeave,\n \"aria-disabled\": disabled,\n \"data-disabled\": disabled ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.PressableInner }, [\n checkPosition === \"start\"\n ? h(\"div\", { \"class\": s.OptionIndicatorSlot, \"data-position\": \"start\" }, [\n selected ? h(Check, { class: s.OptionCheck }) : null,\n ])\n : null,\n h(\"div\", { class: s.OptionLeading }, [\n h(\"div\", { class: s.OptionInner }, [renderOptionView(option), tooltip ? renderTooltip(tooltip) : null]),\n // React's `description && ...`: a 0 (or NaN) renders as text\n option.description &&\n h(\"div\", { class: clsx(s.OptionInner, s.OptionDescription) }, [renderContent(option.description)]),\n ]),\n checkPosition === \"end\"\n ? h(\"div\", { \"class\": s.OptionIndicatorSlot, \"data-position\": \"end\" }, [\n selected ? h(Check, { class: s.OptionCheck }) : null,\n ])\n : null,\n ]),\n ],\n )\n }\n },\n})\n\nconst CustomSelectActions = defineComponent({\n name: \"CustomSelectActions\",\n setup() {\n const { actions } = useSelectContext()\n\n return () => {\n if (actions.value.length === 0) {\n return null\n }\n\n return h(\n \"div\",\n { class: s.ActionsContainer },\n actions.value.map((action) => h(CustomSelectAction, { key: action.id, action })),\n )\n }\n },\n})\n\n/**\n * React handles events of the portalled menu at <body> and stops a synthetic\n * event there: <body>'s own listeners (the Escape stack) still run, the\n * document's and window's do not. Stopping the native event here instead\n * would keep it from <body>.\n */\nconst stopAfterBody = (evt: Event) => {\n const body = (evt.currentTarget as Node | null)?.ownerDocument?.body\n if (!body) {\n evt.stopPropagation()\n return\n }\n body.addEventListener(\n evt.type,\n (event) => {\n if (event === evt) event.stopPropagation()\n },\n { once: true },\n )\n}\n\nconst CustomSelectAction = defineComponent({\n name: \"CustomSelectAction\",\n props: {\n action: { type: Object as PropType<SelectAction>, required: true },\n },\n setup(props) {\n const { onActionSelect } = useSelectContext()\n const { requestClose } = useCustomSelectMenuContext()\n\n const handlePointerUp = () => {\n // Trigger the action through the context helper, not the method on this action (it may be a stale reference)\n onActionSelect(props.action.id)\n // Request to close the dropdown\n requestClose()\n }\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const key = evt.key\n\n switch (key) {\n case \"Tab\":\n // Allow tabbing to pass propagation as normal, which bubbles up to the focus scope\n break\n case \"Enter\":\n case \" \":\n evt.stopPropagation()\n handlePointerUp()\n break\n case \"Escape\":\n // The menu's key handler ignores Escape; the Escape stack on <body> closes the menu\n stopAfterBody(evt)\n break\n default:\n evt.stopPropagation()\n }\n }\n\n return () => {\n const { label, Icon, className } = props.action\n return h(\"div\", { class: s.Action, ...pressHandlers(handlePointerUp), onKeydown: handleKeyDown, tabindex: 0 }, [\n h(\"div\", { class: clsx(s.ActionInner, className) }, [Icon ? h(Icon, { role: \"presentation\" }) : null, label]),\n ])\n }\n },\n})\n\n// ============================================================\n// Utilities\n// ============================================================\nconst defaultSearchPredicate = (option: Option, searchTerm: string) => option.label.toLowerCase().includes(searchTerm)\n\nconst filterOptions = <T extends Option>(\n options: Options<T>,\n searchTerm: string,\n searchIterator: SearchPredicate<T>,\n): Options<T> => {\n const searchValue = searchTerm.trim().toLocaleLowerCase()\n\n if (!searchValue) {\n return options\n }\n\n const filterOption = (option: T): boolean => searchIterator(option, searchValue)\n\n if (isOptionGroupArray(options)) {\n return options.reduce((acc, group) => {\n const filtered = group.options.filter(filterOption)\n\n if (filtered.length) {\n acc.push({\n ...group,\n options: filtered,\n })\n }\n return acc\n }, [] as OptionGroup<T>[])\n } else {\n return (options as T[]).reduce((acc, option) => {\n if (filterOption(option)) acc.push(option)\n return acc\n }, [] as T[])\n }\n}\n\nconst getFirstValidOption = <T extends Option>(options: Options<T>): T | undefined => {\n if (!options.length) {\n return undefined\n }\n\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const firstNonDisabled = opt.options.find((i) => !i.disabled)\n if (firstNonDisabled) {\n found = firstNonDisabled\n break\n }\n } else {\n if (!opt.disabled) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionByValue = <T extends Option>(options: Options<T>, value: string): T | undefined => {\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.find((i) => i.value === value)\n if (exists) {\n found = exists\n break\n }\n } else {\n if (opt.value === value) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionsByValues = <T extends Option>(options: Options<T>, values: string[]): T[] => {\n let found: T[] = []\n const lookup = new Set(values)\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.filter((i) => lookup.has(i.value))\n found = found.concat(exists)\n } else {\n if (lookup.has(opt.value)) {\n found.push(opt)\n }\n }\n }\n\n return found\n}\n\nconst MAX_DOM_CRAWLS = 40\n\nconst findOptionByValue = (currentValue: string, container: HTMLElement) =>\n container.querySelector(`[data-option-id=\"${CSS.escape(currentValue)}\"]`)\n\nconst isValidOptionNode = (node: Element) => node.matches(\"[data-option-id]:not([data-disabled])\")\n\n// Steps from the current option to the nearest enabled one, one option row at a\n// time in document order: across groups (siblings would stop at a group's\n// edge), skipping disabled rows, at most MAX_DOM_CRAWLS rows away\nconst findAdjacentOption = (currentValue: string, container: HTMLElement, step: 1 | -1) => {\n const currentOption = findOptionByValue(currentValue, container)\n const rows = Array.from(container.querySelectorAll(\"[data-option-id]\"))\n\n let index = currentOption ? rows.indexOf(currentOption) : -1\n if (index === -1) {\n return undefined\n }\n\n for (let maxSteps = 0; maxSteps < MAX_DOM_CRAWLS; maxSteps += 1) {\n index += step\n const nextNode = rows[index]\n\n if (!nextNode) {\n return undefined\n }\n\n if (isValidOptionNode(nextNode)) {\n return nextNode\n }\n }\n}\n\nconst findNextOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, 1)\n\nconst findPreviousOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, -1)\n\nconst createTypeahead = () => {\n let currentValue: string = \"\"\n let timeoutId: ReturnType<typeof setTimeout> | undefined\n\n return (char: string) => {\n // Searching is case-insensitive\n char = char.toLowerCase()\n\n // Add the new character to the current value\n currentValue += char\n\n // Clear the previous timeout if there was one\n if (timeoutId) clearTimeout(timeoutId)\n\n // Reset the value after a brief delay\n timeoutId = setTimeout(() => {\n currentValue = \"\"\n }, 500)\n\n // When a user is typing the same value, like \"llll\", assume they are cycling through items starting with \"l\"\n const isCycling = char.repeat(currentValue.length) === currentValue\n\n // Return the typeahead value\n return isCycling ? char : currentValue\n }\n}\n\nconst isValidTypeaheadChar = (char: string): boolean => /^[a-zA-Z0-9]$/.test(char)\n\n// A shortcut (Ctrl+C, Cmd+A, Alt+letter) or a key another handler took is not typeahead\nconst isTypeaheadKey = (evt: KeyboardEvent): boolean =>\n isValidTypeaheadChar(evt.key) && !evt.ctrlKey && !evt.metaKey && !evt.altKey && !evt.defaultPrevented\n\nconst resolveElement = (instance: unknown): HTMLElement | null => {\n const node = instance && typeof instance === \"object\" && \"$el\" in instance ? (instance as { $el: unknown }).$el : instance\n // A multi-root component's $el is the text node opening its fragment; the\n // element follows it (as in Reka)\n const element = node instanceof Text ? node.nextElementSibling : node\n return element instanceof HTMLElement ? element : null\n}\n\nconst getTypeaheadOption = <T extends Option>(\n options: Options<T>,\n typeaheadValue: string,\n currentHighlightValue?: string,\n): T | undefined => {\n // Ensure options actually exist\n if (!options.length) {\n return undefined\n }\n\n let matchBeforeHighlight: T | undefined\n // If we aren't provided a highlighted value, start from the top (e.g., act like it's found)\n let foundHighlightedValue: boolean = !currentHighlightValue\n\n const optionValidAndMatches = ({ disabled, label, value }: T) => {\n // Side effect of looping\n if (value === currentHighlightValue) {\n foundHighlightedValue = true\n // Don't return highlighted value\n return false\n }\n\n return !disabled && label.toLowerCase().startsWith(typeaheadValue)\n }\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n for (const option of opt.options) {\n if (optionValidAndMatches(option)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match, in any group\n return option\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || option\n }\n }\n }\n } else {\n if (optionValidAndMatches(opt)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match\n return opt\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || opt\n }\n }\n }\n }\n\n return matchBeforeHighlight\n}\n\ntype SelectOwnProps = InstanceType<typeof SelectComponent>[\"$props\"]\n\ntype SingleSelectProps = {\n /** Determines if the select should support multiple selection. @default false */\n multiple?: false\n /** Selected value. Bind `v-model:value`. */\n value: string\n onChange?: (option: Option) => void\n \"onUpdate:value\"?: (value: string) => void\n}\n\ntype MultiSelectProps = {\n /** Determines if the select should support multiple selection. @default false */\n multiple: true\n /** Selected values. Bind `v-model:value`. */\n value: string[]\n onChange?: (options: Option[]) => void\n \"onUpdate:value\"?: (value: string[]) => void\n}\n\n/** As in React, `multiple` decides the type of `value` and of the `change` and `update:value` payloads. */\nexport type SelectProps = Omit<SelectOwnProps, \"multiple\" | \"value\" | \"onChange\" | \"onUpdate:value\"> &\n (SingleSelectProps | MultiSelectProps)\n\n/**\n * Select dropdown with option groups, descriptions, search (over 15\n * options), multiple selection and actions. Bind `v-model:value`.\n */\nexport const Select = SelectComponent as typeof SelectComponent & { new (): { $props: SelectProps } }\n"]}
@@ -35,6 +35,11 @@ declare const FieldComponent: import("vue").DefineComponent<import("vue").Extrac
35
35
  type: BooleanConstructor;
36
36
  default: boolean;
37
37
  };
38
+ /** On a `row`, the control takes the rest of the line after the label. @default false */
39
+ fill: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
38
43
  /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */
39
44
  id: StringConstructor;
40
45
  /** Optically aligns the control's text with surrounding content; passed to the control. */
@@ -67,11 +72,17 @@ declare const FieldComponent: import("vue").DefineComponent<import("vue").Extrac
67
72
  type: BooleanConstructor;
68
73
  default: boolean;
69
74
  };
75
+ /** On a `row`, the control takes the rest of the line after the label. @default false */
76
+ fill: {
77
+ type: BooleanConstructor;
78
+ default: boolean;
79
+ };
70
80
  /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */
71
81
  id: StringConstructor;
72
82
  /** Optically aligns the control's text with surrounding content; passed to the control. */
73
83
  opticallyAlign: PropType<"start" | "end">;
74
84
  }>> & Readonly<{}>, {
85
+ fill: boolean;
75
86
  required: boolean;
76
87
  row: boolean;
77
88
  }, SlotsType<{
@@ -157,15 +157,12 @@ declare const SelectComponent: import("vue").DefineComponent<import("vue").Extra
157
157
  type: BooleanConstructor;
158
158
  default: boolean;
159
159
  };
160
- /** Width of the menu. @default "auto" */
160
+ /** Width of the menu. @default the trigger width (fits the options when not block) */
161
161
  listWidth: PropType<ListSize>;
162
- /** `min-width` of the menu, in pixels. @default the trigger width (300 when not block) */
162
+ /** `min-width` of the menu, in pixels. @default the trigger width */
163
163
  listMinWidth: PropType<ListSize>;
164
- /** `max-width` of the menu, in pixels. @default "auto" */
165
- listMaxWidth: {
166
- type: PropType<ListSize>;
167
- default: string;
168
- };
164
+ /** `max-width` of the menu, in pixels. @default "auto" (300 when not block) */
165
+ listMaxWidth: PropType<ListSize>;
169
166
  /** Predicate used to filter searches */
170
167
  searchPredicate: PropType<SearchPredicate<Option>>;
171
168
  /** Placeholder of the search input */
@@ -309,15 +306,12 @@ declare const SelectComponent: import("vue").DefineComponent<import("vue").Extra
309
306
  type: BooleanConstructor;
310
307
  default: boolean;
311
308
  };
312
- /** Width of the menu. @default "auto" */
309
+ /** Width of the menu. @default the trigger width (fits the options when not block) */
313
310
  listWidth: PropType<ListSize>;
314
- /** `min-width` of the menu, in pixels. @default the trigger width (300 when not block) */
311
+ /** `min-width` of the menu, in pixels. @default the trigger width */
315
312
  listMinWidth: PropType<ListSize>;
316
- /** `max-width` of the menu, in pixels. @default "auto" */
317
- listMaxWidth: {
318
- type: PropType<ListSize>;
319
- default: string;
320
- };
313
+ /** `max-width` of the menu, in pixels. @default "auto" (300 when not block) */
314
+ listMaxWidth: PropType<ListSize>;
321
315
  /** Predicate used to filter searches */
322
316
  searchPredicate: PropType<SearchPredicate<Option>>;
323
317
  /** Placeholder of the search input */
@@ -370,7 +364,6 @@ declare const SelectComponent: import("vue").DefineComponent<import("vue").Extra
370
364
  dropdownIconType: DropdownIconType;
371
365
  loadingPlaceholder: string;
372
366
  allSelectedLabel: string;
373
- listMaxWidth: ListSize;
374
367
  searchPlaceholder: string;
375
368
  searchAriaLabel: string;
376
369
  searchEmptyMessage: string | number | VNode<import("vue").RendererNode, import("vue").RendererElement, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/vue",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
5
5
  "type": "module",
6
6
  "license": "MIT",