Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bestax-mcp/data/components/Field.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
},
{
"title": "Compound (dot-notation) usage",
"code": "<Field horizontal>\n <Field.Label>Name</Field.Label>\n <Field.Body>\n <Field.Control>\n <Input placeholder=\"Jane Doe\" />\n </Field.Control>\n </Field.Body>\n</Field>"
"code": "<Field horizontal>\n <Field.Label size=\"normal\">\n <label className=\"label\" htmlFor=\"compound-name\">\n Name\n </label>\n </Field.Label>\n <Field.Body>\n <Field.Control>\n <Input id=\"compound-name\" placeholder=\"Jane Doe\" />\n </Field.Control>\n </Field.Body>\n</Field>"
}
],
"accessibility": "- The `label` prop names the one control the Field holds. A composed `InputBase`, `SelectBase`, or `TextAreaBase`, or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id the label's `for` points at, so clicking the label focuses the control and assistive technology announces it.\n- A range `Slider` takes that id on its low thumb, and its thumbs also point `aria-labelledby` at the label (at `labelProps.id` when you set one), so under a label of \"Price range\" they announce as \"Price range Minimum value\" and \"Price range Maximum value\". An `ariaLabel` entry names its thumb instead, and an `aria-label` or `aria-labelledby` on the Slider takes the label's place in both names.\n- A group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`) can't take a `for`, so the label gets an id (yours from `labelProps.id`, otherwise a generated one) and the group points `aria-labelledby` at it. An `aria-label` or `aria-labelledby` you set on the group wins over the Field's label, as it does over a group's own `label`.\n- An `id` you set on the control wins too: it keeps that id, and the label then names it only if you point `labelProps={{ htmlFor }}` at it. Pass `labelProps={{ htmlFor: undefined }}` to opt out of the association entirely.\n- Association is skipped for `grouped`/`hasAddons` fields (they hold several controls), and a `Field` nested inside a labeled one starts its own scope. A horizontal Field wraps its children in a `Field.Body` of its own and keeps the association, but the pattern with an inner `Field` in that body needs it wired by hand.\n- Two controls in one plain labeled Field would both adopt its id. Give each an `id` of its own and label it individually.\n- A labeled Field whose content takes no `for`, a group included, renders its `for` unmatched. `Checkbox`, `Radio` and `Switch` take nothing from the label at all: each is named by its own children, so put the text there rather than in the Field's `label`. Where you point content at the label by hand, as with a group in an inner `Field`, pass `labelProps={{ id, htmlFor: undefined }}` so the label keeps its id and drops the `for`.\n- Grouped/horizontal layouts use Bulma’s grid for layout.\n- Always use the `label` prop or a custom label for clarity.",
"accessibility": "- The `label` prop names the one control the Field holds. A composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase`, or `DateTimeInputBase`, or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id the label's `for` points at, so clicking the label focuses the control and assistive technology announces it. An `inline` picker renders no input, so it takes nothing.\n- A range `Slider` takes that id on its low thumb, and its thumbs also point `aria-labelledby` at the label (at `labelProps.id` when you set one), so under a label of \"Price range\" they announce as \"Price range Minimum value\" and \"Price range Maximum value\". An `ariaLabel` entry names its thumb instead, and an `aria-label` or `aria-labelledby` on the Slider takes the label's place in both names.\n- A group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`) can't take a `for`, so the label gets an id (yours from `labelProps.id`, otherwise a generated one) and the group points `aria-labelledby` at it. An `aria-label` or `aria-labelledby` you set on the group wins over the Field's label, as it does over a group's own `label`.\n- An `id` you set on the control wins too: it keeps that id, and the label then names it only if you point `labelProps={{ htmlFor }}` at it. Pass `labelProps={{ htmlFor: undefined }}` to opt out of the association entirely.\n- Association is skipped for `grouped`/`hasAddons` fields (they hold several controls), and a `Field` nested inside a labeled one starts its own scope. A horizontal Field wraps its children in a `Field.Body` of its own and keeps the association, but the pattern with an inner `Field` in that body needs it wired by hand.\n- Two controls in one plain labeled Field would both adopt its id. Give each an `id` of its own and label it individually.\n- A labeled Field whose content takes no `for`, a group included, renders its `for` unmatched. `Checkbox`, `Radio` and `Switch` take nothing from the label at all: each is named by its own children, so put the text there rather than in the Field's `label`. Where you point content at the label by hand, as with a group in an inner `Field`, pass `labelProps={{ id, htmlFor: undefined }}` so the label keeps its id and drops the `for`.\n- Grouped/horizontal layouts use Bulma’s grid for layout.\n- Always use the `label` prop or a custom label for clarity.",
"related": [
"Checkbox",
"Checkboxes",
Expand Down Expand Up @@ -149,7 +149,7 @@
"name": "label",
"type": "React.ReactNode",
"default": null,
"description": "Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase` or `TextAreaBase`, or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id that the label's `htmlFor` points at, and a group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`) points `aria-labelledby` at the label's own id unless you gave the group an `aria-label` or `aria-labelledby`. A range `Slider` takes the id on its low thumb and also starts each thumb's name with the label through `aria-labelledby`, unless its `ariaLabel` names that thumb or its own `aria-label` or `aria-labelledby` takes the label's place. Nothing else takes the label: `Checkbox`, `Radio` and `Switch` are named by their own children. Only the single inputs take the `htmlFor`, so with a group or any other content it matches nothing. Pass `labelProps={{ htmlFor }}` to wire your own `id`, or `labelProps={{ htmlFor: undefined }}` to opt out. Skipped for `grouped`/`hasAddons` fields (multiple controls), and a nested `Field` starts its own scope, so a horizontal Field whose body holds an inner `Field` names the control there only when you wire it. Two controls in one plain labeled Field would both adopt the id, so give each an `id` of its own.",
"description": "Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase` or `DateTimeInputBase` (an `inline` picker has no input, so it takes nothing), or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id that the label's `htmlFor` points at, and a group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`) points `aria-labelledby` at the label's own id unless you gave the group an `aria-label` or `aria-labelledby`. A range `Slider` takes the id on its low thumb and also starts each thumb's name with the label through `aria-labelledby`, unless its `ariaLabel` names that thumb or its own `aria-label` or `aria-labelledby` takes the label's place. Nothing else takes the label: `Checkbox`, `Radio` and `Switch` are named by their own children. Only the single inputs take the `htmlFor`, so with a group or any other content it matches nothing. Pass `labelProps={{ htmlFor }}` to wire your own `id`, or `labelProps={{ htmlFor: undefined }}` to opt out. Skipped for `grouped`/`hasAddons` fields (multiple controls), and a nested `Field` starts its own scope, so a horizontal Field whose body holds an inner `Field` names the control there only when you wire it. Two controls in one plain labeled Field would both adopt the id, so give each an `id` of its own.",
"required": false,
"inherited": false,
"deprecated": false
Expand Down Expand Up @@ -226,7 +226,7 @@
},
{
"path": "Field.Label",
"summary": "FieldLabel component for rendering a Bulma field label.",
"summary": "FieldLabel component for rendering a Bulma field label. It renders the label column of a horizontal `Field` (a `div` with the `field-label` class), not a `<label>`, so text placed straight in it names nothing. Put a `<label>` with the `label` class inside it and point its `htmlFor` at the control's `id`, or give the horizontal `Field` a `label` prop, which renders this column and its `<label>` for you.",
"component": null,
"props": [
{
Expand Down
10 changes: 5 additions & 5 deletions bestax-mcp/data/components/Input.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@
},
{
"title": "Horizontal — Validation Error",
"code": "<Field horizontal label=\"Email\">\n <Field.Body>\n <Field>\n <Control iconLeftName=\"envelope\" iconRightName=\"exclamation-triangle\">\n <Input type=\"email\" color=\"danger\" value=\"hello@\" onChange={() => {}} />\n </Control>\n <p className=\"help is-danger\">This email is invalid</p>\n </Field>\n </Field.Body>\n</Field>"
"code": "<Field horizontal label=\"Email\" labelProps={{ htmlFor: 'invalid-email' }}>\n <Field.Body>\n <Field>\n <Control iconLeftName=\"envelope\" iconRightName=\"exclamation-triangle\">\n <Input\n id=\"invalid-email\"\n type=\"email\"\n color=\"danger\"\n value=\"hello@\"\n onChange={() => {}}\n />\n </Control>\n <p className=\"help is-danger\">This email is invalid</p>\n </Field>\n </Field.Body>\n</Field>"
},
{
"title": "Horizontal — Addons (Phone with Country Code)",
"code": "<Field horizontal label=\"Phone\">\n <Field.Body>\n <Field hasAddons>\n <Control>\n <Button isStatic>+44</Button>\n </Control>\n <Control isExpanded>\n <Input type=\"tel\" placeholder=\"Your phone number\" />\n </Control>\n </Field>\n </Field.Body>\n</Field>"
"code": "<Field horizontal label=\"Phone\" labelProps={{ htmlFor: 'phone-number' }}>\n <Field.Body>\n <Field hasAddons>\n <Control>\n <Button isStatic>+44</Button>\n </Control>\n <Control isExpanded>\n <Input id=\"phone-number\" type=\"tel\" placeholder=\"Your phone number\" />\n </Control>\n </Field>\n </Field.Body>\n</Field>"
},
{
"title": "Horizontal — Submit Row",
"code": "<>\n <Field horizontal label=\"Name\">\n <Field.Body>\n <Field>\n <Control>\n <Input placeholder=\"Your name\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n <Field horizontal>\n <Field.Label />\n <Field.Body>\n <Field>\n <Control>\n <Button color=\"primary\">Submit</Button>\n </Control>\n </Field>\n </Field.Body>\n </Field>\n</>"
"code": "<>\n <Field horizontal label=\"Name\" labelProps={{ htmlFor: 'submit-row-name' }}>\n <Field.Body>\n <Field>\n <Control>\n <Input id=\"submit-row-name\" placeholder=\"Your name\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n <Field horizontal>\n <Field.Label />\n <Field.Body>\n <Field>\n <Control>\n <Button color=\"primary\">Submit</Button>\n </Control>\n </Field>\n </Field.Body>\n </Field>\n</>"
},
{
"title": "Disabled Fieldset",
Expand All @@ -119,11 +119,11 @@
},
{
"title": "Context-Aware Rendering",
"code": "function example() {\n return (\n <Field horizontal label=\"Username\">\n <Field.Body>\n <Field>\n <Input placeholder=\"Enter username\" />\n </Field>\n </Field.Body>\n </Field>\n );\n}"
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Username\"\n labelProps={{ htmlFor: 'username-field' }}\n >\n <Field.Body>\n <Field>\n <Input id=\"username-field\" placeholder=\"Enter username\" />\n </Field>\n </Field.Body>\n </Field>\n );\n}"
},
{
"title": "Context-Aware Rendering",
"code": "function example() {\n return (\n <Field horizontal label=\"Username\">\n <Field.Body>\n <Field>\n <Control iconLeftName=\"user\">\n <Input placeholder=\"Enter username\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Username\"\n labelProps={{ htmlFor: 'username-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"user\">\n <Input id=\"username-field-control\" placeholder=\"Enter username\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
}
],
"accessibility": "- Always provide a label. The `label` prop is automatically associated with the input (`htmlFor` plus a generated `id`, or your own `id` if you pass one), so clicking the label focuses the input and assistive technology announces it.\n- When composing with `Field` instead, the `Field`'s own `label` associates with the input automatically when the input sits directly in that labeled `Field` — a nested unlabeled `Field` (as in horizontal multi-field layouts) starts its own scope. Pass `labelProps={{ htmlFor }}` and a matching `id` for a stable id or to label across a nested `Field`.\n- Use the correct input `type` for semantics (`text`, `email`, etc.).",
Expand Down
6 changes: 3 additions & 3 deletions bestax-mcp/data/components/Select.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@
},
{
"title": "Horizontal — Select in Narrow Field",
"code": "<Field horizontal label=\"Department\">\n <Field.Body>\n <Field narrow>\n <Control>\n <Select isFullwidth>\n <option>Business development</option>\n <option>Marketing</option>\n <option>Sales</option>\n </Select>\n </Control>\n </Field>\n </Field.Body>\n</Field>"
"code": "<Field\n horizontal\n label=\"Department\"\n labelProps={{ htmlFor: 'department-field' }}\n>\n <Field.Body>\n <Field narrow>\n <Control>\n <Select id=\"department-field\" isFullwidth>\n <option>Business development</option>\n <option>Marketing</option>\n <option>Sales</option>\n </Select>\n </Control>\n </Field>\n </Field.Body>\n</Field>"
},
{
"title": "Context-Aware Rendering",
"code": "<Select label=\"Country\">\n <option value=\"\">Please select</option>\n <option value=\"us\">United States</option>\n <option value=\"uk\">United Kingdom</option>\n <option value=\"ca\">Canada</option>\n</Select>"
},
{
"title": "Context-Aware Rendering",
"code": "function example() {\n return (\n <Field horizontal label=\"Country\">\n <Field.Body>\n <Field>\n <Select>\n <option value=\"\">Please select</option>\n <option value=\"us\">United States</option>\n <option value=\"uk\">United Kingdom</option>\n <option value=\"ca\">Canada</option>\n </Select>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
"code": "function example() {\n return (\n <Field horizontal label=\"Country\" labelProps={{ htmlFor: 'country-field' }}>\n <Field.Body>\n <Field>\n <Select id=\"country-field\">\n <option value=\"\">Please select</option>\n <option value=\"us\">United States</option>\n <option value=\"uk\">United Kingdom</option>\n <option value=\"ca\">Canada</option>\n </Select>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
},
{
"title": "Context-Aware Rendering",
"code": "function example() {\n return (\n <Field horizontal label=\"Country\">\n <Field.Body>\n <Field>\n <Control iconLeftName=\"globe\">\n <Select>\n <option value=\"\">Please select</option>\n <option value=\"us\">United States</option>\n <option value=\"uk\">United Kingdom</option>\n <option value=\"ca\">Canada</option>\n </Select>\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Country\"\n labelProps={{ htmlFor: 'country-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"globe\">\n <Select id=\"country-field-control\">\n <option value=\"\">Please select</option>\n <option value=\"us\">United States</option>\n <option value=\"uk\">United Kingdom</option>\n <option value=\"ca\">Canada</option>\n </Select>\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
}
],
"accessibility": "- Always provide a label. Select's `label` prop is automatically associated with the `<select>` (`htmlFor` plus a generated `id`, or your own `id` if you pass one).\n- When composing with `Field` instead, the `Field`'s own `label` associates with the select automatically when the select sits directly in that labeled `Field` — a nested unlabeled `Field` (as in horizontal multi-field layouts) starts its own scope. Pass `labelProps={{ htmlFor }}` and a matching `id` for a stable id or to label across a nested `Field`.\n- Use the `multiple` and `multipleSize` props for multi-select dropdowns.",
Expand Down
Loading
Loading