bestax-mcp 1.18.75 → 1.18.76
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/Control.json +3 -3
- package/data/components/CopyButton.json +1 -1
- package/data/components/DateTimeInput.json +3 -3
- 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 +1 -1
- package/data/components/Panel.json +9 -5
- package/data/components/PasswordInput.json +2 -2
- package/data/components/SegmentedControl.json +1 -1
- package/data/components/Select.json +4 -4
- package/data/components/Slider.json +1 -1
- package/data/components/Taginput.json +15 -2
- package/data/components/TextArea.json +3 -3
- package/data/components/TimeInput.json +3 -3
- package/data/components/ToggleButton.json +1 -1
- package/data/skills/bestax-form/SKILL.md +7 -1
- 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 +10 -7
- 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.0"
|
|
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
|
|
@@ -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",
|
|
@@ -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.",
|
|
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
|
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
"name": "color",
|
|
974
974
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
975
975
|
"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.",
|
|
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 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
977
|
"required": false,
|
|
978
978
|
"inherited": false,
|
|
979
979
|
"deprecated": false
|
|
@@ -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.",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"code": "<Navbar>\n <Navbar.Brand>\n <Navbar.Item href=\"#\">\n <img src=\"/img/logo.svg\" alt=\"Logo\" width=\"28\" height=\"28\" />\n </Navbar.Item>\n <Navbar.Burger aria-label=\"menu\" />\n </Navbar.Brand>\n <Navbar.Menu active>\n <Navbar.Start>\n <Navbar.Item href=\"#\">Home</Navbar.Item>\n <Navbar.Item href=\"#\">Docs</Navbar.Item>\n </Navbar.Start>\n <Navbar.End>\n <Navbar.Item href=\"#\">Log in</Navbar.Item>\n </Navbar.End>\n </Navbar.Menu>\n</Navbar>"
|
|
83
83
|
}
|
|
84
84
|
],
|
|
85
|
-
"accessibility": "- The root `Navbar` renders as `<nav role=\"navigation\" aria-label=\"main navigation\">`.\n The default accessible name is `main navigation`. A screen reader announces it with\n the role, and since the name holds the role word, \"navigation\" is heard twice.\n Pass a name without the role word (`aria-label=\"Site\"`), and a different name\n on each Navbar when a page has more than one. A passed `aria-label` replaces\n the default.\n- `Navbar.Item active` sets `aria-current=\"page\"` on the element `as` renders, the link by\n default, so the current item isn't only a color. An `aria-current` you pass wins: a navbar of\n sections on one page can say `\"location\"`, and `aria-current={false}` turns it off.\n- Bulma fills an active link item with its selected color, the link color in a navbar with no\n `color`, and bestax's styles give its text the color Bulma picks to read on that fill,\n `--bulma-navbar-item-selected-color-l`. Bulma's own stylesheet leaves the text in the navbar's\n normal text color, dark gray on blue on the light scheme, so the rule ships in `bestax.css` and\n `extras.css`. A `--bulma-navbar-item-color` you set on the item itself still wins, and an item\n with a `bgColor` keeps the navbar's text color. A rule of your own that takes the fill off\n restates `color` too.\n- Use semantic links (`<a>`) and buttons, and provide clear `aria-label` and `aria-expanded` for the burger toggle.\n- `Navbar.Link` inside a `Navbar.Dropdown` automatically gets `aria-haspopup=\"true\"` and\n `aria-expanded` synced to the dropdown's open state — no manual wiring required.\n <kbd>Enter</kbd>/<kbd>Space</kbd> toggle the dropdown open/closed, and <kbd>Escape</kbd>\n closes it and keeps focus on the link. <kbd>Escape</kbd> anywhere else in the open dropdown, its\n menu included, puts focus back on the link and closes it too, unless a control there marks the\n key used, the key comes from a dialog or from content opened from the menu into a portal, or\n focus can't go back to the link. When the trigger isn't interactive on its own — no\n `href`, not `as=\"button\"`, and not a custom component — it also gets `role=\"button\"` and\n `tabIndex={0}` so it's reachable and operable by keyboard, and a mouse/touch click on it\n toggles the dropdown too (a caller-supplied `onClick` still runs, and can\n `preventDefault()` to opt out).\n- A custom component passed to `as` keeps its own semantics, because a router link takes `to`\n rather than `href` and so can't be recognised from the props it's given. If yours renders\n something non-interactive instead, pass `role=\"button\"` and it takes the fallback above —\n `tabIndex` and click included. The keyboard path is wired either way.\n- `hoverable` dropdowns keep working with a mouse (hover-to-open); the keyboard path above\n opens and closes them independently of hover. Bulma shows a `hoverable` dropdown's menu while\n the pointer is on it and while focus is in it, the link included, on a desktop-wide window.\n <kbd>Escape</kbd> puts a menu shown that way away, and it stays away until the pointer has left\n the dropdown and focus has too, or until the pointer comes back or focus moves onto something in\n it. From the page, the key goes on to what has focus; from inside\n the dropdown, focus moves to the link, with the same exceptions as for an open one, such as focus\n that can't go back to the link, where the menu stays. Below the desktop breakpoint, where the menu always\n shows under the burger, Escape doesn't put it away, though it still closes an open one.\n- **Forced colors:** Bulma draws the burger's bars as a background color, which forced colors\n (Windows' contrast themes) replaces, so the burger would vanish there while it still works and\n takes focus. bestax's styles keep its bars visible in the system's button text color. That rule\n ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet, and an\n [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s burger gets it too. Bulma marks an active or selected\n link item, `Navbar.Link` and dropdown row with a fill and a text color alone, which forced\n colors replaces, so bestax's styles draw a bar in the system's highlight color inside it there:\n along its bottom in a row, and down its start edge where the items stack, in a dropdown and in\n the menu the burger opens. The item and everything in it stay in the contrast theme's colors,\n and an active tab gets the bar above Bulma's thicker underline. This ships in the same\n stylesheets.\n- **`Navbar.Divider` in forced colors:** Bulma draws it as a background color too, which forced\n colors paints in the dropdown's own color, so the line would vanish. bestax's styles draw it in\n the system's text color there, from the same stylesheets.\n- **An open dropdown's edge in forced colors:** from the desktop breakpoint up, Bulma draws\n `Navbar.DropdownMenu` as a box over the page, edged with a shadow and, for some, a line on the\n side it opens from. Forced colors drops the shadow and paints the box in the page's own color, so\n bestax's styles draw a one pixel line in the system's text color around it there, outside the\n box, so nothing moves. Under the burger its rows sit in the menu, with no box to edge. This\n ships in the same stylesheets.\n- **In a colored [`Hero`](https://bestax.io/docs/api/layout/hero):** Bulma's hero sets the colors its navbar's items\n take on hover and when active, but Bulma's navbar doesn't read them, so a focused or hovered\n item took the scheme's fill under the hero's text, and the active item and the burger took the\n link color. For a `Navbar` with no `color` of its own, bestax's styles draw a focused, hovered or\n active item in the hero's text color with the hero's background color as its text, the burger\n and a tab in the hero's text color, and the dropdown arrow in its link's text color. The menu the\n burger opens, and the dropdown's rows in it, take the hero's background and text, except an\n active row, which keeps Bulma's selected fill and the text that reads on it, and on a phone a bold hero's menu takes the hero's\n own gradient. Where `Navbar.DropdownMenu` is a box of its own, on a desktop, its links keep\n Bulma's colors. That rule ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet.\n\n:::note\nThere's no arrow-key roving between navbar items and
|
|
85
|
+
"accessibility": "- The root `Navbar` renders as `<nav role=\"navigation\" aria-label=\"main navigation\">`.\n The default accessible name is `main navigation`. A screen reader announces it with\n the role, and since the name holds the role word, \"navigation\" is heard twice.\n Pass a name without the role word (`aria-label=\"Site\"`), and a different name\n on each Navbar when a page has more than one. A passed `aria-label` replaces\n the default.\n- `Navbar.Item active` sets `aria-current=\"page\"` on the element `as` renders, the link by\n default, so the current item isn't only a color. An `aria-current` you pass wins: a navbar of\n sections on one page can say `\"location\"`, and `aria-current={false}` turns it off.\n- Bulma fills an active link item with its selected color, the link color in a navbar with no\n `color`, and bestax's styles give its text the color Bulma picks to read on that fill,\n `--bulma-navbar-item-selected-color-l`. Bulma's own stylesheet leaves the text in the navbar's\n normal text color, dark gray on blue on the light scheme, so the rule ships in `bestax.css` and\n `extras.css`. A `--bulma-navbar-item-color` you set on the item itself still wins, and an item\n with a `bgColor` keeps the navbar's text color. A rule of your own that takes the fill off\n restates `color` too.\n- Use semantic links (`<a>`) and buttons, and provide clear `aria-label` and `aria-expanded` for the burger toggle.\n- `Navbar.Link` inside a `Navbar.Dropdown` automatically gets `aria-haspopup=\"true\"` and\n `aria-expanded` synced to the dropdown's open state — no manual wiring required.\n <kbd>Enter</kbd>/<kbd>Space</kbd> toggle the dropdown open/closed, and <kbd>Escape</kbd>\n closes it and keeps focus on the link. <kbd>Escape</kbd> anywhere else in the open dropdown, its\n menu included, puts focus back on the link and closes it too, unless a control there marks the\n key used, the key comes from a dialog or from content opened from the menu into a portal, or\n focus can't go back to the link. Focus landing outside an open dropdown, as <kbd>Tab</kbd> past\n its last item or <kbd>Shift</kbd>+<kbd>Tab</kbd> back past its link does, closes it too, so its\n menu isn't left over the page. A controlled one is told through `onActiveChange` and keeps its\n `active`. Focus moving into content opened from the menu into a portal or into a dialog marked\n `aria-modal`, such as a `Modal` an item opens, which gives focus back to the item when it closes, focus going\n nowhere, as the window losing focus does, and a press outside that doesn't move focus leave it\n open. When the trigger isn't interactive on its own — no\n `href`, not `as=\"button\"`, and not a custom component — it also gets `role=\"button\"` and\n `tabIndex={0}` so it's reachable and operable by keyboard, and a mouse/touch click on it\n toggles the dropdown too (a caller-supplied `onClick` still runs, and can\n `preventDefault()` to opt out).\n- A custom component passed to `as` keeps its own semantics, because a router link takes `to`\n rather than `href` and so can't be recognised from the props it's given. If yours renders\n something non-interactive instead, pass `role=\"button\"` and it takes the fallback above —\n `tabIndex` and click included. The keyboard path is wired either way.\n- `hoverable` dropdowns keep working with a mouse (hover-to-open); the keyboard path above\n opens and closes them independently of hover. Bulma shows a `hoverable` dropdown's menu while\n the pointer is on it and while focus is in it, the link included, on a desktop-wide window.\n <kbd>Escape</kbd> puts a menu shown that way away, and it stays away until the pointer has left\n the dropdown and focus has too, or until the pointer comes back or focus moves onto something in\n it. From the page, the key goes on to what has focus; from inside\n the dropdown, focus moves to the link, with the same exceptions as for an open one, such as focus\n that can't go back to the link, where the menu stays. Below the desktop breakpoint, where the menu always\n shows under the burger, Escape doesn't put it away, though it still closes an open one.\n- **Forced colors:** Bulma draws the burger's bars as a background color, which forced colors\n (Windows' contrast themes) replaces, so the burger would vanish there while it still works and\n takes focus. bestax's styles keep its bars visible in the system's button text color. That rule\n ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet, and an\n [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s burger gets it too. Bulma marks an active or selected\n link item, `Navbar.Link` and dropdown row with a fill and a text color alone, which forced\n colors replaces, so bestax's styles draw a bar in the system's highlight color inside it there:\n along its bottom in a row, and down its start edge where the items stack, in a dropdown and in\n the menu the burger opens. The item and everything in it stay in the contrast theme's colors,\n and an active tab gets the bar above Bulma's thicker underline. This ships in the same\n stylesheets.\n- **`Navbar.Divider` in forced colors:** Bulma draws it as a background color too, which forced\n colors paints in the dropdown's own color, so the line would vanish. bestax's styles draw it in\n the system's text color there, from the same stylesheets.\n- **An open dropdown's edge in forced colors:** from the desktop breakpoint up, Bulma draws\n `Navbar.DropdownMenu` as a box over the page, edged with a shadow and, for some, a line on the\n side it opens from. Forced colors drops the shadow and paints the box in the page's own color, so\n bestax's styles draw a one pixel line in the system's text color around it there, outside the\n box, so nothing moves. Under the burger its rows sit in the menu, with no box to edge. This\n ships in the same stylesheets.\n- **In a colored [`Hero`](https://bestax.io/docs/api/layout/hero):** Bulma's hero sets the colors its navbar's items\n take on hover and when active, but Bulma's navbar doesn't read them, so a focused or hovered\n item took the scheme's fill under the hero's text, and the active item and the burger took the\n link color. For a `Navbar` with no `color` of its own, bestax's styles draw a focused, hovered or\n active item in the hero's text color with the hero's background color as its text, the burger\n and a tab in the hero's text color, and the dropdown arrow in its link's text color. The menu the\n burger opens, and the dropdown's rows in it, take the hero's background and text, except an\n active row, which keeps Bulma's selected fill and the text that reads on it, and on a phone a bold hero's menu takes the hero's\n own gradient. Where `Navbar.DropdownMenu` is a box of its own, on a desktop, its links keep\n Bulma's colors. That rule ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet.\n\n:::note\nThere's no arrow-key roving between navbar items, and a press outside an open `Navbar.Dropdown`\ncloses it only when it moves focus there. A press on a field moves focus in every browser, and\none on a button or a link does in some, such as Chrome, and not in others, such as Safari. Bulma navbar dropdowns are hover/click surfaces, so this is\nintentionally kept simple.\n:::",
|
|
86
86
|
"related": ["Button", "Icon", "useBulmaClasses"],
|
|
87
87
|
"storybook": "https://bestax.io/storybook/?path=/story/components-navbar--default",
|
|
88
88
|
"summary": "The `Navbar` component implements Bulma's powerful, responsive navigation bar for your Bulma React UI.",
|
|
@@ -698,7 +698,7 @@
|
|
|
698
698
|
"name": "active",
|
|
699
699
|
"type": "boolean",
|
|
700
700
|
"default": "false",
|
|
701
|
-
"description": "Dropdown is open, whether you control it or not. Escape on its `Navbar.Link`, or anywhere else in the open dropdown, closes it and puts focus on the link, unless a control there marks the key used, the key comes from a dialog or from content opened from the menu into a portal, or focus can't go back to the link.",
|
|
701
|
+
"description": "Dropdown is open, whether you control it or not. Escape on its `Navbar.Link`, or anywhere else in the open dropdown, closes it and puts focus on the link, unless a control there marks the key used, the key comes from a dialog or from content opened from the menu into a portal, or focus can't go back to the link. Focus landing outside the dropdown, as Tab past its last item does, closes it too, and one you control is told through `onActiveChange` and keeps its prop. Focus moving into content opened from the menu into a portal or into a dialog marked `aria-modal` it isn't in, focus going nowhere, as a window losing focus does, and a press outside that doesn't move focus leave it open.",
|
|
702
702
|
"required": false,
|
|
703
703
|
"inherited": false,
|
|
704
704
|
"deprecated": false
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"name": "isLoading",
|
|
238
238
|
"type": "boolean",
|
|
239
239
|
"default": "false",
|
|
240
|
-
"description": "Shows a loading spinner on the input's control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). Use this rather than `isLoading` on a `Control` around the Numberinput: that spinner sits at the `Control`'s right edge, on top of whichever button is there, while this one stays inside the input.",
|
|
240
|
+
"description": "Shows a loading spinner on the input's control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). Use this rather than `isLoading` on a `Control` around the Numberinput: that spinner sits at the `Control`'s right edge, on top of whichever button is there, while this one stays inside the input. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in its `message` as well, where it renders one, or in text you tie to the input with `aria-describedby`, which a screen reader reads when the input 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.",
|
|
241
241
|
"required": false,
|
|
242
242
|
"inherited": false,
|
|
243
243
|
"deprecated": false
|
|
@@ -7,22 +7,26 @@
|
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
9
|
"title": "Complete Panel (Revolutionary Figures)",
|
|
10
|
-
"code": "<Panel aria-labelledby=\"panel-figures\">\n {/* The level that fits the headings around the panel: 4 here, under an h3. */}\n <Panel.Heading id=\"panel-figures\" role=\"heading\" aria-level={4}>\n Revolutionary Figures\n </Panel.Heading>\n <Panel.InputBlock placeholder=\"Search\" />\n <Panel.Tabs>\n <a href=\"#all\" className=\"is-active\" aria-current=\"true\">\n All\n </a>\n <a href=\"#patriots\">Patriots</a>\n <a href=\"#loyalists\">Loyalists</a>\n <a href=\"#battles\">Battles</a>\n <a href=\"#documents\">Documents</a>\n </Panel.Tabs>\n <Panel.Block href=\"#george-washington\" active>\n <Panel.Icon name=\"user\" variant=\"solid\" />\n George Washington\n </Panel.Block>\n <Panel.Block href=\"#alexander-hamilton\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Alexander Hamilton\n </Panel.Block>\n <Panel.Block href=\"#benedict-arnold\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Benedict Arnold\n </Panel.Block>\n <Panel.Block href=\"#john-adams\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n John Adams\n </Panel.Block>\n <Panel.Block href=\"#battle-of-saratoga\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Battle of Saratoga\n </Panel.Block>\n <Panel.Block href=\"#treaty-of-paris\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Treaty of Paris\n </Panel.Block>\n <Panel.Block href=\"#bunker-hill\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Bunker Hill\n </Panel.Block>\n <Panel.CheckboxBlock>remember me</Panel.CheckboxBlock>\n <Panel.ButtonBlock>Reset all filters</Panel.ButtonBlock>\n</Panel>"
|
|
10
|
+
"code": "<Panel aria-labelledby=\"panel-figures\">\n {/* The level that fits the headings around the panel: 4 here, under an h3. */}\n <Panel.Heading id=\"panel-figures\" role=\"heading\" aria-level={4}>\n Revolutionary Figures\n </Panel.Heading>\n <Panel.InputBlock placeholder=\"Search figures\" />\n <Panel.Tabs>\n <a href=\"#all\" className=\"is-active\" aria-current=\"true\">\n All\n </a>\n <a href=\"#patriots\">Patriots</a>\n <a href=\"#loyalists\">Loyalists</a>\n <a href=\"#battles\">Battles</a>\n <a href=\"#documents\">Documents</a>\n </Panel.Tabs>\n <Panel.Block href=\"#george-washington\" active>\n <Panel.Icon name=\"user\" variant=\"solid\" />\n George Washington\n </Panel.Block>\n <Panel.Block href=\"#alexander-hamilton\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Alexander Hamilton\n </Panel.Block>\n <Panel.Block href=\"#benedict-arnold\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Benedict Arnold\n </Panel.Block>\n <Panel.Block href=\"#john-adams\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n John Adams\n </Panel.Block>\n <Panel.Block href=\"#battle-of-saratoga\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Battle of Saratoga\n </Panel.Block>\n <Panel.Block href=\"#treaty-of-paris\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Treaty of Paris\n </Panel.Block>\n <Panel.Block href=\"#bunker-hill\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Bunker Hill\n </Panel.Block>\n <Panel.CheckboxBlock>remember me</Panel.CheckboxBlock>\n <Panel.ButtonBlock>Reset all filters</Panel.ButtonBlock>\n</Panel>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Color Variants",
|
|
14
|
-
"code": "<>\n {(\n [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'dark',\n 'light',\n 'white',\n ] as const\n ).map(color => (\n <Panel key={color} color={color} aria-labelledby={`panel-${color}`}>\n <Panel.Heading id={`panel-${color}`}>\n {color.charAt(0).toUpperCase() + color.slice(1)} Panel\n </Panel.Heading>\n <Panel.InputBlock placeholder=\"Search\" />\n <Panel.Block href=\"#george-washington\" active>\n <Panel.Icon name=\"user\" variant=\"solid\" />\n George Washington\n </Panel.Block>\n <Panel.Block href=\"#marquis-de-lafayette\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Marquis de Lafayette\n </Panel.Block>\n <Panel.Block href=\"#nathanael-greene\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Nathanael Greene\n </Panel.Block>\n <Panel.Block href=\"#battle-of-trenton\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Battle of Trenton\n </Panel.Block>\n <Panel.Block href=\"#yorktown\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Yorktown\n </Panel.Block>\n <Panel.ButtonBlock>Reset all filters</Panel.ButtonBlock>\n </Panel>\n ))}\n</>"
|
|
14
|
+
"code": "<>\n {(\n [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'dark',\n 'light',\n 'white',\n ] as const\n ).map(color => (\n <Panel key={color} color={color} aria-labelledby={`panel-${color}`}>\n <Panel.Heading id={`panel-${color}`}>\n {color.charAt(0).toUpperCase() + color.slice(1)} Panel\n </Panel.Heading>\n <Panel.InputBlock placeholder=\"Search figures\" />\n <Panel.Block href=\"#george-washington\" active>\n <Panel.Icon name=\"user\" variant=\"solid\" />\n George Washington\n </Panel.Block>\n <Panel.Block href=\"#marquis-de-lafayette\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Marquis de Lafayette\n </Panel.Block>\n <Panel.Block href=\"#nathanael-greene\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n Nathanael Greene\n </Panel.Block>\n <Panel.Block href=\"#battle-of-trenton\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Battle of Trenton\n </Panel.Block>\n <Panel.Block href=\"#yorktown\">\n <Panel.Icon name=\"flag\" variant=\"solid\" />\n Yorktown\n </Panel.Block>\n <Panel.ButtonBlock>Reset all filters</Panel.ButtonBlock>\n </Panel>\n ))}\n</>"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "A Panel That Is Not Navigation",
|
|
18
18
|
"code": "<Panel as=\"section\" color=\"info\" aria-labelledby=\"panel-sessions\">\n <Panel.Heading id=\"panel-sessions\">Congress Sessions</Panel.Heading>\n <Panel.Block as=\"div\">\n <Table isFullwidth>\n <Table.Thead>\n <Table.Tr>\n <Table.Th>Date</Table.Th>\n <Table.Th>Session</Table.Th>\n </Table.Tr>\n </Table.Thead>\n <Table.Tbody>\n <Table.Tr>\n <Table.Td>1774</Table.Td>\n <Table.Td>First Continental Congress</Table.Td>\n </Table.Tr>\n <Table.Tr>\n <Table.Td>1775</Table.Td>\n <Table.Td>Second Continental Congress</Table.Td>\n </Table.Tr>\n </Table.Tbody>\n </Table>\n </Panel.Block>\n <Panel.Block href=\"#delegates\">\n <Panel.Icon name=\"user\" variant=\"solid\" />\n All delegates\n </Panel.Block>\n</Panel>"
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"title": "A Search Field With a Name of Its Own",
|
|
22
|
+
"code": "<Panel aria-labelledby=\"panel-repositories\">\n <Panel.Heading id=\"panel-repositories\">Repositories</Panel.Heading>\n <Panel.Block as=\"div\">\n <Control iconLeftName=\"search\">\n <Input aria-label=\"Search repositories\" placeholder=\"Search\" />\n </Control>\n </Panel.Block>\n <Panel.Block href=\"#bulma\">\n <Panel.Icon name=\"book\" variant=\"solid\" />\n bulma\n </Panel.Block>\n <Panel.Block href=\"#marksheet\">\n <Panel.Icon name=\"book\" variant=\"solid\" />\n marksheet\n </Panel.Block>\n</Panel>"
|
|
23
|
+
},
|
|
20
24
|
{
|
|
21
25
|
"title": "Compound (dot-notation) usage",
|
|
22
26
|
"code": "<Panel aria-labelledby=\"panel-documents\">\n <Panel.Heading id=\"panel-documents\">Founding Documents</Panel.Heading>\n <Panel.Block href=\"#declaration-of-independence\" active>\n <Panel.Icon name=\"file\" variant=\"solid\" />\n Declaration of Independence\n </Panel.Block>\n <Panel.Block href=\"#articles-of-confederation\">\n <Panel.Icon name=\"file\" variant=\"solid\" />\n Articles of Confederation\n </Panel.Block>\n <Panel.ButtonBlock>Reset all filters</Panel.ButtonBlock>\n</Panel>"
|
|
23
27
|
}
|
|
24
28
|
],
|
|
25
|
-
"accessibility": "- The root panel renders as a semantic `<nav>`, a navigation landmark, by default. For a panel that is not navigation, set `as` to `article`, `section`, `aside` or `div`, and give a `section` an accessible name (for example `aria-labelledby` pointing at the `Panel.Heading`'s `id`) if it should be a region.\n- `Panel.Heading` renders Bulma's `<p class=\"panel-heading\">`, which assistive tech reads as a plain paragraph: it isn't a heading, and it doesn't name the panel. A screen reader user who moves by heading skips it, and one who moves by landmark hears \"navigation\" for each panel with nothing to tell them apart. Give the heading `role=\"heading\"` and the `aria-level` that fits the headings already on the page. To name a `nav` panel, the default, after its heading, give the heading an `id` that's unique on the page and write `aria-labelledby` with that id on the `Panel`, the way the bullet above names a `section`. The examples above name each panel this way, and the first also makes its heading one.\n- The `Panel.Block` by default renders as an anchor `<a>`. Its props follow `as`: only an `a` takes the anchor attributes (`href`, `target`, `download` and the rest), and only a `label` takes `htmlFor` and `form`. A block on another tag drops them, and `rel`, at runtime too.\n- Give each `Panel.Block` that opens something an `href`, as the examples do: an `<a>` with no `href` isn't a link, so Tab skips it, Enter does nothing on it, and assistive tech reads it as text. A block that isn't a link takes `as=\"div\"`, or `as=\"label\"` around a control. The links you write in `Panel.Tabs` take an `href` too, and the active one `aria-current=\"true\"` beside its `is-active` class, which is only seen.\n- `Panel.Block active` sets `aria-current=\"page\"` on the element `as` renders, the `<a>` by default, so the current block isn't only a color. An `aria-current` you pass wins: a panel of sections on one page can say `\"location\"`, and `aria-current={false}` turns it off, as on an active `label` block with a checkbox.\n- A panel with no `color` keeps its heading readable on the dark scheme through bestax's `components/panel` partial, which `extras.css` and `bestax.css` include. Bulma's CSS alone writes that heading white on light gray.\n- A panel with a `color` draws the text of its active block and active tab, the active block's icon and the active tab's underline in that color at the lightness Bulma picks for the color's text on the page, through the same partial, so they read on both schemes. Black takes the title text's lightness, which is white on the dark scheme. Without the partial the text inherits the color's text helper Panel puts on the panel, and the icon and underline take the color's own lightness, which for a light or white panel is near white on white.\n- **Forced colors:** Bulma marks the active tab and the active block with colors alone, which forced colors (Windows' contrast themes) replaces, so bestax's styles draw a bar in the system's highlight color there: along the bottom of the active tab, and down the start edge of the active block. The tab, the block and everything in them stay in the contrast theme's colors. It reads the `is-active` class, on a `Panel.Block` and on the tab links you write in `Panel.Tabs`. The panel's own edge is a shadow, which forced colors drops, so the same styles draw it as a one pixel line in the system's text color around the panel, with a line under the heading in place of its fill. This comes from the same partial.",
|
|
29
|
+
"accessibility": "- The root panel renders as a semantic `<nav>`, a navigation landmark, by default. For a panel that is not navigation, set `as` to `article`, `section`, `aside` or `div`, and give a `section` an accessible name (for example `aria-labelledby` pointing at the `Panel.Heading`'s `id`) if it should be a region.\n- `Panel.Heading` renders Bulma's `<p class=\"panel-heading\">`, which assistive tech reads as a plain paragraph: it isn't a heading, and it doesn't name the panel. A screen reader user who moves by heading skips it, and one who moves by landmark hears \"navigation\" for each panel with nothing to tell them apart. Give the heading `role=\"heading\"` and the `aria-level` that fits the headings already on the page. To name a `nav` panel, the default, after its heading, give the heading an `id` that's unique on the page and write `aria-labelledby` with that id on the `Panel`, the way the bullet above names a `section`. The examples above name each panel this way, and the first also makes its heading one.\n- The `Panel.Block` by default renders as an anchor `<a>`. Its props follow `as`: only an `a` takes the anchor attributes (`href`, `target`, `download` and the rest), and only a `label` takes `htmlFor` and `form`. A block on another tag drops them, and `rel`, at runtime too.\n- Give each `Panel.Block` that opens something an `href`, as the examples do: an `<a>` with no `href` isn't a link, so Tab skips it, Enter does nothing on it, and assistive tech reads it as text. A block that isn't a link takes `as=\"div\"`, or `as=\"label\"` around a control. The links you write in `Panel.Tabs` take an `href` too, and the active one `aria-current=\"true\"` beside its `is-active` class, which is only seen.\n- `Panel.InputBlock`'s field takes its name from its `placeholder`, which browsers fall back to, and an `aria-label` you pass it names nothing. [A Search Field With a Name of Its Own](https://bestax.io/docs/api/components/panel#a-search-field-with-a-name-of-its-own) shows what to pass and how to build a field with a name of its own.\n- `Panel.Block active` sets `aria-current=\"page\"` on the element `as` renders, the `<a>` by default, so the current block isn't only a color. An `aria-current` you pass wins: a panel of sections on one page can say `\"location\"`, and `aria-current={false}` turns it off, as on an active `label` block with a checkbox.\n- A panel with no `color` keeps its heading readable on the dark scheme through bestax's `components/panel` partial, which `extras.css` and `bestax.css` include. Bulma's CSS alone writes that heading white on light gray.\n- A panel with a `color` draws the text of its active block and active tab, the active block's icon and the active tab's underline in that color at the lightness Bulma picks for the color's text on the page, through the same partial, so they read on both schemes. Black takes the title text's lightness, which is white on the dark scheme. Without the partial the text inherits the color's text helper Panel puts on the panel, and the icon and underline take the color's own lightness, which for a light or white panel is near white on white.\n- **Forced colors:** Bulma marks the active tab and the active block with colors alone, which forced colors (Windows' contrast themes) replaces, so bestax's styles draw a bar in the system's highlight color there: along the bottom of the active tab, and down the start edge of the active block. The tab, the block and everything in them stay in the contrast theme's colors. It reads the `is-active` class, on a `Panel.Block` and on the tab links you write in `Panel.Tabs`. The panel's own edge is a shadow, which forced colors drops, so the same styles draw it as a one pixel line in the system's text color around the panel, with a line under the heading in place of its fill. This comes from the same partial.",
|
|
26
30
|
"related": ["Icon", "useBulmaClasses"],
|
|
27
31
|
"storybook": "https://bestax.io/storybook/?path=/story/components-panel--revolutionary-war",
|
|
28
32
|
"summary": "The `Panel` component implements Bulma's versatile panel block for React.",
|
|
@@ -320,7 +324,7 @@
|
|
|
320
324
|
},
|
|
321
325
|
{
|
|
322
326
|
"path": "Panel.InputBlock",
|
|
323
|
-
"summary": "Search input with icon (renders as `<div class=\"panel-block\">`)",
|
|
327
|
+
"summary": "Search input with icon (renders as `<div class=\"panel-block\">` around the `<input>`). Its field takes its name from its `placeholder`, which browsers fall back to, and has none without one, so pass one that says what it searches. Attributes you pass for the field, `aria-label`, `aria-labelledby` and `id` among them, go on the `div`, not on the `<input>`, and name nothing there. For a field that needs a name of its own, an `id` or other input attributes, build the block from `<Panel.Block as=\"div\">` with a `Control` and an `Input` inside.",
|
|
324
328
|
"component": null,
|
|
325
329
|
"props": [
|
|
326
330
|
{
|
|
@@ -345,7 +349,7 @@
|
|
|
345
349
|
"name": "placeholder",
|
|
346
350
|
"type": "string",
|
|
347
351
|
"default": null,
|
|
348
|
-
"description": "
|
|
352
|
+
"description": "The field's placeholder, which browsers fall back to for its name, so say what it searches (\"Search repositories\").",
|
|
349
353
|
"required": false,
|
|
350
354
|
"inherited": false,
|
|
351
355
|
"deprecated": false
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"title": "Disabled and Loading",
|
|
35
|
-
"code": "<>\n <PasswordInput label=\"Disabled\" disabled defaultValue=\"hunter2\" />\n <PasswordInput label=\"Checking\" isLoading />\n</>"
|
|
35
|
+
"code": "<>\n <PasswordInput label=\"Disabled\" disabled defaultValue=\"hunter2\" />\n <PasswordInput label=\"Checking\" isLoading message=\"Checking…\" />\n</>"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"title": "Strength Recipe",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"name": "isLoading",
|
|
137
137
|
"type": "boolean",
|
|
138
138
|
"default": "false",
|
|
139
|
-
"description": "Shows a loading spinner on the `Control` it renders, at the edge the toggle uses, so the toggle isn't drawn meanwhile, and a shown password is hidden until it's back. Inside your own `Control` it renders none, so this draws nothing and warns in development; set `isLoading` on that `Control`, which hides the toggle too.",
|
|
139
|
+
"description": "Shows a loading spinner on the `Control` it renders, at the edge the toggle uses, so the toggle isn't drawn meanwhile, and a shown password is hidden until it's back. Inside your own `Control` it renders none, so this draws nothing and warns in development; set `isLoading` on that `Control`, which hides the toggle too. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in its `message` as well, such as `message=\"Loading…\"`, which describes the input, so a screen reader reads it 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.",
|
|
140
140
|
"required": false,
|
|
141
141
|
"inherited": false,
|
|
142
142
|
"deprecated": false
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"code": "function example() {\n const views = [\n { value: 'list', label: 'List' },\n { value: 'grid', label: 'Grid' },\n { value: 'board', label: 'Board' },\n ];\n\n return (\n <SegmentedControl aria-label=\"View\" defaultValue=\"grid\">\n {views.map(view => (\n <SegmentedControl.Segment key={view.value} value={view.value}>\n {view.label}\n </SegmentedControl.Segment>\n ))}\n </SegmentedControl>\n );\n}"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"accessibility": "`SegmentedControl` follows the\n[APG radio group pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/), which is what the\n[APG toolbar example](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/examples/toolbar/) uses for\nits alignment buttons: \"since pressing one toggles off another so that only one button in the group\nis in the pressed state, the toggles behave like radio buttons.\"\n\n- **Roles and state:** the row is `role=\"radiogroup\"`, and each segment is a native\n `<button type=\"button\">` with `role=\"radio\"` and `aria-checked` set to `\"true\"` or `\"false\"` from\n the first render, server markup included. There's no `aria-pressed`: a segment is checked or not,\n not pressed.\n- **A name for the group:** a radio group needs one, so pass `aria-label` or `aria-labelledby`. A\n development build warns when it has neither.\n- **One tab stop:** the checked segment holds it, or the first enabled segment while none is\n checked. While focus is in the row the stop goes with it, so Tab always leaves from where you\n are. The first-segment fallback needs the browser: server markup with nothing checked has no\n tab stop until the row has rendered on the client, as\n [Nothing Checked Yet](https://bestax.io/docs/api/components/segmentedcontrol#nothing-checked-yet) says.\n- **The check follows focus:** the arrow keys, Home and End check the segment they move to, as\n native radio buttons do. A screen reader announces the new segment as checked straight away.\n- **It can't be cleared:** once a segment is checked, one always is. Pressing the checked segment\n again keeps it checked and doesn't call `onChange`.\n- **Icon-only segments** need an `aria-label`, as on `Button`.\n- **Checked is easy to see:** the default `link` fill turns a light segment solid blue, and a dark\n one bright in dark mode, so it's a change in lightness and not only in hue. `color` leaves out the\n fills that wouldn't be, the same way `ToggleButton` does.\n- **Forced colors:** Windows' contrast themes replace the fill, so bestax's styles draw the checked\n segment in the system's highlight colors there, whatever its `color`, and a disabled checked one\n in the system's color for a disabled control, filled.\n- **Not a form field:** it's always `type=\"button\"`, so it never submits a form, and it carries no\n value. A choice the form should send is `Radios`.",
|
|
53
|
+
"accessibility": "`SegmentedControl` follows the\n[APG radio group pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/), which is what the\n[APG toolbar example](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/examples/toolbar/) uses for\nits alignment buttons: \"since pressing one toggles off another so that only one button in the group\nis in the pressed state, the toggles behave like radio buttons.\"\n\n- **Roles and state:** the row is `role=\"radiogroup\"`, and each segment is a native\n `<button type=\"button\">` with `role=\"radio\"` and `aria-checked` set to `\"true\"` or `\"false\"` from\n the first render, server markup included. There's no `aria-pressed`: a segment is checked or not,\n not pressed.\n- **A name for the group:** a radio group needs one, so pass `aria-label` or `aria-labelledby`. A\n development build warns when it has neither.\n- **One tab stop:** the checked segment holds it, or the first enabled segment while none is\n checked. While focus is in the row the stop goes with it, so Tab always leaves from where you\n are. The first-segment fallback needs the browser: server markup with nothing checked has no\n tab stop until the row has rendered on the client, as\n [Nothing Checked Yet](https://bestax.io/docs/api/components/segmentedcontrol#nothing-checked-yet) says.\n- **The check follows focus:** the arrow keys, Home and End check the segment they move to, as\n native radio buttons do. A screen reader announces the new segment as checked straight away.\n- **It can't be cleared:** once a segment is checked, one always is. Pressing the checked segment\n again keeps it checked and doesn't call `onChange`.\n- **Icon-only segments** need an `aria-label`, as on `Button`.\n- **Checked is easy to see:** the default `link` fill turns a light segment solid blue, and a dark\n one bright in dark mode, so it's a change in lightness and not only in hue. `color` leaves out the\n fills that wouldn't be, the same way `ToggleButton` does.\n- **Forced colors:** Windows' contrast themes replace the fill, so bestax's styles draw the checked\n segment in the system's highlight colors there, whatever its `color`, and a disabled checked one\n in the system's color for a disabled control, filled. A disabled segment that isn't checked\n is drawn in that color at full strength, as any disabled `Button` is.\n- **Not a form field:** it's always `type=\"button\"`, so it never submits a form, and it carries no\n value. A choice the form should send is `Radios`.",
|
|
54
54
|
"related": [
|
|
55
55
|
"Buttons",
|
|
56
56
|
"Icon",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "States",
|
|
30
|
-
"code": "<>\n <Select label=\"Normal\">\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n <Select label=\"Hover\" isHovered>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n <Select label=\"Focus\" isFocused>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n <Select label=\"Loading\" isLoading>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n</>"
|
|
30
|
+
"code": "<>\n <Select label=\"Normal\">\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n <Select label=\"Hover\" isHovered>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n <Select label=\"Focus\" isFocused>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n <Select label=\"Loading\" isLoading message=\"Loading options…\">\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n </Select>\n</>"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Loading States by Size",
|
|
34
|
-
"code": "<>\n <Select
|
|
34
|
+
"code": "<>\n <Select\n label=\"Loading Small\"\n size=\"small\"\n isLoading\n message=\"Loading options…\"\n >\n <option value=\"\">Please select</option>\n </Select>\n <Select label=\"Loading Normal\" isLoading message=\"Loading options…\">\n <option value=\"\">Please select</option>\n </Select>\n <Select\n label=\"Loading Medium\"\n size=\"medium\"\n isLoading\n message=\"Loading options…\"\n >\n <option value=\"\">Please select</option>\n </Select>\n <Select\n label=\"Loading Large\"\n size=\"large\"\n isLoading\n message=\"Loading options…\"\n >\n <option value=\"\">Please select</option>\n </Select>\n</>"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "Disabled",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"name": "isLoading",
|
|
160
160
|
"type": "boolean",
|
|
161
161
|
"default": "false",
|
|
162
|
-
"description": "Replaces the chevron with a loading spinner. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded).",
|
|
162
|
+
"description": "Replaces the chevron with a loading spinner. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in its `message` as well, such as `message=\"Loading…\"`, which describes the select, so a screen reader reads it 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.",
|
|
163
163
|
"required": false,
|
|
164
164
|
"inherited": false,
|
|
165
165
|
"deprecated": false
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
"name": "isLoading",
|
|
388
388
|
"type": "boolean",
|
|
389
389
|
"default": "false",
|
|
390
|
-
"description": "Replaces the chevron with a loading spinner. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded).",
|
|
390
|
+
"description": "Replaces the chevron with a loading spinner. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner is only drawn, so a screen reader hears nothing of it. Say that the select is loading in text you tie to it with `aria-describedby`, which a screen reader reads when it takes focus. A load that starts while the user is in the field isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
391
391
|
"required": false,
|
|
392
392
|
"inherited": false,
|
|
393
393
|
"deprecated": false
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Volume\"\n labelProps={{ htmlFor: 'volume-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"volume-up\">\n <Slider\n id=\"volume-field-control\"\n defaultValue={50}\n color=\"primary\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"accessibility": "- Uses native `<input type=\"range\">` element\n- The `label` prop, or the label of a `Field` the slider sits in, names its input.\n- In range mode the label starts each thumb's name, so `<Slider range label=\"Price range\" />` announces \"Price range Minimum value\" and \"Price range Maximum value\". Each thumb points `aria-labelledby` at the label and at a hidden span holding its own text, because an `aria-label` would outrank the label. The label's `for` still lands on the low thumb, so clicking the label focuses it.\n- `ariaLabel` wins over the label. In range mode each entry is that thumb's whole name, with no label in front, and an empty entry counts as unset.\n- An `aria-label` or `aria-labelledby` you pass straight to a range Slider names the whole Slider, so it takes the label's place at the start of both thumbs' names: `<Slider range aria-label=\"Budget\" />` announces \"Budget Minimum value\" and \"Budget Maximum value\". An `ariaLabel` entry still wins for its own thumb. To keep a label out of the thumbs' names altogether, pass `aria-labelledby={undefined}`, and they stay \"Minimum value\" and \"Maximum value\".\n- A `Field` label you wire by hand with `labelProps={{ htmlFor }}`, as in a horizontal form, gets no generated id, so give it one of your own there as well, as in `labelProps={{ htmlFor: 'price', id: 'price-label' }}`, and it starts both thumbs' names the same way. Without that `id` it reaches a range Slider only through its `for`, which the thumbs' default `aria-label` outranks, so they stay \"Minimum value\" and \"Maximum value\".\n- In forced colors (Windows' contrast themes) the track and its fill would disappear, since they're painted as a gradient. bestax's styles paint the fill in the system's highlight color and the rest of the track in its text color there, so the track shows how far it's filled. The mark labels draw in its text color too, and the tick lines in its button text color, with a hairline in the page's color down the middle where a line crosses the track, so it shows on the track and on the fill. A disabled slider draws its track, thumbs, ticks and labels in its color for disabled text instead. All of them draw at full strength there.\n- Has `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes\n- The thumb's `aria-valuetext` is what `getAriaValueText` returns, or else the value bubble's text when `formatOutput` or `scale` is set, whether or not the bubble shows, so ``formatOutput={v => `$${v}`}`` announces \"$41\" rather than \"41\".\n- The value bubble is an `<output>`, which a browser treats as a live region. It's set not to announce: a thumb announces its value as it's moved.\n- Fully keyboard accessible with arrow keys\n- Home and End move a thumb to the slider's ends. When `max` falls between two steps, End stops at the last step below it, the highest value the slider holds, and that's the value it reports. On a range Slider a thumb stops at the other thumb, or `minDistance` short of it.\n- Focus states clearly visible\n- On a right-to-left page the native range mirrors, and the fill, the tick marks and the value bubble follow it, so a value of 25 fills from the right. A vertical slider still fills from the bottom.\n- In forced colors (Windows' contrast themes) the value bubble takes the page's own background, and every side of its arrow would be painted, drawing it as a square. bestax's styles outline the bubble in the system's text color there, and keep the arrow a triangle in that color, pointing at the thumb whichever side the bubble sits on.\n- The `message` describes the slider through `aria-describedby`, both thumbs in range mode. Ids you pass in `aria-describedby` go first, on the only thumb or the low one, where the other attributes go.",
|
|
61
|
+
"accessibility": "- Uses native `<input type=\"range\">` element\n- The `label` prop, or the label of a `Field` the slider sits in, names its input.\n- In range mode the label starts each thumb's name, so `<Slider range label=\"Price range\" />` announces \"Price range Minimum value\" and \"Price range Maximum value\". Each thumb points `aria-labelledby` at the label and at a hidden span holding its own text, because an `aria-label` would outrank the label. The label's `for` still lands on the low thumb, so clicking the label focuses it.\n- `ariaLabel` wins over the label. In range mode each entry is that thumb's whole name, with no label in front, and an empty entry counts as unset.\n- An `aria-label` or `aria-labelledby` you pass straight to a range Slider names the whole Slider, so it takes the label's place at the start of both thumbs' names: `<Slider range aria-label=\"Budget\" />` announces \"Budget Minimum value\" and \"Budget Maximum value\". An `ariaLabel` entry still wins for its own thumb. To keep a label out of the thumbs' names altogether, pass `aria-labelledby={undefined}`, and they stay \"Minimum value\" and \"Maximum value\".\n- A `Field` label you wire by hand with `labelProps={{ htmlFor }}`, as in a horizontal form, gets no generated id, so give it one of your own there as well, as in `labelProps={{ htmlFor: 'price', id: 'price-label' }}`, and it starts both thumbs' names the same way. Without that `id` it reaches a range Slider only through its `for`, which the thumbs' default `aria-label` outranks, so they stay \"Minimum value\" and \"Maximum value\".\n- In forced colors (Windows' contrast themes) the track and its fill would disappear, since they're painted as a gradient. bestax's styles paint the fill in the system's highlight color and the rest of the track in its text color there, so the track shows how far it's filled. The mark labels draw in its text color too, and the tick lines in its button text color, with a hairline in the page's color down the middle where a line crosses the track, so it shows on the track and on the fill. A disabled slider draws its track, thumbs, ticks and labels in its color for disabled text instead. All of them draw at full strength there.\n- Has `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes\n- The thumb's `aria-valuetext` is what `getAriaValueText` returns, or else the value bubble's text when `formatOutput` or `scale` is set, whether or not the bubble shows, so ``formatOutput={v => `$${v}`}`` announces \"$41\" rather than \"41\".\n- The value bubble is an `<output>`, which a browser treats as a live region. It's set not to announce: a thumb announces its value as it's moved.\n- Fully keyboard accessible with arrow keys\n- Home and End move a thumb to the slider's ends. When `max` falls between two steps, End stops at the last step below it, the highest value the slider holds, and that's the value it reports. On a range Slider a thumb stops at the other thumb, or `minDistance` short of it.\n- A range Slider with no `defaultValue` starts its high thumb at that highest value too, so its `aria-valuenow`, its value bubble and its fill say where the thumb sits, which is also what a form submits.\n- Focus states clearly visible\n- On a right-to-left page the native range mirrors, and the fill, the tick marks and the value bubble follow it, so a value of 25 fills from the right. A vertical slider still fills from the bottom.\n- In forced colors (Windows' contrast themes) the value bubble takes the page's own background, and every side of its arrow would be painted, drawing it as a square. bestax's styles outline the bubble in the system's text color there, and keep the arrow a triangle in that color, pointing at the thumb whichever side the bubble sits on.\n- The `message` describes the slider through `aria-describedby`, both thumbs in range mode. Ids you pass in `aria-describedby` go first, on the only thumb or the low one, where the other attributes go.",
|
|
62
62
|
"related": ["Numberinput", "Progress"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-slider",
|
|
64
64
|
"summary": "The `Slider` component provides a range slider input for selecting values within a range.",
|
|
@@ -45,6 +45,10 @@
|
|
|
45
45
|
"title": "Non-closable Tags",
|
|
46
46
|
"code": "<Taginput\n defaultValue={['Fixed', 'Tags']}\n closable={false}\n tagColor=\"primary\"\n placeholder=\"Cannot remove tags...\"\n/>"
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"title": "Names in Another Language",
|
|
50
|
+
"code": "<Taginput\n data={['Pomme', 'Poire', 'Prune']}\n placeholder=\"Ajouter un fruit\"\n labels={{ input: 'Fruits', suggestions: 'Propositions' }}\n/>"
|
|
51
|
+
},
|
|
48
52
|
{
|
|
49
53
|
"title": "Context-Aware Rendering › Default (with label)",
|
|
50
54
|
"code": "<Taginput\n label=\"Tags\"\n defaultValue={['React', 'TypeScript']}\n placeholder=\"Add a tag...\"\n tagColor=\"primary\"\n/>"
|
|
@@ -58,7 +62,7 @@
|
|
|
58
62
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Tags\"\n labelProps={{ htmlFor: 'tags-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control>\n <Taginput\n id=\"tags-field-control\"\n icon=\"tags\"\n defaultValue={['React', 'TypeScript']}\n placeholder=\"Add a tag...\"\n tagColor=\"primary\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
59
63
|
}
|
|
60
64
|
],
|
|
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). While the label is wired it also names the input; without one, the input falls back to `aria-label=\"Add tag\"
|
|
65
|
+
"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). While the label is wired it also names the input; without one, the input falls back to `aria-label=\"Add tag\"`, or `labels.input` in your language. Inside a labeled `Field`, that `Field`'s label names the input the same way and replaces the fallback.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- When `maxTags` is reached the text input turns read-only rather than going away, so keyboard focus stays where it was and the label keeps naming the input. The suggestion list stays closed.\n- While the counter shows, it describes the input through `aria-describedby`, so a screen reader hears the count, like \"3 / 3\" at the limit.\n- Tags are keyboard navigable\n- Each tag's remove button is named \"Remove\" and the tag's text, the `field` of an object tag. With `ariaCloseLabel`, every button takes that one name, as for a translation, and is described by its tag's text, so it still says which tag it removes. With a `tagTemplate` it has the one name and no description\n- When the last tag's remove button has focus and takes its tag off, as from the keyboard, focus first moves to the remove button before it, or to the input when no tag is left, so it doesn't drop to the page. Any other tag's remove button keeps focus\n- With `data`, the input is a `role=\"combobox\"` with `aria-autocomplete=\"list\"` and `aria-haspopup=\"listbox\"`. Its `aria-expanded` is true only while the suggestion list is on screen, and while it is, `aria-controls` points at the list. While no suggestion matches there's no list, so it stays false. Without `data` there's never a list, so the input stays a plain text field\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted suggestion as the arrow keys or the mouse move it\n- Focus moving from the input to another element closes the suggestion list, as `Tab` to the next field or to a tag's remove button does, so the list doesn't stay open over what has focus. A press on a suggestion keeps focus in the input, so the list stays open for the click, and the list takes no `Tab` stop of its own\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 the horizontal examples above name the Taginput, 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 suggestions, each a `role=\"option\"` with an id of its own, and the highlighted one has `aria-selected=\"true\"`\n- In forced colors (Windows' contrast themes), which take away the list's shadow and the highlighted suggestion's fill, the open list is drawn with an edge and the highlighted suggestion with an outline in the system's highlight color\n- The `message` describes the input through `aria-describedby`, after the counter while it shows, so a screen reader reads both 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
66
|
"related": ["Autocomplete", "Input", "Tag"],
|
|
63
67
|
"storybook": "https://bestax.io/storybook/?path=/story/form-taginput",
|
|
64
68
|
"summary": "The `Taginput` component provides a tag/chip input field for managing multiple tags.",
|
|
@@ -75,7 +79,7 @@
|
|
|
75
79
|
"name": "label",
|
|
76
80
|
"type": "React.ReactNode",
|
|
77
81
|
"default": null,
|
|
78
|
-
"description": "Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here; it then replaces the `aria-label=\"Add tag\"` fallback too. With `data`, 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\".",
|
|
82
|
+
"description": "Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here; it then replaces the `aria-label=\"Add tag\"` fallback (or `labels.input`) too. With `data`, 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
83
|
"required": false,
|
|
80
84
|
"inherited": false,
|
|
81
85
|
"deprecated": false
|
|
@@ -332,6 +336,15 @@
|
|
|
332
336
|
"inherited": false,
|
|
333
337
|
"deprecated": false
|
|
334
338
|
},
|
|
339
|
+
{
|
|
340
|
+
"name": "labels",
|
|
341
|
+
"type": "{ input?: string; suggestions?: string }",
|
|
342
|
+
"default": null,
|
|
343
|
+
"description": "The accessible names it gives its parts, in your app's language. A `LocaleProvider` doesn't change them.",
|
|
344
|
+
"required": false,
|
|
345
|
+
"inherited": false,
|
|
346
|
+
"deprecated": false
|
|
347
|
+
},
|
|
335
348
|
{
|
|
336
349
|
"name": "icon",
|
|
337
350
|
"type": "string",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "States",
|
|
26
|
-
"code": "<>\n <TextArea label=\"Normal\" placeholder=\"Normal textarea\" />\n <TextArea label=\"Hover\" isHovered placeholder=\"Hovered textarea\" />\n <TextArea label=\"Focus\" isFocused placeholder=\"Focused textarea\" />\n <TextArea
|
|
26
|
+
"code": "<>\n <TextArea label=\"Normal\" placeholder=\"Normal textarea\" />\n <TextArea label=\"Hover\" isHovered placeholder=\"Hovered textarea\" />\n <TextArea label=\"Focus\" isFocused placeholder=\"Focused textarea\" />\n <TextArea\n label=\"Loading\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading textarea\"\n />\n</>"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Loading States by Size",
|
|
30
|
-
"code": "<>\n <TextArea\n label=\"Loading Small\"\n size=\"small\"\n controlSize=\"small\"\n isLoading\n placeholder=\"Small loading textarea\"\n />\n <TextArea\n label=\"Loading Normal\"\n isLoading\n placeholder=\"Normal loading textarea\"\n />\n <TextArea\n label=\"Loading Medium\"\n size=\"medium\"\n controlSize=\"medium\"\n isLoading\n placeholder=\"Medium loading textarea\"\n />\n <TextArea\n label=\"Loading Large\"\n size=\"large\"\n controlSize=\"large\"\n isLoading\n placeholder=\"Large loading textarea\"\n />\n</>"
|
|
30
|
+
"code": "<>\n <TextArea\n label=\"Loading Small\"\n size=\"small\"\n controlSize=\"small\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Small loading textarea\"\n />\n <TextArea\n label=\"Loading Normal\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Normal loading textarea\"\n />\n <TextArea\n label=\"Loading Medium\"\n size=\"medium\"\n controlSize=\"medium\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Medium loading textarea\"\n />\n <TextArea\n label=\"Loading Large\"\n size=\"large\"\n controlSize=\"large\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Large loading textarea\"\n />\n</>"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Disabled & Read Only",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"name": "isLoading",
|
|
108
108
|
"type": "boolean",
|
|
109
109
|
"default": "false",
|
|
110
|
-
"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).",
|
|
110
|
+
"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 is only drawn, so a screen reader hears nothing of it. Say that the field is loading in its `message` as well, such as `message=\"Loading…\"`, which describes the textarea, so a screen reader reads it 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.",
|
|
111
111
|
"required": false,
|
|
112
112
|
"inherited": false,
|
|
113
113
|
"deprecated": false
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Time\"\n labelProps={{ htmlFor: 'time-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"clock\">\n <TimeInput id=\"time-field-control\" placeholder=\"HH:MM\" />\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.\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 wheels inside keep their own names.\n- Each spinner column has `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the column 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 spinbutton columns rather than a toggle button. Its `aria-valuetext` is `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; `↑`, `PageUp` and `End` move it to PM, and `↓`, `PageDown` and `Home` move it to AM. It stops at either end instead of wrapping around. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- A `readOnly` inline picker puts `aria-readonly=\"true\"` on each spinbutton and keeps them in the tab order.\n- A `disabled` inline picker puts `aria-disabled=\"true\"` on each spinbutton and takes them out of the tab order.\n- Honors `prefers-reduced-motion`.\n- On a right-to-left page the launcher sits at the end of the line and the clock icon at the start. The wheels keep `dir=\"ltr\"`, so hours stay to the left of minutes.\n- A panel at a corner that would run past the left or right edge of the screen keeps its\n corner and moves sideways just far enough to fit, or, wider than the screen, to the edge its\n text starts from. On a narrow screen the panel in place is a sheet across the screen\n instead, which fits as it is.\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 `TimeInputBase` 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.\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 wheels inside keep their own names.\n- Each spinner column has `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the column 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 spinbutton columns rather than a toggle button. Its `aria-valuetext` is `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; `↑`, `PageUp` and `End` move it to PM, and `↓`, `PageDown` and `Home` move it to AM. It stops at either end instead of wrapping around. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- A `readOnly` inline picker puts `aria-readonly=\"true\"` on each spinbutton and keeps them in the tab order.\n- A `disabled` inline picker puts `aria-disabled=\"true\"` on each spinbutton and takes them out of the tab order.\n- In forced colors (Windows' contrast themes), the band behind the picked values is replaced, so bestax's styles draw it in the system's highlight color there, and the focus ring inside it in the color made to read on it. The values keep the system's text color, so each reads on the band and off it as the wheel turns. When the picker is disabled, the band and the values take the system's color for a disabled control, at full opacity, as a value the picker blocks does.\n- Honors `prefers-reduced-motion`.\n- On a right-to-left page the launcher sits at the end of the line and the clock icon at the start. The wheels keep `dir=\"ltr\"`, so hours stay to the left of minutes.\n- A panel at a corner that would run past the left or right edge of the screen keeps its\n corner and moves sideways just far enough to fit, or, wider than the screen, to the edge its\n text starts from. On a narrow screen the panel in place is a sheet across the screen\n instead, which fits as it is.\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 `TimeInputBase` 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.",
|
|
182
182
|
"related": ["DateInput", "DateTimeInput", "Input"],
|
|
183
183
|
"storybook": "https://bestax.io/storybook/?path=/story/form-timeinput",
|
|
184
184
|
"summary": "The `TimeInput` component is a form input that opens a popover spinner for time-of-day selection.",
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
"name": "color",
|
|
556
556
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
557
557
|
"default": null,
|
|
558
|
-
"description": "Bulma color modifier for the input, also carried by the wheels, where it colors the selection band. A focused wheel's keyboard focus ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, the wheels use `--bulma-timeinput-wheel-selected-bg`, which defaults to `primary`.",
|
|
558
|
+
"description": "Bulma color modifier for the input, also carried by the wheels, where it colors the selection band. A focused wheel's keyboard focus ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, the wheels use `--bulma-timeinput-wheel-selected-bg`, which defaults to `primary`. Forced colors (Windows' contrast themes) replaces the band, so there it's drawn in the system's highlight color instead, with the ring in the color made to read on it, or in its color for a disabled control while the picker is disabled, whatever the color, which needs bestax's CSS.",
|
|
559
559
|
"required": false,
|
|
560
560
|
"inherited": true,
|
|
561
561
|
"deprecated": false
|
|
@@ -927,7 +927,7 @@
|
|
|
927
927
|
"name": "color",
|
|
928
928
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
929
929
|
"default": null,
|
|
930
|
-
"description": "Bulma color modifier for the input, also carried by the wheels, where it colors the selection band. A focused wheel's keyboard focus ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, the wheels use `--bulma-timeinput-wheel-selected-bg`, which defaults to `primary`.",
|
|
930
|
+
"description": "Bulma color modifier for the input, also carried by the wheels, where it colors the selection band. A focused wheel's keyboard focus ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, the wheels use `--bulma-timeinput-wheel-selected-bg`, which defaults to `primary`. Forced colors (Windows' contrast themes) replaces the band, so there it's drawn in the system's highlight color instead, with the ring in the color made to read on it, or in its color for a disabled control while the picker is disabled, whatever the color, which needs bestax's CSS.",
|
|
931
931
|
"required": false,
|
|
932
932
|
"inherited": false,
|
|
933
933
|
"deprecated": false
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"code": "<Buttons>\n <ToggleButton isDisabled>Show archived</ToggleButton>\n <ToggleButton isDisabled defaultPressed>\n Show archived\n </ToggleButton>\n</Buttons>"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
|
-
"accessibility": "`ToggleButton` follows the toggle button in the\n[APG button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/):\n\n- **Role and state:** it's a native `<button>` with `aria-pressed` set to `\"true\"` or `\"false\"`\n from the first render, server markup included, so it's announced as a toggle button, pressed or\n not pressed. It's never `\"mixed\"`.\n- **Keyboard:** <kbd>Enter</kbd> and <kbd>Space</kbd> toggle it, as on any button, and focus stays\n on it.\n- **Loading:** while `isLoading` is set, it carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`,\n so a screen reader can tell it won't respond, and keys hold it still the same as the pointer\n does. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would, and\n shows Bulma's focus outline while it has keyboard focus, pressed or not.\n- **The label stays put:** APG says \"it is critical the label on a toggle does not change when its\n state changes.\" Mute stays \"Mute\". An icon can change, but the `aria-label` doesn't. A label that\n changes, \"Play\" and then \"Pause\", belongs on a plain `Button` with no `aria-pressed`. Nothing can\n check this at runtime, so it's yours to keep.\n- **Icon-only toggles** need an `aria-label`, as on `Button`.\n- **On is easy to see:** the default `link` fill turns a light button solid blue, and a dark one\n bright in dark mode, so it's a change in lightness and not only in hue. `color` leaves out the\n fills that wouldn't be: `white`, `light`, `dark` and `black` each match a plain button's\n lightness in one theme or the other. That's also why the pressed look isn't\n `Button`'s `isActive` shade:\n [WCAG's own example](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) of a\n button marked only by a darker shade of its color \"would not pass Use of color\".\n- **Forced colors:** Windows' contrast themes replace the fill, so bestax's styles draw a pressed\n toggle in the system's highlight colors there, whatever its `color`, and a disabled pressed one\n in the system's color for a disabled control, filled. While it loads it takes the
|
|
57
|
+
"accessibility": "`ToggleButton` follows the toggle button in the\n[APG button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/):\n\n- **Role and state:** it's a native `<button>` with `aria-pressed` set to `\"true\"` or `\"false\"`\n from the first render, server markup included, so it's announced as a toggle button, pressed or\n not pressed. It's never `\"mixed\"`.\n- **Keyboard:** <kbd>Enter</kbd> and <kbd>Space</kbd> toggle it, as on any button, and focus stays\n on it.\n- **Loading:** while `isLoading` is set, it carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`,\n so a screen reader can tell it won't respond, and keys hold it still the same as the pointer\n does. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would, and\n shows Bulma's focus outline while it has keyboard focus, pressed or not.\n- **The label stays put:** APG says \"it is critical the label on a toggle does not change when its\n state changes.\" Mute stays \"Mute\". An icon can change, but the `aria-label` doesn't. A label that\n changes, \"Play\" and then \"Pause\", belongs on a plain `Button` with no `aria-pressed`. Nothing can\n check this at runtime, so it's yours to keep.\n- **Icon-only toggles** need an `aria-label`, as on `Button`.\n- **On is easy to see:** the default `link` fill turns a light button solid blue, and a dark one\n bright in dark mode, so it's a change in lightness and not only in hue. `color` leaves out the\n fills that wouldn't be: `white`, `light`, `dark` and `black` each match a plain button's\n lightness in one theme or the other. That's also why the pressed look isn't\n `Button`'s `isActive` shade:\n [WCAG's own example](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) of a\n button marked only by a darker shade of its color \"would not pass Use of color\".\n- **Forced colors:** Windows' contrast themes replace the fill, so bestax's styles draw a pressed\n toggle in the system's highlight colors there, whatever its `color`, and a disabled pressed one\n in the system's color for a disabled control, filled. A disabled one that isn't pressed is\n drawn in that color at full strength, as any disabled `Button` is. While it loads it takes the\n look of any loading button there, pressed or not, and the highlight comes back when it's done.\n- **A set has a name:** give the `Buttons` around a set of toggles `role=\"group\"` and an\n `aria-label`.\n- **One choice from several** is a radio group, not a set of toggles, so it's\n `SegmentedControl`, or `Radios` when the choice is sent with a form.",
|
|
58
58
|
"related": [
|
|
59
59
|
"Button",
|
|
60
60
|
"Buttons",
|
|
@@ -236,7 +236,8 @@ A `range` `Slider` points the `for` at its low thumb and starts both thumbs' nam
|
|
|
236
236
|
leave it off when a label already names the Slider. Those thumbs and an `Autocomplete`'s, a
|
|
237
237
|
`Combobox`'s or a `Taginput`'s list point `aria-labelledby` at the label's `id`, which a label
|
|
238
238
|
wired by hand has only when you pass one, `labelProps={{ htmlFor, id }}`; without it they keep their
|
|
239
|
-
fallback names ("Minimum value"/"Maximum value", "Suggestions"
|
|
239
|
+
fallback names ("Minimum value"/"Maximum value", "Suggestions", which an `Autocomplete`'s or a
|
|
240
|
+
`Taginput`'s `labels.suggestions` gives in your language). A `<label htmlFor>` you put in
|
|
240
241
|
`Field.Label` yourself (`references/patterns.md`) names its control through the `for` alone, so
|
|
241
242
|
label a row holding either with the `Field`'s `label` prop. An `aria-label` or `aria-labelledby`
|
|
242
243
|
you give a group wins over any label, and a `Checkbox`, `Radio` or `Switch` takes nothing from a
|
|
@@ -333,6 +334,11 @@ Rules of thumb:
|
|
|
333
334
|
form the identifier is `username`, even when it's an email, beside a `PasswordInput`, which
|
|
334
335
|
sets `current-password` itself. A form with two addresses puts `shipping` or `billing` in front
|
|
335
336
|
of each token, as the Fieldset above does.
|
|
337
|
+
- A loading spinner (`isLoading`) is only drawn, so a screen reader hears nothing of it. While a
|
|
338
|
+
field loads, say so in its `message` too (`message="Loading countries…"`), or, on a field with
|
|
339
|
+
no `message` of its own, in text tied to it with `aria-describedby`: either is read when the
|
|
340
|
+
field takes focus. A load that starts while the user is in the field, such as a search as they
|
|
341
|
+
type, isn't reliably heard without a live region, such as a `role="status"` element.
|
|
336
342
|
- Want a different validation library? Wire it up yourself — pass its `value`/`onChange`/error
|
|
337
343
|
string into these props. bestax does not prescribe one.
|
|
338
344
|
- For grouped controls, render the `<p class="help">` via the `message` prop of the convenience
|
|
@@ -175,7 +175,7 @@ them with no wiring.
|
|
|
175
175
|
|
|
176
176
|
| Component | Key props |
|
|
177
177
|
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
178
|
-
| `Autocomplete` | `data` (`string[]` or item objects), `value`, `onInput(value)` for typing, `onSelect(item)` for picks, `clearable` (the clear button hides while `loading`, or a loading `Control` around it, puts a spinner at the same edge; `labels.clear` names it in your language), `openOnFocus`, `loading`.
|
|
178
|
+
| `Autocomplete` | `data` (`string[]` or item objects), `value`, `onInput(value)` for typing, `onSelect(item)` for picks, `clearable` (the clear button hides while `loading`, or a loading `Control` around it, puts a spinner at the same edge; `labels.clear` names it in your language), `labels.suggestions` (names the list in your language when no label with an id does), `openOnFocus`, `loading`. |
|
|
179
179
|
| `Combobox` | Either way: `multiple`, `keepFirst`, `inline`, `size`, `position` (`'auto'` keeps the list in the viewport), `appendToBody` (inside a `Modal`, `Dialog` or `Command.Dialog` the list goes into the dialog), `open`/`defaultOpen`/`onOpenChange`, `onSelect(value)` and the Field props. Given `data` (strings or `{ value, label?, disabled?, group? }`): `value`/`defaultValue`/`onChange` (`string \| null`, or `string[]` with `multiple`, shown as tags), `placeholder`, `name`, `empty`, `itemTemplate`, and `disabled`, `required`, `form`, `id`, `aria-label`/`aria-labelledby` for the field; leaving the field empty clears one value. From parts: `.Input` (an `Input`, with `size` and the Field props on the root), `.Menu`, `.List`, `.Item` (`value`, `checked`, `disabled`), `.Group` (`label`), `.Empty`; you filter, keep the value and set the field's text in `onSelect`. |
|
|
180
180
|
| `TreeSelect` | `data` (nodes: `value`, `label`, `disabled`, `icon`, `children`, `hasChildren`, `isLoading`, `loadError`, `onRetry`), `selectionMode` (`'single'`, `'checkbox'`, `'checkbox-independent'`), `value`/`defaultValue`/`onChange` (`string \| null`, or `string[]` in the checkbox modes, shown as tags), `checkedStrategy` (`'child'` leaves, `'parent'` topmost, `'all'`), `parentsSelectable`, `closeOnSelect`, `searchable` with `query`/`defaultQuery`/`onQueryChange`, `filter(query, item, path)` and `empty`, `expanded`/`defaultExpanded`/`onExpandedChange` (fetch lazy branches here), `open`/`defaultOpen`/`onOpenChange`, `clearable`, `itemTemplate`, `labels` (`choose`, `search`, `clear`, `loading`, `retry`, `loadingAnnouncement`, `loadedAnnouncement`), `name`, `form`, `required`, `disabled`, `color`, `size`, `isRounded`, `position`, `appendToBody` and the Field props. The field is a read-only combobox that opens a dialog; the `ref` is the field's. |
|
|
181
181
|
| `Cascader` | `data` (TreeSelect's nodes), `value`/`defaultValue`/`onChange` (the picked node's `value`, `string \| null`; the field shows its path from `data`, joined with `labels.separator`, `" / "` by default), `parentsSelectable` (leaves only without it), `closeOnSelect` (default `true`), `searchable` with `query`/`defaultQuery`/`onQueryChange`, `filter(query, item, path)` and `empty` (a flat list of matching paths replaces the columns), `expanded`/`defaultExpanded`/`onExpandedChange` (the open path; fetch lazy columns here), `open`/`defaultOpen`/`onOpenChange`, `clearable`, `itemTemplate`, `labels` (`choose`, `search`, `clear`, `separator`, `opens`, `loading`, `retry`, `loadingAnnouncement`, `loadedAnnouncement`), `name`, `form`, `required`, `disabled`, `color`, `size`, `isRounded`, `position`, `appendToBody` and the Field props. The field is a read-only combobox that opens a dialog of one listbox per level; a column opens on a click or Right, never on hover; the `ref` is the field's. |
|
|
@@ -183,7 +183,7 @@ them with no wiring.
|
|
|
183
183
|
| `Numberinput` | `value`/`onChange`, `min`, `max`, `step`, increment/decrement buttons, stepper variant, `labels` (the buttons' names, `increase` and `decrease`, in the page's language), `color`, `size`, `isLoading` (set it here, not on a `Control` around it, whose spinner covers the right-hand button). |
|
|
184
184
|
| `PinInput` | `length` (6), `value`/`defaultValue`/`onChange` (the code as a string), `onComplete(code)` once a change fills the last box, `type` (`'number'` or `'alphanumeric'`), `isMasked`, `name`, `color`, `size`, `isRounded`, `disabled` and the Field props. One input holds the code (`autoComplete="one-time-code"`); a paste replaces it. |
|
|
185
185
|
| `Rate` | `value`/`onChange`, `max`, `precision` (1 / 0.5 / 0.25), `customIcon` or `iconName`, `showScore`/`showText`/`texts`, `disabled`, `labels` (`group`, `star(value)`) for the names a screen reader hears, in your language. |
|
|
186
|
-
| `Taginput` | `value` (array)/`onChange`, autocomplete suggestions, configurable confirm keys, closable tags, `color`, `size
|
|
186
|
+
| `Taginput` | `value` (array)/`onChange`, autocomplete suggestions, configurable confirm keys, closable tags, `color`, `size`; `labels.input` names the input in your language when no label does, and `labels.suggestions` the list when no label with an id does. |
|
|
187
187
|
|
|
188
188
|
## Date / time inputs
|
|
189
189
|
|
|
@@ -447,6 +447,10 @@ in the browser:
|
|
|
447
447
|
a `<label>` or `<div>` `.panel-block` included, as `Panel.Block` with `as` and its contents as
|
|
448
448
|
written. `Panel.CheckboxBlock`, `Panel.InputBlock` and `Panel.ButtonBlock` build the usual
|
|
449
449
|
checkbox, search and button blocks from props, if you would rather write those by hand.
|
|
450
|
+
`Panel.InputBlock` renders its `<input>` as `type="text"` with only a value, a change handler
|
|
451
|
+
and a placeholder, and puts any other attribute on the block, so keep a search field whose input
|
|
452
|
+
has anything more (an `aria-label`, an `id`, a `name`, `type="search"`) as the converted
|
|
453
|
+
`Panel.Block` and its contents.
|
|
450
454
|
|
|
451
455
|
## A class Bulma v1 removed: `legacy:<class>`
|
|
452
456
|
|
|
@@ -347,10 +347,12 @@ Notes:
|
|
|
347
347
|
extras partial gives those focused buttons an outline, apart from a loading one, which the
|
|
348
348
|
`loader` partial outlines, a pressed `ToggleButton`, a checked `SegmentedControl` segment and any other button with Bulma's `is-selected` the
|
|
349
349
|
system's highlight colors in forced colors, where the fill that marks them is replaced, a colored
|
|
350
|
-
button a 1px border in forced colors,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
350
|
+
button a 1px border in forced colors, a disabled button full strength in forced colors, where
|
|
351
|
+
Bulma's disabled opacity would fade the system's color for it, and an outlined button the
|
|
352
|
+
lightness Bulma picks for its color's text on the page where that's lighter, so a dark color
|
|
353
|
+
reads on the dark scheme, so include it (`as bestax-button`) in any build that loads Bulma's
|
|
354
|
+
button module. Its rules win over Bulma's either way, so the order of the `@use` lines does not
|
|
355
|
+
matter.
|
|
354
356
|
- `Box` is stock Bulma (`bulma/sass/elements/box`), which draws a box's edge as a shadow with no
|
|
355
357
|
border. Forced colors (Windows' contrast themes) drops every shadow and paints the box in the
|
|
356
358
|
page's own color, so its edge vanishes there. The `box` extras partial draws it back as an
|
|
@@ -358,8 +360,9 @@ Notes:
|
|
|
358
360
|
any build that shows a `Box`. Its rule wins over Bulma's either way, so the order of the `@use`
|
|
359
361
|
lines does not matter.
|
|
360
362
|
- `Card` is stock Bulma (`bulma/sass/components/card`), which draws a card's edge as a shadow
|
|
361
|
-
the same way, so it vanishes in forced colors too
|
|
362
|
-
an outline
|
|
363
|
+
the same way, so it vanishes in forced colors too, and the line under its header with it. The
|
|
364
|
+
`card` extras partial draws the edge back as an outline and the header's line as a line, in the
|
|
365
|
+
system's text color, so include it (`as bestax-card`) next to Bulma's module
|
|
363
366
|
in any build that shows a `Card`. Its rule wins over Bulma's either way, so the order of the
|
|
364
367
|
`@use` lines does not matter.
|
|
365
368
|
- `Divider` renders an `<hr>`, which Bulma draws in its base (`bulma/sass/base`) as a background
|
|
@@ -495,7 +498,7 @@ Scaffolded with an icon library, the starter also needs `bulma/sass/elements/ico
|
|
|
495
498
|
@use 'bulma/sass/helpers/flexbox'; // flexGrow
|
|
496
499
|
@use 'bulma/sass/helpers/typography'; // textAlign
|
|
497
500
|
|
|
498
|
-
@use '@allxsmith/bestax-bulma/scss/components/card' as bestax-card; // the edge in forced colors
|
|
501
|
+
@use '@allxsmith/bestax-bulma/scss/components/card' as bestax-card; // the edge and header line in forced colors
|
|
499
502
|
@use '@allxsmith/bestax-bulma/scss/elements/box' as bestax-box; // the edge in forced colors
|
|
500
503
|
@use '@allxsmith/bestax-bulma/scss/elements/button' as bestax-button; // focus outline and edge in forced colors
|
|
501
504
|
@use '@allxsmith/bestax-bulma/scss/elements/delete' as bestax-delete; // the close button in forced colors
|
|
@@ -232,6 +232,8 @@ lone class loses to and `style` does not. Each component's API page lists its va
|
|
|
232
232
|
**CSS & Sass Variables** and says where Bulma declares them; the extras below follow the same
|
|
233
233
|
rule. In forced colors a colored button's `--bulma-button-border-width` is `1px`, so it keeps an
|
|
234
234
|
edge when the theme replaces its fill, and an outlined button or a `text` one keeps its own.
|
|
235
|
+
In forced colors bestax's CSS sets `--bulma-button-disabled-opacity` to `1` on each button, so what
|
|
236
|
+
Bulma dims with it draws at full strength there.
|
|
235
237
|
|
|
236
238
|
## Shadow — override the upstream token, not the derived one
|
|
237
239
|
|
|
@@ -1223,6 +1225,12 @@ variable on such a tag through `style`. Bulma's own `--bulma-tag-*` variables se
|
|
|
1223
1225
|
`--bulma-timeinput-wheel-item-height` is registered but has no effect: the component sets each
|
|
1224
1226
|
wheel item's height inline.
|
|
1225
1227
|
|
|
1228
|
+
In forced colors (Windows' contrast themes) the band is the system's highlight color, with the
|
|
1229
|
+
focus ring in the color made to read on it, whatever `--bulma-timeinput-wheel-selected-bg` and
|
|
1230
|
+
`--bulma-timeinput-wheel-selected-color` say, and the values take the system's text color. On a
|
|
1231
|
+
disabled picker the band and the values take its color for a disabled control, and so does a
|
|
1232
|
+
value the picker blocks. The wheels in `DateTimeInput` are these.
|
|
1233
|
+
|
|
1226
1234
|
### Timeline
|
|
1227
1235
|
|
|
1228
1236
|
Declared on the root, `.timeline`. The states and the color classes set
|
|
@@ -74,7 +74,7 @@ Shades (`colorShade` / `backgroundColorShade`): `00, 05, 10, … 95, invert, lig
|
|
|
74
74
|
| `DataTable` | none on the root (its table, checkboxes and pager take their own) | — | the toolbar gap `--bulma-data-table-gap`, the sort button `--bulma-data-table-sort-*`; selected rows are `--bulma-table-row-active-*` |
|
|
75
75
|
| `DateInput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` | also `isRounded`; in forced colors the picked date is the system's highlight colors, whatever the `color` |
|
|
76
76
|
| `DateRangeInput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` | also `isRounded`; `color` also fills the calendar range, which in forced colors is the system's highlight colors whatever the `color` |
|
|
77
|
-
| `DateTimeInput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` | also `isRounded`; in forced colors the picked date
|
|
77
|
+
| `DateTimeInput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` | also `isRounded`; in forced colors the picked date takes the system's highlight colors and the wheels' band its highlight color, whatever the `color` |
|
|
78
78
|
| `DescriptionList` | — (no `color`: `textColor` on the root colors the values; the labels are `--bulma-description-list-label-color`) | — (sized in `em` from the text around it; size it with `textSize`) | also `hasDividers`; one look, no `variant`; retheme through `--bulma-description-list-*` |
|
|
79
79
|
| `Dropzone` | `primary \| link \| info \| success \| warning \| danger \| black \| dark \| light \| white` (the zone, as `File` takes them) | `small \| medium \| large` | the zone is Bulma's `.file` (`--bulma-file-*`); dashed border, drag states and file list on `--bulma-dropzone-*` |
|
|
80
80
|
| `EmptyState` | `primary \| link \| info \| success \| warning \| danger` (the indicator circle and its icon only, never the text) | `small \| normal \| medium \| large` | also `variant`: `light` (default) \| `filled`; neutral with no `color`; tint text with `textColor`; `--bulma-empty-state-*` |
|
|
@@ -113,7 +113,7 @@ Shades (`colorShade` / `backgroundColorShade`): `00, 05, 10, … 95, invert, lig
|
|
|
113
113
|
| `Tabs` | `primary \| link \| info \| success \| warning \| danger \| black \| dark \| light \| white` | `small \| medium \| large` | **entire `color` prop deprecated** (no CSS ships; dev-warn; removal next major) |
|
|
114
114
|
| `Taginput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` | also `tagColor` (the 6 + `dark \| light`) for the tags |
|
|
115
115
|
| `TextArea` | `primary \| link \| info \| success \| warning \| danger \| black \| dark \| light \| white` | `small \| medium \| large` | — |
|
|
116
|
-
| `TimeInput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` |
|
|
116
|
+
| `TimeInput` | `primary \| link \| info \| success \| warning \| danger` | `small \| medium \| large` | in forced colors the wheels' band is the system's highlight color, or its disabled color on a disabled picker, whatever the `color` |
|
|
117
117
|
| `Timeline` | `primary \| link \| info \| success \| warning \| danger` (the markers and the progress, never the text) | no `size` (sized in `em`; size it with `textSize`) | `Timeline.Item` takes `color` too, over the root's; with no `color`, neutral and progress in `link`, or on a colored Hero its text color; retheme through `--bulma-timeline-*` |
|
|
118
118
|
| `ToggleButton` | `primary \| link \| info \| success \| warning \| danger` | `small \| normal \| medium \| large` | fills only while pressed (default `link`); **no `isLight`/`isOutlined`/`isInverted`/`textColor`/`bgColor`** |
|
|
119
119
|
| `Tooltip` | `primary \| link \| info \| success \| warning \| danger \| dark \| light` | `small \| medium \| large` | — |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-mcp",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.76",
|
|
4
4
|
"mcpName": "io.github.allxsmith/bestax-mcp",
|
|
5
5
|
"description": "MCP server for @allxsmith/bestax-bulma — component props, examples, CSS variables and agent skills, served offline from a version-pinned index",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
44
44
|
"zod": "^4.6.7",
|
|
45
|
-
"@allxsmith/bestax-bulma": "^5.
|
|
45
|
+
"@allxsmith/bestax-bulma": "^5.78.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^26.6.6",
|