{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "select-field",
  "type": "registry:item",
  "title": "Select Field",
  "description": "A labelled dropdown on a native <select>: the platform's own picker on every device, keyboard typeahead, autofill, and form submission under `name`. `options` is `[{ value, label }]`, or groups `[{ label, options: [...] }]`. `placeholder` adds an empty first choice, and with `required` the form won't submit until one is chosen. `value` is two-way.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "input"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/select-field.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/select-field.js",
      "content": "// Generated by zubra from select-field.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { id } from '@zubra/runtime';\n\nexport const tag = \"select-field\";\n\nexport default $define(tag, {\n  props: {\n    \"value\": { attribute: \"value\", default: \"\", required: false, model: true },\n    \"options\": { attribute: \"options\", default: [], required: false },\n    \"label\": { attribute: \"label\", default: \"\", required: false },\n    \"description\": { attribute: \"description\", default: \"\", required: false },\n    \"name\": { attribute: \"name\", default: \"\", required: false },\n    \"placeholder\": { attribute: \"placeholder\", default: \"\", required: false },\n    \"required\": { attribute: \"required\", default: false, required: false },\n    \"disabled\": { attribute: \"disabled\", default: false, required: false },\n    \"autocomplete\": { attribute: \"autocomplete\", default: \"\", required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [],\n  events: [\"valuechange\"],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (select-field) to ([data-zb-slotted=\\\"select-field\\\"]) {\\n  :scope { display: block; }\\n  .select-field { display: grid; gap: 0.4rem; }\\n  label { font-weight: 600; font-size: 0.925rem; }\\n  .select-help { margin: 0; font-size: 0.85rem; color: color-mix(in oklab, var(--muted-foreground, #71717a) 75%, var(--foreground, #18181b)); }\\n  .select-box { position: relative; }\\n  .select-box::after { content: \\\"\\\"; position: absolute; right: 0.85rem; top: 50%; width: 0.45rem; height: 0.45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }\\n  select { appearance: none; width: 100%; padding: 0.55rem 2.25rem 0.55rem 0.75rem; border: 1px solid var(--input, #e4e4e7); border-radius: calc(var(--radius, 0.625rem) - 2px); background: var(--background, #fff); color: var(--foreground, #18181b); font: inherit; cursor: pointer; }\\n  select:focus-visible { outline: none; border-color: var(--ring, #a1a1aa); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring, #a1a1aa) 40%, transparent); }\\n  select:disabled { opacity: 0.55; cursor: not-allowed; }\\n}\\n}\\n\",\n  template: \"\\n  <div class=\\\"select-field\\\">\\n    <label></label>\\n    <!--[--><!--]-->\\n    <div class=\\\"select-box\\\">\\n      <select>\\n        <!--[--><!--]-->\\n        <!--[--><!--]-->\\n      </select>\\n    </div>\\n  </div>\\n\",\n  setup($p, $emit) {\n                                     \n\n  const selectId = id()\n  const helpId = id()\n    return [\n      { path: [0, 0], attribute: \"for\", value: () => $r(selectId) },\n      { path: [0, 0], text: () => $t($p.label) },\n      { path: [0, 1], when: () => $p.description, blocks: [{ template: \"<p class=\\\"select-help\\\"></p>\", parts: () => [{ path: [0], attribute: \"id\", value: () => $r(helpId) }, { path: [0], text: () => $t($p.description) }] }, null] },\n      { path: [0, 2, 0], attribute: \"id\", value: () => $r(selectId) },\n      { path: [0, 2, 0], attribute: \"name\", value: () => ($p.name || null) },\n      { path: [0, 2, 0], attribute: \"required\", boolean: true, value: () => $p.required },\n      { path: [0, 2, 0], attribute: \"disabled\", boolean: true, value: () => $p.disabled },\n      { path: [0, 2, 0], attribute: \"autocomplete\", value: () => ($p.autocomplete || null) },\n      { path: [0, 2, 0], attribute: \"aria-describedby\", value: () => ($p.description ? $r(helpId) : null) },\n      { path: [0, 2, 0], attribute: \"value\", value: () => $p.value },\n      { path: [0, 2, 0], on: \"change\", handler: () => ((event) => ($p.value = event.target.value)) },\n      { path: [0, 2, 0, 0], when: () => $p.placeholder, blocks: [{ template: \"<option value=\\\"\\\"></option>\", parts: () => [{ path: [0], text: () => $t($p.placeholder) }] }, null] },\n      { path: [0, 2, 0, 1], each: () => $p.options, key: (option, i) => ($r(option).value ?? `group-${$r(i)}`), block: { template: \"\\n          <!--[--><!--]-->\\n        \", parts: (option, i) => [{ path: [0], when: () => $r(option).options, blocks: [{ template: \"<optgroup>\\n            <!--[--><!--]-->\\n          </optgroup>\", parts: () => [{ path: [0], attribute: \"label\", value: () => $r(option).label }, { path: [0, 0], each: () => $r(option).options, key: (choice, $index) => $r(choice).value, block: { template: \"\\n              <option></option>\\n            \", parts: (choice, $index) => [{ path: [0], attribute: \"value\", value: () => $r(choice).value }, { path: [0], text: () => $t($r(choice).label) }] } }] }, { template: \"<option></option>\", parts: () => [{ path: [0], attribute: \"value\", value: () => $r(option).value }, { path: [0], text: () => $t($r(option).label) }] }] }] } },\n    ];\n  },\n});\n"
    }
  ]
}
