{"version":3,"file":"Dropdown.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAmBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { OptionElement } from './Option';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n * @property disabled - Whether the dropdown is disabled.\n * @category Component Props\n */\nexport type DropdownProps = {\n  name: string;\n  value?: string | undefined;\n  children: SnapsChildren<OptionElement>;\n  disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @param props.disabled - Whether the dropdown is disabled.\n * @returns A dropdown element.\n * @example\n * <Dropdown name=\"dropdown\">\n *  <Option value=\"option1\">Option 1</Option>\n *  <Option value=\"option2\">Option 2</Option>\n *  <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n * @category Components\n */\nexport const Dropdown = createSnapComponent<DropdownProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see {@link Dropdown}\n * @category Elements\n */\nexport type DropdownElement = ReturnType<typeof Dropdown>;\n"]}