{"version":3,"names":["dynamic","createMemo","omit","composeRefs","userRef","mergeRootProps","resolveClassStyle","useSelectRootContext","SelectIcon","props","root","state","open","internal","children","data-popup-open","undefined","userClassStyle","userProps","merged","Tag","as"],"sources":["select-icon.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { createMemo, omit } from \"solid-js\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport { useSelectRootContext } from \"../select-root-context\";\n\nexport interface SelectIconState {\n\topen: boolean;\n}\n\nexport interface SelectIconProps\n\textends BaseUIComponentProps<\"span\", SelectIconState> {\n\tas?: ValidComponent;\n}\n\n/**\n * `<Select.Icon>` — a decorative `<span>` that indicates the trigger opens a\n * select popup.\n */\nexport function SelectIcon(props: SelectIconProps): JSX.Element {\n\tconst root = useSelectRootContext();\n\n\tconst state = createMemo<SelectIconState>(() => ({ open: root.open() }));\n\n\tconst internal = {\n\t\t\"aria-hidden\": \"true\" as const,\n\t\tchildren: \"▼\" as JSX.Element,\n\t\t// triggerOpenStateMapping: open → data-popup-open.\n\t\tget \"data-popup-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\tconst userProps = omit(props, \"as\", \"class\", \"style\", \"attrs\");\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tinternal,\n\t\tuserClassStyle,\n\t);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"span\");\n\treturn <Tag {...merged} ref={composeRefs(userRef(props))} />;\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,UAAU,EAAEC,IAAI,QAAQ,UAAU;AAC3C,SAASC,WAAW,EAAEC,OAAO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