import{j as E}from"./jsx-runtime-CnH95YSl.js";import{r as s}from"./index-NdkWRN8K.js";import{O as M}from"./OdysseyStorybookThemeDecorator-BuDiOG2V.js";import{f as e}from"./fieldComponentPropsMetaData-BqbNLw6V.js";import{s as i,M as T}from"./SearchField-BdnOrhVM.js";import"./_commonjsHelpers-gnU0ypJ3.js";import"./OdysseyThemeProvider-Bh0Bu-2o.js";import"./index-BJTM6NaI.js";import"./OdysseyProvider-qIn9QVYS.js";import"./Field-DH3L8v09.js";import"./Box-1mvP3NLW.js";import"./Box-BcMTQ_R2.js";import"./createBox-Dxawkfow.js";import"./List-CmjR1pNu.js";import"./ListItem-C0ExFtXb.js";import"./utils-iop7lDec.js";import"./useFormControl-BMISTZuX.js";import"./FormLabel-CiGre9wK.js";import"./useIsFocusVisible-DH0qxT5e.js";import"./isHostComponent-DVu5iVWx.js";import"./ButtonBase-BNqa2TMD.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-CJ6Ie9dp.js";import"./TransitionGroupContext-DAL84N7p.js";import"./ScreenReaderText-CebALBsG.js";import"./visuallyHidden-Dan1xhjv.js";import"./FormHelperText-CsNAE1E3.js";import"./FieldHint-B3Jif_Up.js";import"./Typography-Cz6D417Y.js";import"./Typography-ClQ35Rr-.js";import"./useUniqueId-Bsgqe1tm.js";import"./createUniqueId-ByTaVY63.js";import"./inputUtils-Dbi8XkA6.js";import"./InputBase-DeB4_faH.js";import"./ownerWindow-HkKU3E4x.js";import"./ownerDocument-DW-IO8s5.js";import"./debounce-Be36O1Ab.js";import"./InputAdornment-CdR3XT6f.js";import"./Search-C5TVrLyE.js";import"./IconButton-5qShmnSr.js";const Ce={component:T,decorators:[M],tags:["autodocs"],argTypes:{autoCompleteType:{control:"text",description:"This prop helps users to fill forms faster, especially on mobile devices. The name can be confusing, as it's more like an autofill. You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill)",table:{type:{summary:"string"},defaultValue:{summary:void 0}}},defaultValue:{control:"text",description:"The value of the `input` element. Use when the component is not controlled",table:{type:{summary:"string"},defaultValue:{summary:void 0}}},hasInitialFocus:{control:"boolean",description:"If `true`, the component will receive focus automatically",table:{type:{summary:"boolean"}}},isDisabled:e.isDisabled,isFullWidth:e.isFullWidth,id:e.id,label:{control:"text",description:"This label won't show up visually, but it's required for accessibility",table:{type:{summary:"string"}},type:{required:!0,name:"string"}},name:e.name,onBlur:{description:"Callback fired when the `input` element loses focus",table:{type:{summary:"function"}}},onClear:{description:"Callback fired when the clear button is pressed",table:{type:{summary:"function"}}},onChange:{description:"Callback fired when the value is changed",table:{type:{summary:"function"}}},onFocus:{description:"Callback fired when the `input` element gets focus",table:{type:{summary:"function"}}},placeholder:{control:"text",description:"The short hint displayed in the `input` before the user enters a value",table:{type:{summary:"string"}}},value:{control:"text",description:"The value of the `input` element. Use when the component is controlled",table:{type:{summary:"string"},defaultValue:{summary:void 0}}},variant:{options:i,control:{type:"radio"},description:"The color and style of the button",table:{type:{summary:i.join(" | ")},defaultValue:{summary:"outline"}},type:{required:!0,name:"other",value:"radio"}}},args:{label:"Search",placeholder:"Search planets"}},t={args:{defaultValue:""}},o={args:{defaultValue:"",variant:"filled"}},r={args:{isDisabled:!0}},a={args:{isFullWidth:!0}},n={parameters:{docs:{description:{story:"When the component is controlled, the parent component is responsible for managing the state of `SearchField`. `onChange` should be used to listen for component changes and to update the values in the `value` prop."}}},args:{defaultValue:void 0},render:function(w){const[x,l]=s.useState("Jupiter"),k=s.useCallback(W=>l(W.target.value),[]),D=s.useCallback(()=>{l("")},[]);return E.jsx(T,{...w,onChange:k,onClear:D,value:x})}};var u,p,m;t.parameters={...t.parameters,docs:{...(u=t.parameters)==null?void 0:u.docs,source:{originalSource:`{
  args: {
    defaultValue: ""
  }
}`,...(m=(p=t.parameters)==null?void 0:p.docs)==null?void 0:m.source}}};var c,d,h;o.parameters={...o.parameters,docs:{...(c=o.parameters)==null?void 0:c.docs,source:{originalSource:`{
  args: {
    defaultValue: "",
    variant: "filled"
  }
}`,...(h=(d=o.parameters)==null?void 0:d.docs)==null?void 0:h.source}}};var f,g,b;r.parameters={...r.parameters,docs:{...(f=r.parameters)==null?void 0:f.docs,source:{originalSource:`{
  args: {
    isDisabled: true
  }
}`,...(b=(g=r.parameters)==null?void 0:g.docs)==null?void 0:b.source}}};var y,C,v;a.parameters={...a.parameters,docs:{...(y=a.parameters)==null?void 0:y.docs,source:{originalSource:`{
  args: {
    isFullWidth: true
  }
}`,...(v=(C=a.parameters)==null?void 0:C.docs)==null?void 0:v.source}}};var V,S,F;n.parameters={...n.parameters,docs:{...(V=n.parameters)==null?void 0:V.docs,source:{originalSource:`{
  parameters: {
    docs: {
      description: {
        story: "When the component is controlled, the parent component is responsible for managing the state of \`SearchField\`. \`onChange\` should be used to listen for component changes and to update the values in the \`value\` prop."
      }
    }
  },
  args: {
    defaultValue: undefined
  },
  render: function C(props) {
    const [constrolledValue, setControlledValue] = useState("Jupiter");
    const onChange = useCallback((event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => setControlledValue(event.target.value), []);
    const onClear = useCallback(() => {
      setControlledValue("");
    }, []);
    return <SearchField {...props} onChange={onChange} onClear={onClear} value={constrolledValue} />;
  }
}`,...(F=(S=n.parameters)==null?void 0:S.docs)==null?void 0:F.source}}};const ve=["Default","FilledVariant","Disabled","FullWidth","ControlledSearch"];export{n as ControlledSearch,t as Default,r as Disabled,o as FilledVariant,a as FullWidth,ve as __namedExportsOrder,Ce as default};
