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