{"version":3,"sources":["../../../../src/lib/elements/select.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Select as RadixSelect } from \"@radix-ui/themes\";\nimport cx from \"clsx\";\nimport { useElement } from \"../widgets-context.js\";\nimport { getDomProps, namespaceClassNames } from \"../utils.js\";\n\ninterface TriggerProps extends Omit<RadixSelect.TriggerProps, \"variant\"> {}\n\nconst SelectTrigger = React.forwardRef<HTMLButtonElement, TriggerProps>(\n  function SelectTrigger({ className, ...props }, ref) {\n    const element = useElement(\"select\");\n    return (\n      <RadixSelect.Trigger\n        ref={ref}\n        {...getDomProps({ elementId: \"select\", className })}\n        {...props}\n        {...element}\n      />\n    );\n  },\n);\n\ninterface ContentProps extends Omit<RadixSelect.ContentProps, \"variant\"> {}\n\nconst SelectContent = React.forwardRef<HTMLDivElement, ContentProps>(\n  function SelectContent({ className, ...props }, ref) {\n    const element = useElement(\"dropdown\");\n    return (\n      <RadixSelect.Content\n        ref={ref}\n        {...getDomProps({\n          elementId: \"dropdown\",\n          // TODO: This should probably be removed in the next major version. We\n          // should have a consistent way to differentiate between dropdowns and\n          // selects in the elements API.\n          className: cx(className, namespaceClassNames(\"select-dropdown\")),\n        })}\n        {...props}\n        {...element}\n      />\n    );\n  },\n);\n\ninterface ItemProps extends Omit<RadixSelect.ItemProps, \"variant\"> {}\n\nconst SelectItem = React.forwardRef<HTMLDivElement, ItemProps>(\n  function SelectItem({ className, ...props }, ref) {\n    const element = useElement(\"primaryMenuItem\");\n    return (\n      <RadixSelect.Item\n        ref={ref}\n        {...getDomProps({\n          elementId: \"primaryMenuItem\",\n          // TODO: This should probably be removed in the next major version. We\n          // should have a consistent way to differentiate between dropdowns and\n          // selects in the elements API.\n          className: cx(className, namespaceClassNames(\"select-item\")),\n        })}\n        {...props}\n        {...element}\n      />\n    );\n  },\n);\n\nexport {\n  SelectTrigger as Trigger,\n  SelectContent as Content,\n  SelectItem as Item,\n};\n\nexport type { TriggerProps, ContentProps, ItemProps };\n\nexport {\n  Group,\n  Label,\n  Root,\n  Separator,\n} from \"@radix-ui/themes/components/select\";\nexport type {\n  GroupProps,\n  LabelProps,\n  RootProps,\n  SeparatorProps,\n} from \"@radix-ui/themes/components/select\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcM;AAZN,YAAuB;AACvB,oBAAsC;AACtC,kBAAe;AACf,6BAA2B;AAC3B,mBAAiD;AAsEjD,oBAKO;AAvEP,MAAM,gBAAgB,MAAM;AAAA,EAC1B,SAASA,eAAc,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AACnD,UAAM,cAAU,mCAAW,QAAQ;AACnC,WACE;AAAA,MAAC,cAAAC,OAAY;AAAA,MAAZ;AAAA,QACC;AAAA,QACC,OAAG,0BAAY,EAAE,WAAW,UAAU,UAAU,CAAC;AAAA,QACjD,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAIA,MAAM,gBAAgB,MAAM;AAAA,EAC1B,SAASC,eAAc,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AACnD,UAAM,cAAU,mCAAW,UAAU;AACrC,WACE;AAAA,MAAC,cAAAD,OAAY;AAAA,MAAZ;AAAA,QACC;AAAA,QACC,OAAG,0BAAY;AAAA,UACd,WAAW;AAAA;AAAA;AAAA;AAAA,UAIX,eAAW,YAAAE,SAAG,eAAW,kCAAoB,iBAAiB,CAAC;AAAA,QACjE,CAAC;AAAA,QACA,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAIA,MAAM,aAAa,MAAM;AAAA,EACvB,SAASC,YAAW,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAChD,UAAM,cAAU,mCAAW,iBAAiB;AAC5C,WACE;AAAA,MAAC,cAAAH,OAAY;AAAA,MAAZ;AAAA,QACC;AAAA,QACC,OAAG,0BAAY;AAAA,UACd,WAAW;AAAA;AAAA;AAAA;AAAA,UAIX,eAAW,YAAAE,SAAG,eAAW,kCAAoB,aAAa,CAAC;AAAA,QAC7D,CAAC;AAAA,QACA,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":["SelectTrigger","RadixSelect","SelectContent","cx","SelectItem"]}