bestax-mcp 1.18.75 → 1.18.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/catalog.json +5 -5
- package/data/components/Autocomplete.json +4 -4
- package/data/components/Button.json +1 -1
- package/data/components/Card.json +1 -1
- package/data/components/Combobox.json +1 -1
- package/data/components/Command.json +1 -1
- package/data/components/ContextMenu.json +1 -1
- package/data/components/Control.json +3 -3
- package/data/components/CopyButton.json +1 -1
- package/data/components/DataTable.json +1 -1
- package/data/components/DateInput.json +12 -3
- package/data/components/DateTimeInput.json +12 -3
- package/data/components/Dropdown.json +1 -1
- package/data/components/Field.json +4 -4
- package/data/components/IconButton.json +1 -1
- package/data/components/Input.json +3 -3
- package/data/components/LinkButton.json +1 -1
- package/data/components/Navbar.json +2 -2
- package/data/components/Numberinput.json +3 -3
- package/data/components/Pagination.json +1 -1
- package/data/components/Panel.json +12 -8
- package/data/components/PasswordInput.json +2 -2
- package/data/components/SegmentedControl.json +1 -1
- package/data/components/Select.json +5 -5
- package/data/components/Slider.json +2 -2
- package/data/components/Taginput.json +15 -2
- package/data/components/TextArea.json +3 -3
- package/data/components/TimeInput.json +12 -3
- package/data/components/Toast.json +2 -2
- package/data/components/ToggleButton.json +1 -1
- package/data/skills/bestax-form/SKILL.md +9 -2
- package/data/skills/bestax-form/references/api.md +2 -2
- package/data/skills/bestax-migrate/references/bulma-classes/unmappables.md +4 -0
- package/data/skills/bestax-optimize/references/modular-build.md +21 -16
- package/data/skills/bestax-theming/references/css-variables.md +8 -0
- package/data/skills/bestax-theming/references/themeable-components.md +2 -2
- package/package.json +2 -2
package/data/catalog.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"generatedFrom": {
|
|
4
4
|
"package": "@allxsmith/bestax-bulma",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.78.1"
|
|
6
6
|
},
|
|
7
7
|
"docsBase": "https://bestax.io/docs",
|
|
8
8
|
"categories": [
|
|
@@ -1123,7 +1123,7 @@
|
|
|
1123
1123
|
"import": "import { Panel } from '@allxsmith/bestax-bulma';",
|
|
1124
1124
|
"compound": true,
|
|
1125
1125
|
"propCount": 37,
|
|
1126
|
-
"exampleCount":
|
|
1126
|
+
"exampleCount": 5
|
|
1127
1127
|
},
|
|
1128
1128
|
{
|
|
1129
1129
|
"name": "Paragraph",
|
|
@@ -1496,8 +1496,8 @@
|
|
|
1496
1496
|
"slug": "form/taginput",
|
|
1497
1497
|
"import": "import { Taginput } from '@allxsmith/bestax-bulma';",
|
|
1498
1498
|
"compound": false,
|
|
1499
|
-
"propCount":
|
|
1500
|
-
"exampleCount":
|
|
1499
|
+
"propCount": 49,
|
|
1500
|
+
"exampleCount": 14
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
1503
|
"name": "Tags",
|
|
@@ -3965,7 +3965,7 @@
|
|
|
3965
3965
|
"PanelInputBlock": {
|
|
3966
3966
|
"component": "Panel",
|
|
3967
3967
|
"path": "Panel.InputBlock",
|
|
3968
|
-
"purpose": "Search input with icon (renders as `<div class=\"panel-block\">`)"
|
|
3968
|
+
"purpose": "Search input with icon (renders as `<div class=\"panel-block\">` around the `<input>`)."
|
|
3969
3969
|
},
|
|
3970
3970
|
"PanelTabs": {
|
|
3971
3971
|
"component": "Panel",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Fruit\"\n labelProps={{\n htmlFor: 'fruit-field-control',\n id: 'fruit-field-control-label',\n }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"search\">\n <Autocomplete\n id=\"fruit-field-control\"\n data={['Apple', 'Banana', 'Cherry']}\n placeholder=\"Search fruit...\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"accessibility": "- The `label` prop is automatically associated with the inner text 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. Inside a labeled `Field`, that `Field`'s label names the input instead when it points at it: a `Field` that is not `grouped` or `hasAddons` points it there on its own when the Autocomplete has no `id` and no inner `Field` sits between them, and a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- Uses `role=\"combobox\"` with `aria-expanded`, which is true only while the list is on screen. When nothing matches, the dropdown shows the `empty` content but no list, so it stays false\n- Has `aria-haspopup=\"listbox\"` and `aria-autocomplete=\"list\"`, and, while the list is on screen, `aria-controls` pointing at it\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted option as the arrow keys move it. Clicking an option leaves focus in the input too, with the picked value in it\n- The list is a `role=\"listbox\"` named through `aria-labelledby` by the label that names the input, when that label has an id: the `label` prop's label always has one, and so does a `Field`'s label that the `Field` wires itself. A `Field` label you wire by hand with `labelProps.htmlFor`, which is how a horizontal form names an Autocomplete in an inner `Field`, needs an `id` in its `labelProps` as well. Otherwise the list falls back to `aria-label=\"Suggestions\"
|
|
61
|
+
"accessibility": "- The `label` prop is automatically associated with the inner text 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. Inside a labeled `Field`, that `Field`'s label names the input instead when it points at it: a `Field` that is not `grouped` or `hasAddons` points it there on its own when the Autocomplete has no `id` and no inner `Field` sits between them, and a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- Uses `role=\"combobox\"` with `aria-expanded`, which is true only while the list is on screen. When nothing matches, the dropdown shows the `empty` content but no list, so it stays false\n- Has `aria-haspopup=\"listbox\"` and `aria-autocomplete=\"list\"`, and, while the list is on screen, `aria-controls` pointing at it\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted option as the arrow keys move it. Clicking an option leaves focus in the input too, with the picked value in it\n- The list is a `role=\"listbox\"` named through `aria-labelledby` by the label that names the input, when that label has an id: the `label` prop's label always has one, and so does a `Field`'s label that the `Field` wires itself. A `Field` label you wire by hand with `labelProps.htmlFor`, which is how a horizontal form names an Autocomplete in an inner `Field`, needs an `id` in its `labelProps` as well. Otherwise the list falls back to `aria-label=\"Suggestions\"`, or `labels.suggestions` in your language\n- The list holds only the options. The `header`, `footer` and `empty` content sit beside it in the dropdown, so a screen reader doesn't count them as options\n- When the user's typing leaves nothing that matches, the `empty` text is announced through a polite `role=\"status\"` region. That region is in the page from the start, so it's there before the message arrives. It's said once each time the matches run out, not again on every keystroke while they stay out, and the next search that comes up empty is announced too: after matches come back, after the field is emptied, or after the list closes and the user types again\n- While `loading` is on, or a `Control` with `isLoading` around the Autocomplete, the announcement waits, so the `empty` text that shows while results are on their way isn't read out. It's said once loading ends with nothing matching, for each search that comes back empty. Pass `loading` while you fetch results, as the async story in Storybook does\n- Focusing the field, opening the list with `openOnFocus` or `↓`, or emptying the field announces nothing. Without `empty`, nothing is announced at all, since there's no built-in message to say\n- `empty` is a message, so keep it to text. `Tab` closes the list, so a keyboard user can't reach a link or a button in it\n- Keep that message static, like \"No results found\". Its text is read when the matches first run out and isn't read again while they stay out, so a message that names the query, like \"No results for xyz\", is only heard for the query that ran them out\n- Dropdown items use `role=\"option\"`, and the highlighted one is `aria-selected` unless it's disabled\n- In forced colors (Windows' contrast themes), which take away the dropdown's shadow and the highlighted option's fill, the open dropdown is drawn with an edge, whether it shows options or the `empty` content, and the highlighted option with an outline in the system's highlight color\n- Disabled items have `aria-disabled`\n- The `clearable` clear button is a native button named \"Clear\", or `labels.clear`: `Tab` from the input reaches it, and `Enter` or `Space` clears the input and puts focus back in it\n- Full keyboard navigation support\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the wrapper, so a screen reader hears the input is invalid when it takes focus.",
|
|
62
62
|
"related": ["Combobox", "Input", "Select", "Taginput"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-autocomplete",
|
|
64
64
|
"summary": "The `Autocomplete` component provides an input field with dropdown suggestions that filter based on user input.",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"name": "label",
|
|
76
76
|
"type": "React.ReactNode",
|
|
77
77
|
"default": null,
|
|
78
|
-
"description": "Field label, associated with the text input via `htmlFor`: through your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose label names the input instead when it points at it. The `Field` points its label there itself when the Autocomplete has no `id` and no inner `Field` sits between them (and the `Field` is not `grouped` or `hasAddons`); a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`. The label naming the input also names the open suggestion list, through `aria-labelledby`, when it has an id: this label always does, and an outer `Field`'s does unless you wired it by hand without an `id` in its `labelProps`. Otherwise the list is named \"Suggestions\".",
|
|
78
|
+
"description": "Field label, associated with the text input via `htmlFor`: through your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose label names the input instead when it points at it. The `Field` points its label there itself when the Autocomplete has no `id` and no inner `Field` sits between them (and the `Field` is not `grouped` or `hasAddons`); a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`. The label naming the input also names the open suggestion list, through `aria-labelledby`, when it has an id: this label always does, and an outer `Field`'s does unless you wired it by hand without an `id` in its `labelProps`. Otherwise the list is named \"Suggestions\", or `labels.suggestions`.",
|
|
79
79
|
"required": false,
|
|
80
80
|
"inherited": false,
|
|
81
81
|
"deprecated": false
|
|
@@ -155,9 +155,9 @@
|
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"name": "labels",
|
|
158
|
-
"type": "{ clear?: string }",
|
|
158
|
+
"type": "{ clear?: string; suggestions?: string }",
|
|
159
159
|
"default": null,
|
|
160
|
-
"description": "The
|
|
160
|
+
"description": "The accessible names it gives its parts, in your app's language. A `LocaleProvider` doesn't change them.",
|
|
161
161
|
"required": false,
|
|
162
162
|
"inherited": false,
|
|
163
163
|
"deprecated": false
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"code": "function example() {\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const [tag, setTag] = React.useState<string>();\n\n return (\n <>\n <Button color=\"primary\" ref={buttonRef}>\n Target\n </Button>\n <Button ml=\"2\" onClick={() => setTag(buttonRef.current?.tagName)}>\n Read the tag from its ref\n </Button>\n <p>Rendered element: {tag ?? '—'}</p>\n </>\n );\n}"
|
|
105
105
|
}
|
|
106
106
|
],
|
|
107
|
-
"accessibility": "- **Labeling:** Always provide descriptive content for buttons for screen readers.\n- **Icons beside text:** Leave the `Icon` unnamed, so the text alone names the button. The icons in [With an Icon](https://bestax.io/docs/api/elements/button#with-an-icon) write out `aria-hidden=\"true\"`, and `Icon` would render it for them anyway, since they have no `ariaLabel`, `aria-label` or `aria-labelledby` to name them and no `role` or `tabIndex` of their own. A named icon joins the button's name instead, so `ariaLabel=\"Download\"` on the icon of a Download button makes a screen reader announce \"Download Download\".\n- **States:** The `isDisabled` and `disabled` props ensure correct `aria-disabled` and `disabled` attributes.\n- **Loading:** while `isLoading` is set, the button carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`, so a screen reader can tell it won't respond, and a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing: `onClick` doesn't run, a submit button doesn't submit its form, and a click on a link doesn't follow its `href`. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would.\n- **Keyboard:** When rendered as `<a>`, disabled buttons are not focusable.\n- **Focus:** Use `isFocused` and `isActive` for visual feedback, but rely on browser focus for actual accessibility.\n- **Focus ring:** Bulma shows a focused button with its border and a shadow. A ghost button has neither. A loading or static one has no shadow. All a loading one keeps is its border turning the focus color, which on a colored one is drawn on its own fill, and a loading outlined or text one, or a static one, doesn't change at all. Forced colors (Windows' contrast themes) drops the shadow and sets the border's color. So bestax's styles give a focused ghost, loading or static button, and every focused button in forced colors, an outline. `isFocused` draws it too.\n- **Forced colors:** In Windows' contrast themes a colored button keeps a 1px border, so it still has an edge when the theme replaces its fill, while an outlined button and a `text` one are left as they are. A button with Bulma's `is-selected`, such as a pressed [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton) or the selected button of a `Buttons hasAddons` row, is drawn in the system's highlight colors there, since the fill that marks it is replaced, and a disabled one in the system's color for a disabled control, filled.\n- **Outlined on the dark scheme:** bestax's styles draw an outlined button's label and border at the lightness Bulma picks for its color's text on the page wherever that's lighter than the color's own, so a dark color, such as Bulma's link or bestax's blue primary, reads on the dark page. On a light page an outlined button keeps its color's own lightness. On a surface that stays light on both schemes, such as `bgColor=\"white\"`, give the surface Bulma's `theme-light` class (`bestax-theme-light` under the `bestax-` prefix), which keeps what's inside it on the light scheme's values.\n- **Static labels:** `isStatic` only styles the button, so a `<button>` with it is still a tab stop that a screen reader announces as a button. Render a label that does nothing, such as an addon's \"@gmail.com\", `as=\"span\"`.\n- **Toggles:** `isActive` tells a screen reader nothing. A button that turns something on or off is a [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which sets `aria-pressed`.\n\n:::note\nA button that shows only an icon is an [`IconButton`](https://bestax.io/docs/api/elements/iconbutton), whose types require an\n`aria-label` or an `aria-labelledby`, and whose `isRounded` makes a circle. On a plain `Button` holding only\nan icon, name it with `aria-label` yourself.\n:::",
|
|
107
|
+
"accessibility": "- **Labeling:** Always provide descriptive content for buttons for screen readers.\n- **Icons beside text:** Leave the `Icon` unnamed, so the text alone names the button. The icons in [With an Icon](https://bestax.io/docs/api/elements/button#with-an-icon) write out `aria-hidden=\"true\"`, and `Icon` would render it for them anyway, since they have no `ariaLabel`, `aria-label` or `aria-labelledby` to name them and no `role` or `tabIndex` of their own. A named icon joins the button's name instead, so `ariaLabel=\"Download\"` on the icon of a Download button makes a screen reader announce \"Download Download\".\n- **States:** The `isDisabled` and `disabled` props ensure correct `aria-disabled` and `disabled` attributes.\n- **Loading:** while `isLoading` is set, the button carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`, so a screen reader can tell it won't respond, and a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing: `onClick` doesn't run, a submit button doesn't submit its form, and a click on a link doesn't follow its `href`. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would.\n- **Keyboard:** When rendered as `<a>`, disabled buttons are not focusable.\n- **Focus:** Use `isFocused` and `isActive` for visual feedback, but rely on browser focus for actual accessibility.\n- **Focus ring:** Bulma shows a focused button with its border and a shadow. A ghost button has neither. A loading or static one has no shadow. All a loading one keeps is its border turning the focus color, which on a colored one is drawn on its own fill, and a loading outlined or text one, or a static one, doesn't change at all. Forced colors (Windows' contrast themes) drops the shadow and sets the border's color. So bestax's styles give a focused ghost, loading or static button, and every focused button in forced colors, an outline. `isFocused` draws it too.\n- **Forced colors:** In Windows' contrast themes a colored button keeps a 1px border, so it still has an edge when the theme replaces its fill, while an outlined button and a `text` one are left as they are. Bulma's disabled opacity doesn't apply there, since it would only fade the system's color for a disabled control: a disabled button, one with `disabled` or inside a disabled `<fieldset>`, is drawn in that color at full strength, and so is a link with `isDisabled`. Bulma also dims a link in a disabled `<fieldset>`, and a button in its first `<legend>`, though both still work, so there they're drawn at full strength in their own colors. A button with Bulma's `is-selected`, such as a pressed [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton) or the selected button of a `Buttons hasAddons` row, is drawn in the system's highlight colors there, since the fill that marks it is replaced, and a disabled one in the system's color for a disabled control, filled.\n- **Outlined on the dark scheme:** bestax's styles draw an outlined button's label and border at the lightness Bulma picks for its color's text on the page wherever that's lighter than the color's own, so a dark color, such as Bulma's link or bestax's blue primary, reads on the dark page. On a light page an outlined button keeps its color's own lightness. On a surface that stays light on both schemes, such as `bgColor=\"white\"`, give the surface Bulma's `theme-light` class (`bestax-theme-light` under the `bestax-` prefix), which keeps what's inside it on the light scheme's values.\n- **Static labels:** `isStatic` only styles the button, so a `<button>` with it is still a tab stop that a screen reader announces as a button. Render a label that does nothing, such as an addon's \"@gmail.com\", `as=\"span\"`.\n- **Toggles:** `isActive` tells a screen reader nothing. A button that turns something on or off is a [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which sets `aria-pressed`.\n\n:::note\nA button that shows only an icon is an [`IconButton`](https://bestax.io/docs/api/elements/iconbutton), whose types require an\n`aria-label` or an `aria-labelledby`, and whose `isRounded` makes a circle. On a plain `Button` holding only\nan icon, name it with `aria-label` yourself.\n:::",
|
|
108
108
|
"related": [
|
|
109
109
|
"Buttons",
|
|
110
110
|
"CopyButton",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"code": "<Card>\n <Card.Header>\n <Card.Header.Title as=\"p\">Component</Card.Header.Title>\n </Card.Header>\n <Card.Content>Card content goes here.</Card.Content>\n <Card.Footer>\n <Card.FooterItem as=\"a\" href=\"#save\">\n Save\n </Card.FooterItem>\n <Card.FooterItem as=\"a\" href=\"#edit\">\n Edit\n </Card.FooterItem>\n </Card.Footer>\n</Card>"
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
"accessibility": "- **Image alternate text:** An image URL passed as `image` renders an `<img>` whose `alt` is `imageAlt`. Describe what the picture shows, or pass `imageAlt=\"\"` for a decorative image so screen readers skip it. Without `imageAlt`, the `alt` is \"Card image\", which tells a screen reader nothing about the picture. An image you render yourself, as a node in `image` or inside `Card.Image`, takes its own `alt`, and `imageAlt` doesn't reach it.\n- **Header and footer landmarks:** a card's header and footer are Bulma's `<header class=\"card-header\">` and `<footer class=\"card-footer\">`, which `header` or `headerIcon`, `footer`, `Card.Header` and `Card.Footer` render. Outside `<main>`, `<article>`, `<aside>`, `<nav>`, `<section>` and elements with one of their roles, a `<header>` is a banner landmark and a `<footer>` a content info landmark, so a screen reader that lists landmarks lists a banner for each card with a header and a content info for each card with a footer, beside the page's own. Inside one of them they aren't landmarks. Put cards in the page's `<main>`. For a card that can't be there, such as one portaled outside it, give the card `role=\"article\"`, or wrap it in an `<article>`, which scopes them the same way, or, built from the parts, pass `role=\"none\"` to its `Card.Header` and `Card.Footer`, which ARIA in HTML allows on both.\n- Use semantic content for the header, body, and footer as needed.\n- **Forced colors:** in Windows' contrast themes, which drop shadows and paint the card in the\n page's own color, the card's edge is drawn as an outline in the system's text color, so a row of\n cards still shows which image, text and actions belong together. While the card has keyboard\n focus, the browser's focus ring shows in its place. CheckboxCard and RadioCard keep the edge they\n draw themselves.",
|
|
65
|
+
"accessibility": "- **Image alternate text:** An image URL passed as `image` renders an `<img>` whose `alt` is `imageAlt`. Describe what the picture shows, or pass `imageAlt=\"\"` for a decorative image so screen readers skip it. Without `imageAlt`, the `alt` is \"Card image\", which tells a screen reader nothing about the picture. An image you render yourself, as a node in `image` or inside `Card.Image`, takes its own `alt`, and `imageAlt` doesn't reach it.\n- **Header and footer landmarks:** a card's header and footer are Bulma's `<header class=\"card-header\">` and `<footer class=\"card-footer\">`, which `header` or `headerIcon`, `footer`, `Card.Header` and `Card.Footer` render. Outside `<main>`, `<article>`, `<aside>`, `<nav>`, `<section>` and elements with one of their roles, a `<header>` is a banner landmark and a `<footer>` a content info landmark, so a screen reader that lists landmarks lists a banner for each card with a header and a content info for each card with a footer, beside the page's own. Inside one of them they aren't landmarks. Put cards in the page's `<main>`. For a card that can't be there, such as one portaled outside it, give the card `role=\"article\"`, or wrap it in an `<article>`, which scopes them the same way, or, built from the parts, pass `role=\"none\"` to its `Card.Header` and `Card.Footer`, which ARIA in HTML allows on both.\n- Use semantic content for the header, body, and footer as needed.\n- **Forced colors:** in Windows' contrast themes, which drop shadows and paint the card in the\n page's own color, the card's edge is drawn as an outline in the system's text color, so a row of\n cards still shows which image, text and actions belong together. While the card has keyboard\n focus, the browser's focus ring shows in its place. The line under a card's header, from\n `header`, `headerIcon` or `Card.Header`, is a shadow too, and is drawn as a one pixel line in\n the same color inside the header, so nothing moves. CheckboxCard and RadioCard keep the edge they\n draw themselves.",
|
|
66
66
|
"related": ["Icon", "Image", "useBulmaClasses"],
|
|
67
67
|
"storybook": "https://bestax.io/storybook/?path=/story/components-card--default",
|
|
68
68
|
"summary": "The `Card` component renders a Bulma-styled card with optional header, image, content, and footer.",
|
|
@@ -487,7 +487,7 @@
|
|
|
487
487
|
"name": "isLoading",
|
|
488
488
|
"type": "boolean",
|
|
489
489
|
"default": "false",
|
|
490
|
-
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading.",
|
|
490
|
+
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes it, tied to it with `aria-describedby`, which a screen reader reads when the field takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
491
491
|
"required": false,
|
|
492
492
|
"inherited": true,
|
|
493
493
|
"deprecated": false
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
"name": "isLoading",
|
|
266
266
|
"type": "boolean",
|
|
267
267
|
"default": "false",
|
|
268
|
-
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading.",
|
|
268
|
+
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes it, tied to it with `aria-describedby`, which a screen reader reads when the field takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
269
269
|
"required": false,
|
|
270
270
|
"inherited": true,
|
|
271
271
|
"deprecated": false
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"code": "<ContextMenu\n aria-label=\"Actions for notes.txt\"\n trigger={\n <Box tabIndex={0} p=\"6\" textAlign=\"centered\">\n notes.txt\n </Box>\n }\n>\n <ContextMenu.Item as=\"button\">Open</ContextMenu.Item>\n <ContextMenu.Item as=\"button\">Rename</ContextMenu.Item>\n <ContextMenu.Divider />\n <ContextMenu.Item as=\"button\">Delete</ContextMenu.Item>\n</ContextMenu>"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"accessibility": "`ContextMenu` follows the [WAI-ARIA menu pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/),\nwithout a menubar or submenus:\n\n- **Opening:** APG names \"a command, such as Shift + F10 in Windows, that opens a context specific\n menu\". That's the browser's `contextmenu` event, which <kbd>Shift</kbd>+<kbd>F10</kbd> and the\n context menu key fire on Windows and Linux, and VoiceOver's <kbd>VO</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd>\n fires on macOS. `ContextMenu` adds no key handler of its own, so the menu never opens twice for\n one key.\n- **Focus on open** goes to the first enabled item, or to the menu itself when there's none.\n- <kbd>ArrowDown</kbd> and <kbd>ArrowUp</kbd> move to the next and previous item, wrapping, and\n <kbd>Home</kbd> and <kbd>End</kbd> go to the first and last.\n- **Typing** a letter moves to the next item whose text starts with what's been typed. Letters typed\n in quick succession add up to one search, and the same letter again cycles through the items that\n start with it. Each opening starts a new search.\n- <kbd>Enter</kbd> and <kbd>Space</kbd> activate the focused item the way a click does, so its\n `onClick` runs, and a key held down activates it once.\n- <kbd>Escape</kbd> closes the menu and returns focus to what had it before the menu opened. It\n stops there, so a `Popover` or a `Modal` around the menu stays open.\n- <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> close it and return focus too. The menu sits at\n the end of the page, so letting Tab go on from it would skip the rest of the page.\n- An item that runs closes the menu and returns focus, unless it moved focus somewhere else, such as\n into a `Modal` it opened or a rename field.\n\nRoles and names:\n\n- The menu is `role=\"menu\"`, named by the `aria-label` or `aria-labelledby` you pass. There's no\n button to borrow a name from, and a development build warns when a menu opens without one.\n- Items are `menuitem` by default, and `menuitemcheckbox` or `menuitemradio` with `aria-checked`\n through the item's `role`. A divider is an `<hr>`, which is a separator.\n- An `active` item has `aria-current=\"true\"`, as in `Dropdown`, and an `aria-current` you pass\n wins.\n- Disabled items, a `button` with `disabled` or an item with `aria-disabled=\"true\"`, are skipped by\n the arrow keys and by typing, as in `Dropdown`, and they go on from an item that turns disabled\n while it keeps focus.\n- The trigger gets no ARIA, no role and no tab stop. `aria-haspopup` describes a popup that opens\n when an element is activated, and a right-click on a row isn't that. So nothing tells a screen\n reader user the menu is there, and on macOS only VoiceOver opens it from the keyboard: every action\n in it has to be reachable from a visible control as well, which\n [WCAG 2.1.1](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html) asks for.\n\nAnd around it:\n\n- The menu isn't modal. A press outside it closes it and does whatever it does, the rest of the page\n stays reachable, and nothing locks scrolling.\n- Nothing listens on the page while the menu is closed and no finger is held on its trigger, so a\n table with a menu on every row adds no listeners until one is used.\n- The menu doesn't animate.\n- In forced colors (Windows' contrast themes), a divider is drawn
|
|
41
|
+
"accessibility": "`ContextMenu` follows the [WAI-ARIA menu pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/),\nwithout a menubar or submenus:\n\n- **Opening:** APG names \"a command, such as Shift + F10 in Windows, that opens a context specific\n menu\". That's the browser's `contextmenu` event, which <kbd>Shift</kbd>+<kbd>F10</kbd> and the\n context menu key fire on Windows and Linux, and VoiceOver's <kbd>VO</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd>\n fires on macOS. `ContextMenu` adds no key handler of its own, so the menu never opens twice for\n one key.\n- **Focus on open** goes to the first enabled item, or to the menu itself when there's none.\n- <kbd>ArrowDown</kbd> and <kbd>ArrowUp</kbd> move to the next and previous item, wrapping, and\n <kbd>Home</kbd> and <kbd>End</kbd> go to the first and last.\n- **Typing** a letter moves to the next item whose text starts with what's been typed. Letters typed\n in quick succession add up to one search, and the same letter again cycles through the items that\n start with it. Each opening starts a new search.\n- <kbd>Enter</kbd> and <kbd>Space</kbd> activate the focused item the way a click does, so its\n `onClick` runs, and a key held down activates it once.\n- <kbd>Escape</kbd> closes the menu and returns focus to what had it before the menu opened. It\n stops there, so a `Popover` or a `Modal` around the menu stays open.\n- <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> close it and return focus too. The menu sits at\n the end of the page, so letting Tab go on from it would skip the rest of the page.\n- An item that runs closes the menu and returns focus, unless it moved focus somewhere else, such as\n into a `Modal` it opened or a rename field.\n\nRoles and names:\n\n- The menu is `role=\"menu\"`, named by the `aria-label` or `aria-labelledby` you pass. There's no\n button to borrow a name from, and a development build warns when a menu opens without one.\n- Items are `menuitem` by default, and `menuitemcheckbox` or `menuitemradio` with `aria-checked`\n through the item's `role`. A divider is an `<hr>`, which is a separator.\n- An `active` item has `aria-current=\"true\"`, as in `Dropdown`, and an `aria-current` you pass\n wins.\n- Disabled items, a `button` with `disabled` or an item with `aria-disabled=\"true\"`, are skipped by\n the arrow keys and by typing, as in `Dropdown`, and they go on from an item that turns disabled\n while it keeps focus.\n- The trigger gets no ARIA, no role and no tab stop. `aria-haspopup` describes a popup that opens\n when an element is activated, and a right-click on a row isn't that. So nothing tells a screen\n reader user the menu is there, and on macOS only VoiceOver opens it from the keyboard: every action\n in it has to be reachable from a visible control as well, which\n [WCAG 2.1.1](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html) asks for.\n\nAnd around it:\n\n- The menu isn't modal. A press outside it closes it and does whatever it does, the rest of the page\n stays reachable, and nothing locks scrolling.\n- Nothing listens on the page while the menu is closed and no finger is held on its trigger, so a\n table with a menu on every row adds no listeners until one is used.\n- The menu doesn't animate.\n- In forced colors (Windows' contrast themes), the menu's box has an edge and a divider is drawn\n in the system's text color, and an `active` item is marked with a bar in the system's highlight\n color, as in `Dropdown`. Those rules ship in `bestax.css` and `extras.css`, from the dropdown\n partial, so a modular build adds `scss/components/dropdown` for them.",
|
|
42
42
|
"related": [
|
|
43
43
|
"ConfigProvider",
|
|
44
44
|
"Dropdown",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "Loading State",
|
|
38
|
-
"code": "<Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" />\n </Control>\n</Field>"
|
|
38
|
+
"code": "<Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" message=\"Loading…\" />\n </Control>\n</Field>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "Loading State with Size Variations",
|
|
42
|
-
"code": "<>\n <Field label=\"Loading Small\">\n <Control isLoading size=\"small\">\n <Input size=\"small\" placeholder=\"Loading small\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Medium\">\n <Control isLoading size=\"medium\">\n <Input size=\"medium\" placeholder=\"Loading medium\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Large\">\n <Control isLoading size=\"large\">\n <Input size=\"large\" placeholder=\"Loading large\" />\n </Control>\n </Field>\n</>"
|
|
42
|
+
"code": "<>\n <Field label=\"Loading Small\">\n <Control isLoading size=\"small\">\n <Input size=\"small\" placeholder=\"Loading small\" message=\"Loading…\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Medium\">\n <Control isLoading size=\"medium\">\n <Input size=\"medium\" placeholder=\"Loading medium\" message=\"Loading…\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Large\">\n <Control isLoading size=\"large\">\n <Input size=\"large\" placeholder=\"Loading large\" message=\"Loading…\" />\n </Control>\n </Field>\n</>"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"title": "Expanded Control",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"name": "isLoading",
|
|
116
116
|
"type": "boolean",
|
|
117
117
|
"default": "false",
|
|
118
|
-
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading.",
|
|
118
|
+
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes the input, select or textarea inside, such as its `message`, or text tied to that control with `aria-describedby`, which a screen reader reads when the control takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
119
119
|
"required": false,
|
|
120
120
|
"inherited": true,
|
|
121
121
|
"deprecated": false
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"code": "<CopyButton value=\"https://bestax.io\" isDisabled />"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"accessibility": "- **The name follows the words:** with its label shown, the button has no `aria-label`, so its name\n is the text on it, \"Copy\" and then \"Copied\", and a voice control user can say what they see\n ([WCAG 2.5.3](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)).\n- **The result is announced:** a change to a focused button's label isn't read out by every screen\n reader and browser pairing, so each copy, and each failure, is also a polite `role=\"status\"`\n message\n ([WCAG 4.1.3](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html), technique\n [ARIA22](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA22)). The region is in the page from\n hydration, well before any click, and is visually hidden. It's portaled to the end of the page,\n or to a `ConfigProvider`'s `portalContainer`, so it isn't a child of the button's `Control` or\n `Buttons` row. Inside an open modal dialog (`aria-modal=\"true\"`), such as a `Modal`, a `Dialog`\n or a `Sidebar` with an overlay, it goes inside the dialog instead, since a screen reader ignores\n a live region behind one. It moves there when the button takes focus or a click. A copy repeated\n while the button still reads \"Copied\" is announced again.\n- **Icon-only, it's still named:** `labels.copy` is its `aria-label` in both states, since there are\n no words to follow, and only the glyph swaps. Give it a name that says what it copies when there\n are several on a page (\"Copy the Production key\").\n- **The glyphs are decorative:** both render `aria-hidden=\"true\"`; the label and the status carry the\n meaning.\n- **Failures aren't hidden:** a copy that didn't happen never shows \"Copied\".\n- **Keyboard and focus:** it's a native `<button type=\"button\">`, so <kbd>Enter</kbd> and\n <kbd>Space</kbd> copy, focus stays on it, and it never submits the form it sits in. While\n `isLoading` is set it copies nothing, as `Button` drops the click, and carries `aria-busy` and\n `aria-disabled`.\n- **Forced colors:** the glyphs are drawn in `currentColor`, so they take the system's button text\n color.",
|
|
53
|
+
"accessibility": "- **The name follows the words:** with its label shown, the button has no `aria-label`, so its name\n is the text on it, \"Copy\" and then \"Copied\", and a voice control user can say what they see\n ([WCAG 2.5.3](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)).\n- **The result is announced:** a change to a focused button's label isn't read out by every screen\n reader and browser pairing, so each copy, and each failure, is also a polite `role=\"status\"`\n message\n ([WCAG 4.1.3](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html), technique\n [ARIA22](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA22)). The region is in the page from\n hydration, well before any click, and is visually hidden. It's portaled to the end of the page,\n or to a `ConfigProvider`'s `portalContainer`, so it isn't a child of the button's `Control` or\n `Buttons` row. Inside an open modal dialog (`aria-modal=\"true\"`), such as a `Modal`, a `Dialog`\n or a `Sidebar` with an overlay, it goes inside the dialog instead, since a screen reader ignores\n a live region behind one. It moves there when the button takes focus or a click. A copy repeated\n while the button still reads \"Copied\" is announced again.\n- **Icon-only, it's still named:** `labels.copy` is its `aria-label` in both states, since there are\n no words to follow, and only the glyph swaps. Give it a name that says what it copies when there\n are several on a page (\"Copy the Production key\").\n- **The glyphs are decorative:** both render `aria-hidden=\"true\"`; the label and the status carry the\n meaning.\n- **Failures aren't hidden:** a copy that didn't happen never shows \"Copied\".\n- **Keyboard and focus:** it's a native `<button type=\"button\">`, so <kbd>Enter</kbd> and\n <kbd>Space</kbd> copy, focus stays on it, and it never submits the form it sits in. While\n `isLoading` is set it copies nothing, as `Button` drops the click, and carries `aria-busy` and\n `aria-disabled`.\n- **Forced colors:** the glyphs are drawn in `currentColor`, so they take the system's button text\n color, and on a disabled one the system's color for a disabled control, at full strength.",
|
|
54
54
|
"related": [
|
|
55
55
|
"Button",
|
|
56
56
|
"Code",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"code": "<DataTable\n caption=\"Mitglieder\"\n columns={[{ id: 'name', header: 'Name', sortable: true, isRowHeader: true }]}\n data={[\n { id: 'm1', name: 'Emmy Noether' },\n { id: 'm2', name: 'Lise Meitner' },\n { id: 'm3', name: 'Konrad Zuse' },\n ]}\n selectionMode=\"multiple\"\n hasSearch\n pageSize={2}\n isFullwidth\n labels={{\n selectAll: 'Alle Zeilen dieser Seite auswählen',\n selectRow: label => `${label} auswählen`,\n sortHint: 'Spaltenköpfe mit Schaltflächen sind sortierbar',\n search: 'Suchen',\n results: count => (count === 1 ? '1 Treffer' : `${count} Treffer`),\n pageRange: (first, last, total) => `${first} bis ${last} von ${total}`,\n loading: 'Wird geladen',\n pagination: 'Mitglieder, Seiten',\n empty: 'Noch keine Mitglieder.',\n noResults: 'Keine Treffer.',\n }}\n/>"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"accessibility": "- **A native table,** as in the ARIA Authoring Practices' Sortable Table example: `th scope=\"col\"`\n headers, `th scope=\"row\"` for the row header, and a `caption` or your `aria-label` or\n `aria-labelledby` as its name. A development build warns when it has none.\n- **Sorting:** a sortable header holds a `<button>` with the header's text, and only the sorted\n header has `aria-sort`, `ascending` or `descending`, which screen readers read out as they reach\n it. That headers with buttons sort is said once, hidden at the end of the caption, or as a hidden\n caption of its own when `aria-label` names the table. The indicator is drawn in CSS, so it's not\n read.\n- **Selection** rides on the checkboxes: each is named \"Select\" and the row's label, and the one in\n the header is mixed (`aria-checked=\"mixed\"`) when some of the page is selected. Rows get Bulma's\n selected look and no `aria-selected`, which ARIA gives the rows of a grid rather than a table.\n- **A status message** in a polite live region says how many rows match a short while after the\n search or a filter changes, the range shown after a page change, and \"Loading\" while `loading` is\n on after one of those. Nothing is said as the page loads, or for a sort, which `aria-sort` covers.\n- **The pager** is a `navigation` named after the table, so two tables on a page have two named\n pagers.\n- **Busy:** `aria-busy` is on the table while `loading`, and the skeleton rows are hidden from\n assistive tech.\n- **Wide tables:** with `isResponsive`, the `ScrollArea` around the table is a tab stop and a\n named region while it overflows, so it can be scrolled from the keyboard.\n- **Forced colors:** the sort indicator is painted in the system's button text color, and the sort\n button's focus ring is an outline. A selected row's fill is a color forced colors takes away, so\n there a double line in the system's highlight color marks the row, as it marks a selected `Table`\n row, and its checked checkbox carries the selection too. The pager's current page is drawn in the\n system's highlight colors, as [Pagination](https://bestax.io/docs/api/components/pagination)'s
|
|
69
|
+
"accessibility": "- **A native table,** as in the ARIA Authoring Practices' Sortable Table example: `th scope=\"col\"`\n headers, `th scope=\"row\"` for the row header, and a `caption` or your `aria-label` or\n `aria-labelledby` as its name. A development build warns when it has none.\n- **Sorting:** a sortable header holds a `<button>` with the header's text, and only the sorted\n header has `aria-sort`, `ascending` or `descending`, which screen readers read out as they reach\n it. That headers with buttons sort is said once, hidden at the end of the caption, or as a hidden\n caption of its own when `aria-label` names the table. The indicator is drawn in CSS, so it's not\n read.\n- **Selection** rides on the checkboxes: each is named \"Select\" and the row's label, and the one in\n the header is mixed (`aria-checked=\"mixed\"`) when some of the page is selected. Rows get Bulma's\n selected look and no `aria-selected`, which ARIA gives the rows of a grid rather than a table.\n- **A status message** in a polite live region says how many rows match a short while after the\n search or a filter changes, the range shown after a page change, and \"Loading\" while `loading` is\n on after one of those. Nothing is said as the page loads, or for a sort, which `aria-sort` covers.\n- **The pager** is a `navigation` named after the table, so two tables on a page have two named\n pagers.\n- **Busy:** `aria-busy` is on the table while `loading`, and the skeleton rows are hidden from\n assistive tech.\n- **Wide tables:** with `isResponsive`, the `ScrollArea` around the table is a tab stop and a\n named region while it overflows, so it can be scrolled from the keyboard.\n- **Forced colors:** the sort indicator is painted in the system's button text color, and the sort\n button's focus ring is an outline. A selected row's fill is a color forced colors takes away, so\n there a double line in the system's highlight color marks the row, as it marks a selected `Table`\n row, and its checked checkbox carries the selection too. The pager's current page is drawn in the\n system's highlight colors, and its Previous or Next at an end in the system's color for a\n disabled control, at full strength, as [Pagination](https://bestax.io/docs/api/components/pagination)'s are.\n- **No motion:** nothing animates but the skeleton, which stops under reduced motion.",
|
|
70
70
|
"related": [
|
|
71
71
|
"Checkbox",
|
|
72
72
|
"EmptyState",
|
|
@@ -159,11 +159,11 @@
|
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
"title": "Horizontal Field",
|
|
162
|
-
"code": "<DateInput
|
|
162
|
+
"code": "<DateInput\n label=\"Date of birth\"\n autoComplete=\"bday\"\n horizontal\n placeholder=\"YYYY-MM-DD\"\n/>"
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"title": "Horizontal Field",
|
|
166
|
-
"code": "<DateInput\n label=\"Date of birth\"\n horizontal\n placeholder=\"YYYY-MM-DD\"\n openOnFocus={false}\n/>"
|
|
166
|
+
"code": "<DateInput\n label=\"Date of birth\"\n autoComplete=\"bday\"\n horizontal\n placeholder=\"YYYY-MM-DD\"\n openOnFocus={false}\n/>"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"title": "Context-Aware Rendering › Default (with label)",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Date\"\n labelProps={{ htmlFor: 'date-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"calendar-alt\">\n <DateInput id=\"date-field-control\" placeholder=\"YYYY-MM-DD\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
179
179
|
}
|
|
180
180
|
],
|
|
181
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date, month or year.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid or year list inside keep their own names.\n- Closing the popover with `Escape` or a pick returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Dismissing without a pick commits nothing: an empty field stays empty, and leaving afterwards commits only what you typed.\n- Calendar uses `role=\"grid\"` with cells as `role=\"gridcell\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today's day, month and year get it once the page hydrates, so the reader's clock decides which.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, month or year, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid or year list and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` on the grid or year list it picks from, and keeps its tab stop and keys.\n- Roving `tabindex` keeps a single grid cell focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- The month grid is a `role=\"grid\"` of `role=\"row\"`s, labelled by the year in its header. Each month cell carries the full month name as its accessible name, `aria-current=\"date\"` for this month and `aria-disabled` for a month with no selectable day.\n- The year list is a `role=\"listbox\"`, named by the `chooseYear` label where it is the selection surface and by the heading that opens it otherwise. As the selection surface its options take `aria-selected` from the value's year rather than from focus, which roves through the list. When the focused year is disabled, the nearest enabled year takes the tab stop, so `Tab` still reaches the list.\n- The launcher and popover are named \"Choose month\" or \"Choose year\" to match the granularity; override them, and the month grid's \"Previous year\" / \"Next year\" buttons, through `labels` (`chooseMonth`, `chooseYear`, `prevYear`, `nextYear`).\n- Honors `prefers-reduced-motion` (skip popover fade-in).\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right. The month names follow the page.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.",
|
|
181
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date, month or year.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid or year list inside keep their own names.\n- Closing the popover with `Escape` or a pick returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Dismissing without a pick commits nothing: an empty field stays empty, and leaving afterwards commits only what you typed.\n- Calendar uses `role=\"grid\"` with cells as `role=\"gridcell\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today's day, month and year get it once the page hydrates, so the reader's clock decides which.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, month or year, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid or year list and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` on the grid or year list it picks from, and keeps its tab stop and keys.\n- Roving `tabindex` keeps a single grid cell focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- The month grid is a `role=\"grid\"` of `role=\"row\"`s, labelled by the year in its header. Each month cell carries the full month name as its accessible name, `aria-current=\"date\"` for this month and `aria-disabled` for a month with no selectable day.\n- The year list is a `role=\"listbox\"`, named by the `chooseYear` label where it is the selection surface and by the heading that opens it otherwise. As the selection surface its options take `aria-selected` from the value's year rather than from focus, which roves through the list. When the focused year is disabled, the nearest enabled year takes the tab stop, so `Tab` still reaches the list.\n- The launcher and popover are named \"Choose month\" or \"Choose year\" to match the granularity; override them, and the month grid's \"Previous year\" / \"Next year\" buttons, through `labels` (`chooseMonth`, `chooseYear`, `prevYear`, `nextYear`).\n- Honors `prefers-reduced-motion` (skip popover fade-in).\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right. The month names follow the page.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.\n- A date of birth takes `autoComplete=\"bday\"`, which goes on the field, so the browser and assistive technology know what it asks for (WCAG 1.3.5). Without a token the text field turns autocomplete off, since the browser's own suggestions would cover the calendar. A date that autofill writes commits when it reads in the token `format` (the default one when `format` is `Intl` options) or through your `parse`. One it can't read, or that `min`, `max` or a blocked day rules out, isn't committed, as with typing: the field shows it as written, and submits it under a `name`, until focus next leaves the field.",
|
|
182
182
|
"related": ["DateTimeInput", "Input", "TimeInput"],
|
|
183
183
|
"storybook": "https://bestax.io/storybook/?path=/story/form-dateinput",
|
|
184
184
|
"summary": "The `DateInput` component is a form input that opens a popover calendar for date selection.",
|
|
@@ -688,6 +688,15 @@
|
|
|
688
688
|
"inherited": false,
|
|
689
689
|
"deprecated": false
|
|
690
690
|
},
|
|
691
|
+
{
|
|
692
|
+
"name": "autoComplete",
|
|
693
|
+
"type": "string",
|
|
694
|
+
"default": "off",
|
|
695
|
+
"description": "An autofill token for the field, such as `bday` for a date of birth, so the browser and assistive technology know what it asks for. On the text field it's `off` unless you give one, since the browser's own suggestions would cover the calendar. The native input on touch devices takes yours too, and the browser's default without one, and an `inline` calendar, with no field, takes none. A date that autofill writes commits when it reads in the token `format` (the default one when `format` is `Intl` options) or through your `parse`. One it can't read, or that `min`, `max` or a blocked day rules out, isn't committed, as with typing: the field shows it as written, and submits it under a `name`, until focus next leaves the field.",
|
|
696
|
+
"required": false,
|
|
697
|
+
"inherited": false,
|
|
698
|
+
"deprecated": false
|
|
699
|
+
},
|
|
691
700
|
{
|
|
692
701
|
"name": "required",
|
|
693
702
|
"type": "boolean",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"code": "<DateTimeInput label=\"Input only\" popover={false} defaultValue={new Date()} />"
|
|
171
171
|
}
|
|
172
172
|
],
|
|
173
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid and its wheels inside keep their own names.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today gets it once the page hydrates, so the reader's clock decides which day.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateTimeInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.",
|
|
173
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid and its wheels inside keep their own names.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today gets it once the page hydrates, so the reader's clock decides which day.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- In forced colors (Windows' contrast themes), the time wheels' band is drawn in the system's highlight color, since its fill is replaced there, and the values keep the system's text color.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateTimeInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.\n- An `autoComplete` you give goes on the field. Without one the text field turns autocomplete off, since the browser's own suggestions would cover the panel. A date and time that autofill writes commits when it reads in the token `format` (the default one when `format` is `Intl` options) or through your `parse`. One it can't read, or that `min`, `max` or a blocked day or time rules out, isn't committed, as with typing: the field shows it as written, and submits it under a `name`, until focus next leaves the field.",
|
|
174
174
|
"related": ["DateInput", "Input", "TimeInput"],
|
|
175
175
|
"storybook": "https://bestax.io/storybook/?path=/story/form-datetimeinput",
|
|
176
176
|
"summary": "The `DateTimeInput` combines a calendar and a time **wheel spinner** in a single popover — an iOS-style layout.",
|
|
@@ -547,7 +547,7 @@
|
|
|
547
547
|
"name": "color",
|
|
548
548
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
549
549
|
"default": null,
|
|
550
|
-
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill, so there the selected date is drawn in the system's highlight colors instead, whatever the color, which needs bestax's CSS.",
|
|
550
|
+
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill and the wheels' band, so there the selected date is drawn in the system's highlight colors and the band in its highlight color instead, whatever the color, which needs bestax's CSS.",
|
|
551
551
|
"required": false,
|
|
552
552
|
"inherited": true,
|
|
553
553
|
"deprecated": false
|
|
@@ -761,6 +761,15 @@
|
|
|
761
761
|
"inherited": false,
|
|
762
762
|
"deprecated": false
|
|
763
763
|
},
|
|
764
|
+
{
|
|
765
|
+
"name": "autoComplete",
|
|
766
|
+
"type": "string",
|
|
767
|
+
"default": "off",
|
|
768
|
+
"description": "An autofill token for the field. On the text field it's `off` unless you give one, since the browser's own suggestions would cover the calendar. The native input on touch devices takes yours too, and the browser's default without one, and an `inline` picker, with no field, takes none. A date and time that autofill writes commits when it reads in the token `format` (the default one when `format` is `Intl` options) or through your `parse`. One it can't read, or that `min`, `max` or a blocked day or time rules out, isn't committed, as with typing: the field shows it as written, and submits it under a `name`, until focus next leaves the field.",
|
|
769
|
+
"required": false,
|
|
770
|
+
"inherited": false,
|
|
771
|
+
"deprecated": false
|
|
772
|
+
},
|
|
764
773
|
{
|
|
765
774
|
"name": "required",
|
|
766
775
|
"type": "boolean",
|
|
@@ -973,7 +982,7 @@
|
|
|
973
982
|
"name": "color",
|
|
974
983
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
975
984
|
"default": null,
|
|
976
|
-
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill, so there the selected date is drawn in the system's highlight colors instead, whatever the color, which needs bestax's CSS.",
|
|
985
|
+
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill and the wheels' band, so there the selected date is drawn in the system's highlight colors and the band in its highlight color instead, whatever the color, which needs bestax's CSS.",
|
|
977
986
|
"required": false,
|
|
978
987
|
"inherited": false,
|
|
979
988
|
"deprecated": false
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"code": "<Dropdown label=\"Dropdown Menu\" active>\n <Dropdown.Item>First Item</Dropdown.Item>\n <Dropdown.Item>Second Item</Dropdown.Item>\n <Dropdown.Divider />\n <Dropdown.Item>Third Item</Dropdown.Item>\n</Dropdown>"
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
|
-
"accessibility": "- The trigger is a `<button>` with `aria-haspopup=\"true\"` and `aria-expanded`, and its\n `aria-controls` points at the menu, with or without an `id` on the Dropdown.\n- The menu is `role=\"menu\"`, and `aria-labelledby` names it after the trigger, so a screen\n reader moving into it hears the trigger's label. That makes the `label` the menu's name too,\n so a trigger that shows only an icon needs text a screen reader can read, as in the\n [split button](https://bestax.io/docs/api/components/dropdown#split-button).\n- Each item is `role=\"menuitem\"`. An item given `role=\"menuitemcheckbox\"` or\n `role=\"menuitemradio\"` stays in the arrow-key order.\n- `Dropdown.Item active` sets `aria-current=\"true\"`, so the current item isn't only a color. An\n `aria-current` you pass wins: a menu of pages can say `\"page\"`, and `aria-current={false}`\n turns it off, as on an item that says its state with `aria-checked`.\n- **Forced colors:** Bulma draws `Dropdown.Divider` as a background color, which forced colors\n (Windows' contrast themes) paints in the menu's own color, so bestax's styles draw it in the\n system's text color there. Forced colors also replaces the fill and text color Bulma marks an\n `active` item with, so bestax's styles mark it with a bar in the system's highlight color along\n its start edge, as `Menu` does, and every item keeps the bar's width so no label moves.
|
|
45
|
+
"accessibility": "- The trigger is a `<button>` with `aria-haspopup=\"true\"` and `aria-expanded`, and its\n `aria-controls` points at the menu, with or without an `id` on the Dropdown.\n- The menu is `role=\"menu\"`, and `aria-labelledby` names it after the trigger, so a screen\n reader moving into it hears the trigger's label. That makes the `label` the menu's name too,\n so a trigger that shows only an icon needs text a screen reader can read, as in the\n [split button](https://bestax.io/docs/api/components/dropdown#split-button).\n- Each item is `role=\"menuitem\"`. An item given `role=\"menuitemcheckbox\"` or\n `role=\"menuitemradio\"` stays in the arrow-key order.\n- `Dropdown.Item active` sets `aria-current=\"true\"`, so the current item isn't only a color. An\n `aria-current` you pass wins: a menu of pages can say `\"page\"`, and `aria-current={false}`\n turns it off, as on an item that says its state with `aria-checked`.\n- **Forced colors:** Bulma draws `Dropdown.Divider` as a background color, which forced colors\n (Windows' contrast themes) paints in the menu's own color, so bestax's styles draw it in the\n system's text color there. Forced colors also replaces the fill and text color Bulma marks an\n `active` item with, so bestax's styles mark it with a bar in the system's highlight color along\n its start edge, as `Menu` does, and every item keeps the bar's width so no label moves. Forced\n colors also drops the shadow Bulma draws the open menu's box with, so bestax's styles give the\n box an edge in the system's text color. Those rules ship in `bestax.css` and `extras.css`, not\n in Bulma's own stylesheet.\n- A click between items, on a divider say, focuses the menu itself, so the arrow keys still\n reach the items from there.\n- `Dropdown.Item as=\"button\"` defaults to `type=\"button\"`, so a menu item inside a form doesn't\n submit it. Pass `type=\"submit\"` or `type=\"reset\"` and yours is used instead; any other value\n renders `type=\"button\"`.\n- Pressing outside an open menu closes it.\n- On a `hoverable` Dropdown, <kbd>Escape</kbd> puts away a menu the pointer is showing, so it can\n be dismissed without moving the pointer, as\n [WCAG 1.4.13](https://www.w3.org/WAI/WCAG22/Understanding/content-on-hover-or-focus.html) asks.\n It stays away until the pointer leaves the Dropdown. With focus on the trigger, the key is used\n there (`preventDefault()`), so a `Modal` around the Dropdown waits for the next one. With focus\n elsewhere on the page, the key goes on to what has focus too, as a tooltip's does.\n- A click the browser dispatches with no pointer behind it (`detail` 0), as a screen reader's\n browse mode can send when you activate the trigger, opens the menu and focuses its first enabled\n item, as <kbd>Enter</kbd> does. A pointer's click on the trigger, and a script's `click()`, open\n it and move no focus into it.\n\nThe keyboard follows the [WAI-ARIA Menu Button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/).\nUnlike the pattern's menu items, each item is also a tab stop, so <kbd>Tab</kbd> from the\ntrigger of a `hoverable` menu the pointer holds open goes through its items.\n\n- On the trigger: <kbd>ArrowDown</kbd> or <kbd>Enter</kbd>/<kbd>Space</kbd> open the menu and\n focus the first item; <kbd>ArrowUp</kbd> opens the menu and focuses the last item;\n <kbd>Escape</kbd> closes an open menu. On the trigger of a menu that's already open,\n <kbd>ArrowDown</kbd>/<kbd>ArrowUp</kbd> focus the first/last item and\n <kbd>Enter</kbd>/<kbd>Space</kbd> close it.\n- Inside the menu: <kbd>ArrowDown</kbd>/<kbd>ArrowUp</kbd> move between items and wrap around;\n <kbd>Home</kbd>/<kbd>End</kbd> jump to the first/last item; <kbd>Escape</kbd> closes the menu\n and returns focus to the trigger.\n- <kbd>Tab</kbd> in an open menu closes it and moves focus to the next tab stop after the\n Dropdown, and <kbd>Shift</kbd>+<kbd>Tab</kbd> closes it and focuses the trigger. Inside a\n focus trap, such as a `Modal`'s, a Dropdown with nothing after it sends Tab to the trap's\n first stop, as Tab from the trap's last stop does.\n- Typing a letter moves to the next item whose text starts with it, and typing it again cycles\n through the items that do. Letters typed in quick succession add up to one search, so\n <kbd>d</kbd> then <kbd>u</kbd> lands on \"Duplicate\" past \"Download\". Text hidden with\n `aria-hidden`, such as an icon's ligature name, doesn't count, and a new search starts each\n time the menu opens. Typing searches once focus is in the menu, where the trigger's keys\n above put it. A letter typed on the trigger itself does nothing.\n- On an item: <kbd>Enter</kbd> or <kbd>Space</kbd> activates it the way a click does, so its\n `onClick` runs and the menu closes unless `closeOnClick` is `false`. That includes the\n default anchor without an `href` and `as=\"div\"`, which the browser would not activate on\n its own. Holding the key down runs it once.\n- When running an item closes the menu, by click or by key, focus goes back to the trigger,\n as it does for <kbd>Escape</kbd>. An item whose `onClick` moves focus somewhere else keeps\n it there.\n- Disabled items (a `Dropdown.Item` rendered with a native `disabled` attribute or\n `aria-disabled=\"true\"`) and dividers are skipped by the arrow keys and by typing. An item that\n turns disabled while it has focus, such as one whose action is loading, keeps its place: the\n arrows and typing go on from where it sits. An `as=\"button\"` item given `disabled` loses focus\n to the page instead, as any disabled button does.\n- For a panel built around fields, [`Popover`](https://bestax.io/docs/api/components/popover) fits better: `role=\"menu\"` owns\n menu items, and the default `closeOnClick` shuts the menu on a click anywhere in it, a field\n included. Anything focusable you put in the menu anyway that isn't an item (a field, a\n button, a checkbox, a link without a menu-item role) keeps its own keys, so its arrows,\n <kbd>Home</kbd>, <kbd>End</kbd> and letters don't move to the items. A field needs\n `closeOnClick={false}`, or a click into it closes the menu. <kbd>Escape</kbd> and\n <kbd>Tab</kbd> still close the menu from any of them, except an <kbd>Escape</kbd> the\n control used itself by calling `preventDefault()` in its `onKeyDown`, such as an Autocomplete\n closing its list or a date picker closing its calendar.\n The next <kbd>Escape</kbd> closes the menu.",
|
|
46
46
|
"related": ["Button", "ContextMenu", "Popover", "useBulmaClasses"],
|
|
47
47
|
"storybook": "https://bestax.io/storybook/?path=/story/components-dropdown--default",
|
|
48
48
|
"summary": "The `Dropdown` component provides Bulma's versatile dropdown menu for your Bulma React UI. Down, Enter and Space on the trigger open the menu on its first enabled item, and Up opens it on its last. A click the browser dispatches with no pointer behind it (`detail` 0), as a screen reader's browse mode can send, opens it on its first enabled item too. A pointer's click on the trigger, and a script's `click()`, move no focus into the menu. On the trigger of a menu that's already open, Down and Up move focus to its first and last item. In the menu, the arrow keys, Home and End move between the items, and Enter and Space run the focused one the way a click does. Typing a letter moves to the next item whose text starts with it, skipping disabled ones, and letters typed in quick succession add up to one search. Typing searches once focus is in the menu, so a letter typed on the trigger does nothing. Escape closes the menu and focuses the trigger. Tab closes it and moves focus to the next tab stop after the Dropdown, wrapping inside a focus trap such as Modal's, and Shift+Tab closes it and focuses the trigger. Anything focusable in the menu that isn't an item, such as a field, keeps its own keys apart from Escape and Tab, though an Escape it calls `preventDefault()` on in its own `onKeyDown` stays its own and leaves the menu open. For a panel built around fields, use `Popover`.",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "With Input (States)",
|
|
38
|
-
"code": "<>\n <Field label=\"Normal\">\n <Control>\n <Input placeholder=\"Normal state\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <Input isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Focus\">\n <Control>\n <Input isFocused placeholder=\"Focused state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" />\n </Control>\n </Field>\n</>"
|
|
38
|
+
"code": "<>\n <Field label=\"Normal\">\n <Control>\n <Input placeholder=\"Normal state\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <Input isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Focus\">\n <Control>\n <Input isFocused placeholder=\"Focused state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" message=\"Loading…\" />\n </Control>\n </Field>\n</>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "With Input (Disabled & Read Only)",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"title": "With Select (Colors, Sizes, Rounded, Loading, Icons)",
|
|
70
|
-
"code": "<>\n <Field label=\"Primary\">\n <Control>\n <Select color=\"primary\">\n <option value=\"1\">Option 1</option>\n <option value=\"2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Rounded\">\n <Control>\n <Select isRounded>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"With Icons\">\n <Control hasIconsLeft iconLeft={{ name: 'person' }}>\n <Select>\n <option value=\"huck\">Huckleberry Finn</option>\n <option value=\"tom\">Tom Sawyer</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Select isLoading>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n</>"
|
|
70
|
+
"code": "<>\n <Field label=\"Primary\">\n <Control>\n <Select color=\"primary\">\n <option value=\"1\">Option 1</option>\n <option value=\"2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Rounded\">\n <Control>\n <Select isRounded>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"With Icons\">\n <Control hasIconsLeft iconLeft={{ name: 'person' }}>\n <Select>\n <option value=\"huck\">Huckleberry Finn</option>\n <option value=\"tom\">Tom Sawyer</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Select isLoading message=\"Loading options…\">\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n</>"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"title": "With TextArea",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"title": "With TextArea (Rows, Colors, Sizes, States, Loading, Fixed Size)",
|
|
78
|
-
"code": "<>\n <Field label=\"Rows\">\n <Control>\n <TextArea rows={8} placeholder=\"8 rows\" />\n </Control>\n </Field>\n\n <Field label=\"Primary\">\n <Control>\n <TextArea color=\"primary\" placeholder=\"Primary (color='primary')\" />\n </Control>\n </Field>\n\n <Field label=\"Small\">\n <Control>\n <TextArea size=\"small\" placeholder=\"Small\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <TextArea isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <TextArea placeholder=\"Loading state\" />\n </Control>\n </Field>\n\n <Field label=\"Fixed Size\">\n <Control>\n <TextArea hasFixedSize placeholder=\"Fixed size textarea\" rows={3} />\n </Control>\n </Field>\n</>"
|
|
78
|
+
"code": "<>\n <Field label=\"Rows\">\n <Control>\n <TextArea rows={8} placeholder=\"8 rows\" />\n </Control>\n </Field>\n\n <Field label=\"Primary\">\n <Control>\n <TextArea color=\"primary\" placeholder=\"Primary (color='primary')\" />\n </Control>\n </Field>\n\n <Field label=\"Small\">\n <Control>\n <TextArea size=\"small\" placeholder=\"Small\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <TextArea isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <TextArea placeholder=\"Loading state\" message=\"Loading…\" />\n </Control>\n </Field>\n\n <Field label=\"Fixed Size\">\n <Control>\n <TextArea hasFixedSize placeholder=\"Fixed size textarea\" rows={3} />\n </Control>\n </Field>\n</>"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"title": "Grouped Controls",
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
"name": "isLoading",
|
|
405
405
|
"type": "boolean",
|
|
406
406
|
"default": "false",
|
|
407
|
-
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading.",
|
|
407
|
+
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes the input, select or textarea inside, such as its `message`, or text tied to that control with `aria-describedby`, which a screen reader reads when the control takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
408
408
|
"required": false,
|
|
409
409
|
"inherited": true,
|
|
410
410
|
"deprecated": false
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"code": "<IconButton\n as=\"a\"\n href=\"https://bulma.io/documentation/elements/button/\"\n target=\"_blank\"\n rel=\"noreferrer\"\n icon=\"arrow-up-right-from-square\"\n aria-label=\"Bulma's button docs, in a new tab\"\n/>"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
|
-
"accessibility": "- **A name every time:** an icon-only button's name is its text alternative\n ([WCAG 1.1.1](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) and\n [4.1.2](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html)), so the types require\n `aria-label` or `aria-labelledby`, and a development build warns about an empty or blank one. Name\n the action, not the picture.\n- **The name is the button's:** its `aria-label` or `aria-labelledby` names it over anything inside\n it, so a name on the `Icon` is ignored, and there's no need to give one.\n- **Tooltips describe:** a [`Tooltip`](https://bestax.io/docs/api/components/tooltip) around it points the button's\n `aria-describedby` at itself, so the name and the description stay separate. Give the tooltip\n something to add, not the name again.\n- **Keyboard and focus:** it's a native `<button>`, so <kbd>Enter</kbd> and <kbd>Space</kbd> press\n it, with Bulma's focus style. `isLoading` leaves it focusable and holds it still, as on `Button`:\n a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing, and it carries `aria-busy` and\n `aria-disabled` meanwhile. While it loads, Bulma takes away the shadow that shows focus, so it\n shows Bulma's focus outline instead when it has keyboard focus.\n- **Target size:** Bulma's smallest is 30 by 30 pixels, above the 24 by 24\n [WCAG 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) asks for.\n- **Toggles** are [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which reports `aria-pressed`. Give an\n icon-only one an `aria-label` the same way.\n- **Forced colors:** a font icon, or an SVG drawn in `currentColor`, takes the system's text\n color, as a button's text does.",
|
|
57
|
+
"accessibility": "- **A name every time:** an icon-only button's name is its text alternative\n ([WCAG 1.1.1](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) and\n [4.1.2](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html)), so the types require\n `aria-label` or `aria-labelledby`, and a development build warns about an empty or blank one. Name\n the action, not the picture.\n- **The name is the button's:** its `aria-label` or `aria-labelledby` names it over anything inside\n it, so a name on the `Icon` is ignored, and there's no need to give one.\n- **Tooltips describe:** a [`Tooltip`](https://bestax.io/docs/api/components/tooltip) around it points the button's\n `aria-describedby` at itself, so the name and the description stay separate. Give the tooltip\n something to add, not the name again.\n- **Keyboard and focus:** it's a native `<button>`, so <kbd>Enter</kbd> and <kbd>Space</kbd> press\n it, with Bulma's focus style. `isLoading` leaves it focusable and holds it still, as on `Button`:\n a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing, and it carries `aria-busy` and\n `aria-disabled` meanwhile. While it loads, Bulma takes away the shadow that shows focus, so it\n shows Bulma's focus outline instead when it has keyboard focus.\n- **Target size:** Bulma's smallest is 30 by 30 pixels, above the 24 by 24\n [WCAG 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) asks for.\n- **Toggles** are [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which reports `aria-pressed`. Give an\n icon-only one an `aria-label` the same way.\n- **Forced colors:** a font icon, or an SVG drawn in `currentColor`, takes the system's text\n color, as a button's text does, and on a disabled one the system's color for a disabled\n control, at full strength.",
|
|
58
58
|
"related": [
|
|
59
59
|
"Button",
|
|
60
60
|
"Buttons",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "States",
|
|
26
|
-
"code": "<>\n <Input label=\"Normal\" placeholder=\"Normal state\" />\n <Input label=\"Hover\" isHovered placeholder=\"Hovered state\" />\n <Input label=\"Focus\" isFocused placeholder=\"Focused state\" />\n <Input
|
|
26
|
+
"code": "<>\n <Input label=\"Normal\" placeholder=\"Normal state\" />\n <Input label=\"Hover\" isHovered placeholder=\"Hovered state\" />\n <Input label=\"Focus\" isFocused placeholder=\"Focused state\" />\n <Input\n label=\"Loading\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading state\"\n />\n</>"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Loading States by Size",
|
|
30
|
-
"code": "<>\n <Input\n label=\"Loading Small\"\n size=\"small\"\n controlSize=\"small\"\n isLoading\n placeholder=\"Loading small\"\n />\n <Input
|
|
30
|
+
"code": "<>\n <Input\n label=\"Loading Small\"\n size=\"small\"\n controlSize=\"small\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading small\"\n />\n <Input\n label=\"Loading Normal\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading normal\"\n />\n <Input\n label=\"Loading Medium\"\n size=\"medium\"\n controlSize=\"medium\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading medium\"\n />\n <Input\n label=\"Loading Large\"\n size=\"large\"\n controlSize=\"large\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading large\"\n />\n</>"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Disabled & Read Only",
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
"name": "isLoading",
|
|
260
260
|
"type": "boolean",
|
|
261
261
|
"default": "false",
|
|
262
|
-
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading.",
|
|
262
|
+
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes it, tied to it with `aria-describedby`, which a screen reader reads when the field takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
263
263
|
"required": false,
|
|
264
264
|
"inherited": false,
|
|
265
265
|
"deprecated": false
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"code": "function example() {\n const defaultRef = React.useRef<HTMLButtonElement>(null);\n const anchorRef = React.useRef<HTMLAnchorElement>(null);\n const [tags, setTags] = React.useState<string>();\n\n return (\n <>\n <LinkButton ref={defaultRef}>Default</LinkButton>\n <LinkButton as=\"a\" href=\"#forwarded-ref\" ml=\"2\" ref={anchorRef}>\n As an anchor\n </LinkButton>\n <Button\n ml=\"2\"\n onClick={() =>\n setTags(\n `${defaultRef.current?.tagName} / ${anchorRef.current?.tagName}`\n )\n }\n >\n Read both from their refs\n </Button>\n <p>Rendered elements: {tags ?? '—'}</p>\n </>\n );\n}"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
|
-
"accessibility": "- **Semantic HTML:** Renders a native `<button>` element, providing correct keyboard navigation, focus management, and screen reader announcements.\n- **States:** The `isDisabled` and `disabled` props ensure correct `aria-disabled` and `disabled` attributes.\n- **Loading:** while `isLoading` is set, the button carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`, so a screen reader can tell it won't respond, and a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing: `onClick` doesn't run, a submit button doesn't submit its form, and a click on a link doesn't follow its `href`. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would.\n- **Keyboard:** Fully keyboard accessible with Enter and Space activation.\n- **Replaces anti-patterns:** Use this instead of `<div onClick>` or `<span onClick>` for interactive elements that should not navigate.\n\n:::note\nIf your LinkButton has only an icon, use `aria-label` to provide accessible text.\n:::",
|
|
49
|
+
"accessibility": "- **Semantic HTML:** Renders a native `<button>` element, providing correct keyboard navigation, focus management, and screen reader announcements.\n- **States:** The `isDisabled` and `disabled` props ensure correct `aria-disabled` and `disabled` attributes.\n- **Loading:** while `isLoading` is set, the button carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`, so a screen reader can tell it won't respond, and a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing: `onClick` doesn't run, a submit button doesn't submit its form, and a click on a link doesn't follow its `href`. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would.\n- **Keyboard:** Fully keyboard accessible with Enter and Space activation.\n- **Forced colors:** a disabled LinkButton is drawn in the system's color for a disabled control, at\n full strength, as a disabled [`Button`](https://bestax.io/docs/api/elements/button) is.\n- **Replaces anti-patterns:** Use this instead of `<div onClick>` or `<span onClick>` for interactive elements that should not navigate.\n\n:::note\nIf your LinkButton has only an icon, use `aria-label` to provide accessible text.\n:::",
|
|
50
50
|
"related": ["Button", "Buttons", "useBulmaClasses"],
|
|
51
51
|
"storybook": "https://bestax.io/storybook/?path=/story/elements-linkbutton--default",
|
|
52
52
|
"summary": "The `LinkButton` component renders a `<button>` that visually looks like text or a link.",
|