bestax-mcp 1.18.86 → 1.18.88
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 +1 -1
- package/data/components/Cascader.json +1 -1
- package/data/components/Combobox.json +1 -1
- package/data/components/Delete.json +4 -4
- package/data/components/Dropzone.json +1 -1
- package/data/components/Icon.json +2 -2
- package/data/components/IconText.json +1 -1
- package/data/components/Message.json +1 -1
- package/data/components/Modal.json +1 -1
- package/data/components/Navbar.json +1 -1
- package/data/components/Notification.json +1 -1
- package/data/components/Panel.json +1 -1
- package/data/components/Sidebar.json +2 -2
- package/data/components/Taginput.json +1 -1
- package/data/components/Toast.json +1 -1
- package/data/components/Tour.json +1 -1
- package/data/components/TreeSelect.json +1 -1
- package/data/skills/bestax-migrate/SKILL.md +7 -2
- package/data/skills/bestax-optimize/references/modular-build.md +11 -8
- package/package.json +2 -2
package/data/catalog.json
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"code": "<LocaleProvider locale=\"ar\" dir=\"rtl\">\n <Cascader\n label=\"المدينة\"\n defaultValue=\"berlin\"\n clearable\n data={[\n {\n value: 'germany',\n label: 'ألمانيا',\n children: [{ value: 'berlin', label: 'برلين' }],\n },\n { value: 'oceania', label: 'أوقيانوسيا' },\n ]}\n />\n</LocaleProvider>"
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
|
-
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' and TreeSelect's are:\n `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the\n panel is open, named by its `label`. It's read-only, and its value is the picked node's path.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked node, its path open, or with nothing picked onto the first\n column's item on an open path, or its first enabled item, so a `defaultExpanded` path stays\n open. It holds\n focus while it's open, as the date pickers' panel does: Tab and Shift+Tab move between the\n search box and the columns, and wrap. Escape and Alt+Up close it and put focus back on the\n field, and so does a pick. A press outside closes it and leaves focus where the press put it.\n- **Each column** is a `listbox` with one tab stop and real focus on its `option`s. The first is\n named as the panel is, and each one after it by the label of the item that opened it. Up, Down,\n Home, End and type-ahead move within a column, and type-ahead starts over in each column it\n comes into and after Up, Down, Home or End. Space joins a search under way when an item starts with what's been typed and a\n space, so \"new y\" reaches \"New York\", and otherwise picks or opens. Right opens the next column\n and moves into it, Left goes back, and the two swap on a right-to-left page. Disabled items are\n reachable and `aria-disabled`, and Right moves into a column at its item on the open path even\n when that one is disabled.\n- **The picked node's path is `aria-selected`,** and drawn filled, its items `is-checked` as\n Combobox's picked items are. The path you've opened, which follows focus, is drawn with a lighter\n tint, its items `is-active` as Combobox's highlighted item is, and isn't announced as selected, so moving around never says an item is picked when it isn't. A disabled\n node on the picked path is selected but not filled, so it stays readable. In forced colors the\n picked path takes the system's highlight and the open path an outline. Right opens the focused\n item and nothing else.\n- **An item that opens a column** is described by \"Opens a column\", or `labels.opens`, since an\n option has no way of its own to say it has items under it. Its chevron is hidden.\n- **A column that's loading** ends in a row that says so, and a failed load's row is named by its\n message and its Retry, which Enter, Space or a click run. The live region says when a column\n starts loading and when it's loaded, as TreeView's does.\n- **The search box** is named \"Search\", or `labels.search`, and its results are a listbox of the\n paths that match. Enter picks the highlighted path unless it's disabled, and with none\n highlighted it does nothing, so it never submits the form around the field. When nothing matches, `empty` is said once\n through a polite status region, not again on every key.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the columns keep their edges in system colors, the\n path through the columns keeps the system's highlight, and the chevrons are borders, so they\n stay.\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 field through `aria-describedby`, after any ids you pass there, so a screen reader reads it when the field takes focus.\n- `aria-invalid` and `aria-errormessage` go on the field, while the other attributes you pass go on the wrapper, so a screen reader hears the field is invalid when it takes focus.",
|
|
45
|
+
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' and TreeSelect's are:\n `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the\n panel is open, named by its `label`. It's read-only, and its value is the picked node's path.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The clear button** is a [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) named \"Clear\", or\n `labels.clear`. Its target is a box at least 24px square around the circle, over the field, so\n a press just beside a small circle clears the field rather than opening the panel.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked node, its path open, or with nothing picked onto the first\n column's item on an open path, or its first enabled item, so a `defaultExpanded` path stays\n open. It holds\n focus while it's open, as the date pickers' panel does: Tab and Shift+Tab move between the\n search box and the columns, and wrap. Escape and Alt+Up close it and put focus back on the\n field, and so does a pick. A press outside closes it and leaves focus where the press put it.\n- **Each column** is a `listbox` with one tab stop and real focus on its `option`s. The first is\n named as the panel is, and each one after it by the label of the item that opened it. Up, Down,\n Home, End and type-ahead move within a column, and type-ahead starts over in each column it\n comes into and after Up, Down, Home or End. Space joins a search under way when an item starts with what's been typed and a\n space, so \"new y\" reaches \"New York\", and otherwise picks or opens. Right opens the next column\n and moves into it, Left goes back, and the two swap on a right-to-left page. Disabled items are\n reachable and `aria-disabled`, and Right moves into a column at its item on the open path even\n when that one is disabled.\n- **The picked node's path is `aria-selected`,** and drawn filled, its items `is-checked` as\n Combobox's picked items are. The path you've opened, which follows focus, is drawn with a lighter\n tint, its items `is-active` as Combobox's highlighted item is, and isn't announced as selected, so moving around never says an item is picked when it isn't. A disabled\n node on the picked path is selected but not filled, so it stays readable. In forced colors the\n picked path takes the system's highlight and the open path an outline. Right opens the focused\n item and nothing else.\n- **An item that opens a column** is described by \"Opens a column\", or `labels.opens`, since an\n option has no way of its own to say it has items under it. Its chevron is hidden.\n- **A column that's loading** ends in a row that says so, and a failed load's row is named by its\n message and its Retry, which Enter, Space or a click run. The live region says when a column\n starts loading and when it's loaded, as TreeView's does.\n- **The search box** is named \"Search\", or `labels.search`, and its results are a listbox of the\n paths that match. Enter picks the highlighted path unless it's disabled, and with none\n highlighted it does nothing, so it never submits the form around the field. When nothing matches, `empty` is said once\n through a polite status region, not again on every key.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the columns keep their edges in system colors, the\n path through the columns keeps the system's highlight, and the chevrons are borders, so they\n stay.\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 field through `aria-describedby`, after any ids you pass there, so a screen reader reads it when the field takes focus.\n- `aria-invalid` and `aria-errormessage` go on the field, while the other attributes you pass go on the wrapper, so a screen reader hears the field is invalid when it takes focus.",
|
|
46
46
|
"related": [
|
|
47
47
|
"Combobox",
|
|
48
48
|
"Select",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"code": "function example() {\n const drinks: Record<\n string,\n { value: string; label: string; disabled?: boolean }[]\n > = {\n Hot: [\n { value: 'coffee', label: 'Coffee' },\n { value: 'tea', label: 'Tea' },\n ],\n Cold: [\n { value: 'lemonade', label: 'Lemonade' },\n { value: 'iced-tea', label: 'Iced tea' },\n { value: 'smoothie', label: 'Smoothie (sold out)', disabled: true },\n ],\n };\n const [query, setQuery] = useState('');\n const [value, setValue] = useState('tea');\n const picked = Object.values(drinks)\n .flat()\n .find(i => i.value === value);\n const term = query.trim().toLowerCase();\n const groups = Object.entries(drinks)\n .map(([label, items]) => ({\n label,\n items: items.filter(i => i.label.toLowerCase().includes(term)),\n }))\n .filter(g => g.items.length > 0);\n\n return (\n <form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"Drink\"\n message={`Your drink: ${picked?.label}`}\n onSelect={next => {\n setValue(next);\n setQuery('');\n }}\n >\n <Combobox.Input\n iconLeftName=\"mug-hot\"\n placeholder=\"Type to filter\"\n value={query}\n onChange={e => setQuery(e.target.value)}\n />\n <Combobox.Menu>\n {groups.length > 0 ? (\n <Combobox.List>\n {groups.map(g => (\n <Combobox.Group key={g.label} label={g.label}>\n {g.items.map(i => (\n <Combobox.Item\n key={i.value}\n value={i.value}\n checked={i.value === value}\n disabled={i.disabled}\n >\n {i.label}\n </Combobox.Item>\n ))}\n </Combobox.Group>\n ))}\n </Combobox.List>\n ) : (\n <Combobox.Empty>No drinks match</Combobox.Empty>\n )}\n </Combobox.Menu>\n </Combobox>\n <Select label=\"Size\">\n <option>Small</option>\n <option>Medium</option>\n <option>Large</option>\n </Select>\n <Input label=\"Name for the cup\" />\n <Button type=\"submit\" color=\"primary\">\n Order\n </Button>\n </form>\n );\n}"
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
"accessibility": "- **The roles:** the field is `role=\"combobox\"` with `aria-autocomplete=\"list\"` and\n `aria-haspopup=\"listbox\"`. The list is a `listbox` of `option`s, and a group is a `group` named by\n its heading. This is the ARIA 1.2 combobox the ARIA Authoring Practices describe.\n- **Focus stays in the field:** the highlighted item is the field's `aria-activedescendant`.\n When a key or the list opening moves the highlight, the item is scrolled into view, since a\n browser only scrolls to what has focus. The pointer moves it without scrolling, since the pointer\n is already on that item. A click on an item keeps focus in the field too.\n- **`aria-expanded`** is `true` while a list with an item in it is on screen, and\n `aria-controls` points at the list then. While the menu shows just the empty message, the\n field says it's collapsed, and so does the server markup for a list rendered with\n `appendToBody`, which shows only once the page has hydrated.\n- **The list's name** comes from the label that names the field: the Combobox's `label`, or an\n outer `Field`'s. An `aria-label` or `aria-labelledby` you put on `Combobox.List` wins, and\n with none of these the list is named \"Suggestions\". Given `data`, an `aria-label` or\n `aria-labelledby` on the Combobox names the field and the list, so it needs no `label`.\n- **`aria-selected`, with one value,** is on the highlighted item and nothing else, the way the\n Authoring Practices' combobox examples do it. The value shows as a check mark, which doesn't rely\n on color, and the list opens with the highlight on it. Several libraries put `aria-selected` on\n the chosen item instead.\n- **With `multiple`,** the list is `aria-multiselectable`, and each item's `aria-selected` is its\n `checked`.\n- **Disabled items** are `aria-disabled` and stay reachable with the arrows, the Authoring\n Practices' advice for listbox options, so a screen reader user finds them. They're never picked\n or `aria-selected`, and the opening highlight and `keepFirst` pass over them.\n- **The empty message** sits beside the list, not in it, so it isn't counted as an item. When\n your typing brings it on screen, its text is announced through a polite status region that's in\n the page from the start, once each time the matches run out. Opening the list with it already\n there, or emptying the field, announces nothing. While `isLoading` is on, or a loading `Control`\n is around the Combobox, the announcement waits and is made once loading ends. In a menu,\n keep it to text: Tab closes the list before a keyboard user can reach a link or a button in it.\n An `inline` list stays on screen, so a link or a button beside it is in the Tab order.\n- **Tags,** with `multiple` and `data`: the field's `aria-describedby` points at the tags' labels,\n since its own text is the search, so focusing it reads the picks. Each tag's button is named\n \"Remove\" and the item's label, or `ariaCloseLabel` with the label as its description, and\n taking a tag off puts focus back in the field, which then reads the picks that are left.\n- **No counts are announced,** for the reasons in [A Result Count](https://bestax.io/docs/api/form/combobox#a-result-count).\n- **Enter and Escape:** Enter submits the form when nothing is highlighted, and Escape only stops\n at the Combobox when it closed a panel that was on screen.\n- **Forced colors:** in Windows high contrast mode the highlight is drawn as an outline in the\n system's highlight color, a disabled item takes the system's color for disabled text, and the\n check mark and the panel's edge stay visible.\n- A menu 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 field through `aria-describedby`, after any ids you pass to `Combobox.Input` and, with `data` and `multiple`, after the picked tags.\n- With `data`, `aria-invalid` and `aria-errormessage` go on the field, while the Combobox's other attributes go on the wrapper, so a screen reader hears the field is invalid when it takes focus. Built from parts, pass them to `Combobox.Input`.",
|
|
65
|
+
"accessibility": "- **The roles:** the field is `role=\"combobox\"` with `aria-autocomplete=\"list\"` and\n `aria-haspopup=\"listbox\"`. The list is a `listbox` of `option`s, and a group is a `group` named by\n its heading. This is the ARIA 1.2 combobox the ARIA Authoring Practices describe.\n- **Focus stays in the field:** the highlighted item is the field's `aria-activedescendant`.\n When a key or the list opening moves the highlight, the item is scrolled into view, since a\n browser only scrolls to what has focus. The pointer moves it without scrolling, since the pointer\n is already on that item. A click on an item keeps focus in the field too.\n- **`aria-expanded`** is `true` while a list with an item in it is on screen, and\n `aria-controls` points at the list then. While the menu shows just the empty message, the\n field says it's collapsed, and so does the server markup for a list rendered with\n `appendToBody`, which shows only once the page has hydrated.\n- **The list's name** comes from the label that names the field: the Combobox's `label`, or an\n outer `Field`'s. An `aria-label` or `aria-labelledby` you put on `Combobox.List` wins, and\n with none of these the list is named \"Suggestions\". Given `data`, an `aria-label` or\n `aria-labelledby` on the Combobox names the field and the list, so it needs no `label`.\n- **`aria-selected`, with one value,** is on the highlighted item and nothing else, the way the\n Authoring Practices' combobox examples do it. The value shows as a check mark, which doesn't rely\n on color, and the list opens with the highlight on it. Several libraries put `aria-selected` on\n the chosen item instead.\n- **With `multiple`,** the list is `aria-multiselectable`, and each item's `aria-selected` is its\n `checked`.\n- **Disabled items** are `aria-disabled` and stay reachable with the arrows, the Authoring\n Practices' advice for listbox options, so a screen reader user finds them. They're never picked\n or `aria-selected`, and the opening highlight and `keepFirst` pass over them.\n- **The empty message** sits beside the list, not in it, so it isn't counted as an item. When\n your typing brings it on screen, its text is announced through a polite status region that's in\n the page from the start, once each time the matches run out. Opening the list with it already\n there, or emptying the field, announces nothing. While `isLoading` is on, or a loading `Control`\n is around the Combobox, the announcement waits and is made once loading ends. In a menu,\n keep it to text: Tab closes the list before a keyboard user can reach a link or a button in it.\n An `inline` list stays on screen, so a link or a button beside it is in the Tab order.\n- **Tags,** with `multiple` and `data`: the field's `aria-describedby` points at the tags' labels,\n since its own text is the search, so focusing it reads the picks. Each tag's button is named\n \"Remove\" and the item's label, or `ariaCloseLabel` with the label as its description, and\n taking a tag off puts focus back in the field, which then reads the picks that are left. The\n button is a small [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility), with a target at least 24px square around its circle.\n- **No counts are announced,** for the reasons in [A Result Count](https://bestax.io/docs/api/form/combobox#a-result-count).\n- **Enter and Escape:** Enter submits the form when nothing is highlighted, and Escape only stops\n at the Combobox when it closed a panel that was on screen.\n- **Forced colors:** in Windows high contrast mode the highlight is drawn as an outline in the\n system's highlight color, a disabled item takes the system's color for disabled text, and the\n check mark and the panel's edge stay visible.\n- A menu 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 field through `aria-describedby`, after any ids you pass to `Combobox.Input` and, with `data` and `multiple`, after the picked tags.\n- With `data`, `aria-invalid` and `aria-errormessage` go on the field, while the Combobox's other attributes go on the wrapper, so a screen reader hears the field is invalid when it takes focus. Built from parts, pass them to `Combobox.Input`.",
|
|
66
66
|
"related": [
|
|
67
67
|
"Autocomplete",
|
|
68
68
|
"Cascader",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{ "title": "Default Delete", "code": "<Delete />" },
|
|
9
9
|
{
|
|
10
10
|
"title": "Small, Medium, Large",
|
|
11
|
-
"code": "
|
|
11
|
+
"code": "<Group>\n <Delete size=\"small\" />\n <Delete size=\"medium\" />\n <Delete size=\"large\" />\n</Group>"
|
|
12
12
|
},
|
|
13
13
|
{ "title": "Disabled", "code": "<Delete disabled />" },
|
|
14
14
|
{
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"code": "<Message color=\"success\" title=\"Success Message\">\n This is a success message with a delete button in the header.\n</Message>"
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
|
-
"accessibility": "- **ARIA label:** Always set a meaningful `ariaLabel` for screen readers (default is `'Close'`).\n- **Keyboard:** The button is focusable and supports keyboard activation.\n- **Forms:** It renders `type=\"button\"`, so a delete button inside a form doesn't submit it.\n- **Disabled:** Uses both `disabled` and Bulma’s `is-disabled` for proper styling and accessibility.\n- **Forced colors:** Bulma draws the circle and the cross as background colors, which forced colors (Windows' contrast themes) replaces, so the button would vanish there while it still works and takes focus. bestax's styles keep it drawn in the system's button colors, with its focus ring in the system's highlight color, and a disabled one, or one inside a disabled `<fieldset>`, in the system's color for disabled controls. Every close button bestax renders is a
|
|
34
|
+
"accessibility": "- **ARIA label:** Always set a meaningful `ariaLabel` for screen readers (default is `'Close'`).\n- **Keyboard:** The button is focusable and supports keyboard activation.\n- **Forms:** It renders `type=\"button\"`, so a delete button inside a form doesn't submit it.\n- **Disabled:** Uses both `disabled` and Bulma’s `is-disabled` for proper styling and accessibility.\n- **Target size:** Bulma draws the button smaller than WCAG 2.5.8's 24px minimum target size at its default and small sizes. A transparent box inside it, which bestax's styles make at least 24px square and centre on it, takes its presses too, so a press just beside the circle still reaches it, and the circle shows its hover shade there. The circle and the layout around it stay as Bulma draws them. The box reaches past a smaller circle, over whatever sits that close, so give a small one room, as the sizes example above does. The other close and remove buttons bestax draws as a `.delete` have the same box, and so does the [Modal](https://bestax.io/docs/api/components/modal)'s floating close. Under Bulma's own CSS alone the box does nothing. A `<button class=\"delete\">` you write yourself has no box, so render `Delete` instead. A `Delete` given `dangerouslySetInnerHTML` has none either, since React won't render the box beside it.\n- **Forced colors:** Bulma draws the circle and the cross as background colors, which forced colors (Windows' contrast themes) replaces, so the button would vanish there while it still works and takes focus. bestax's styles keep it drawn in the system's button colors, with its focus ring in the system's highlight color, and a disabled one, or one inside a disabled `<fieldset>`, in the system's color for disabled controls. Every close button bestax renders is drawn as a `.delete`, apart from the [Modal](https://bestax.io/docs/api/components/modal)'s floating close, a [Tag](https://bestax.io/docs/api/elements/tag) with `isDelete`, and the [Sidebar](https://bestax.io/docs/api/components/sidebar)'s `Sidebar.Close`, and those keep their crosses in the system's colors too.\n\n:::tip\nFor custom close actions, use the `onClick` prop.\n:::",
|
|
35
35
|
"related": ["Message", "Notification", "Tag", "useBulmaClasses"],
|
|
36
36
|
"storybook": "https://bestax.io/storybook/?path=/story/elements-delete--default",
|
|
37
|
-
"summary": "The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more. It renders `type=\"button\"`, so a delete button inside a form does not submit it.",
|
|
37
|
+
"summary": "The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more. It renders `type=\"button\"`, so a delete button inside a form does not submit it. A transparent box inside it, which bestax's styles make at least 24px square and centre on it, takes its presses too, so a small one still meets WCAG 2.5.8's minimum target size while the circle stays as Bulma draws it. Under Bulma's own CSS alone the box does nothing. The box reaches past a circle smaller than 24px, over whatever sits that close, so leave room around a small one. Given `dangerouslySetInnerHTML`, which React won't render beside children, the button goes without the box.",
|
|
38
38
|
"import": "import { Delete } from '@allxsmith/bestax-bulma';",
|
|
39
39
|
"sourceFile": "bulma-ui/src/elements/Delete.tsx",
|
|
40
40
|
"rootClass": "delete",
|
|
41
41
|
"parts": [
|
|
42
42
|
{
|
|
43
43
|
"path": "Delete",
|
|
44
|
-
"summary": "The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more. It renders `type=\"button\"`, so a delete button inside a form does not submit it.",
|
|
44
|
+
"summary": "The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more. It renders `type=\"button\"`, so a delete button inside a form does not submit it. A transparent box inside it, which bestax's styles make at least 24px square and centre on it, takes its presses too, so a small one still meets WCAG 2.5.8's minimum target size while the circle stays as Bulma draws it. Under Bulma's own CSS alone the box does nothing. The box reaches past a circle smaller than 24px, over whatever sits that close, so leave room around a small one. Given `dangerouslySetInnerHTML`, which React won't render beside children, the button goes without the box.",
|
|
45
45
|
"component": null,
|
|
46
46
|
"props": [
|
|
47
47
|
{
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"code": "<Dropzone label=\"Attachments\" disabled hint=\"Uploads are closed\" />"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
|
-
"accessibility": "- **One control:** the native file input, the zone's one tab stop, named by the zone's text and\n by a `label` through `htmlFor`. The browser reports its state itself (\"No file chosen\", \"2\n files\"), in its own language.\n- **Not drag only:** a click on the zone, or Enter or Space on the input, opens the picker, so\n dropping is never the only way to choose a file (WCAG 2.5.7 and 2.1.1). Dropping needs a pointer\n and a desktop; on phones the picker is the way in.\n- **Descriptions:** the input's `aria-describedby` points at the `hint`, at the refusals while\n there are any, and at the Field `message`, after any ids you pass.\n- **Announcements:** additions (\"report.pdf added\", \"2 files added\"), refusals and removals are\n announced politely through a status region, since a screen reader can't see the list change.\n Nothing is announced while a file is dragged over the zone.\n- **The list:** a `<ul>` with a row per file, each with a real remove button named \"Remove\" and\n the file's name. After a removal, focus moves to the next row's button, the one before, or the\n input. The `<ul>` writes out `role=\"list\"`, its implicit role, which Safari drops once a list's\n bullets are hidden, as Bulma's reset hides them; without it VoiceOver reads the files with no\n count.\n- **Drag states:** the zone's dashed border turns solid while files are dragged over it, so the\n state shows without color, and in forced colors too. Only the files' types can be read during a\n drag, so the refused look shows only when `accept` names no extension and every type is one it\n refuses; the drop's result is what counts.\n- **Forced colors:** the drop target's border takes the system highlight color, and the remove\n buttons keep their circle and cross in the system's button colors, which Bulma's delete button\n otherwise loses there. A disabled zone draws its border and text in the system's color for a\n disabled control, at full strength rather than faded.\n- **No ARIA drag attributes:** `aria-dropeffect` and `aria-grabbed` are deprecated, and nothing\n overrides the input's role.",
|
|
57
|
+
"accessibility": "- **One control:** the native file input, the zone's one tab stop, named by the zone's text and\n by a `label` through `htmlFor`. The browser reports its state itself (\"No file chosen\", \"2\n files\"), in its own language.\n- **Not drag only:** a click on the zone, or Enter or Space on the input, opens the picker, so\n dropping is never the only way to choose a file (WCAG 2.5.7 and 2.1.1). Dropping needs a pointer\n and a desktop; on phones the picker is the way in.\n- **Descriptions:** the input's `aria-describedby` points at the `hint`, at the refusals while\n there are any, and at the Field `message`, after any ids you pass.\n- **Announcements:** additions (\"report.pdf added\", \"2 files added\"), refusals and removals are\n announced politely through a status region, since a screen reader can't see the list change.\n Nothing is announced while a file is dragged over the zone.\n- **The list:** a `<ul>` with a row per file, each with a real remove button named \"Remove\" and\n the file's name, a small [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) with a target at least 24px square around\n its circle. After a removal, focus moves to the next row's button, the one before, or the\n input. The `<ul>` writes out `role=\"list\"`, its implicit role, which Safari drops once a list's\n bullets are hidden, as Bulma's reset hides them; without it VoiceOver reads the files with no\n count.\n- **Drag states:** the zone's dashed border turns solid while files are dragged over it, so the\n state shows without color, and in forced colors too. Only the files' types can be read during a\n drag, so the refused look shows only when `accept` names no extension and every type is one it\n refuses; the drop's result is what counts.\n- **Forced colors:** the drop target's border takes the system highlight color, and the remove\n buttons keep their circle and cross in the system's button colors, which Bulma's delete button\n otherwise loses there. A disabled zone draws its border and text in the system's color for a\n disabled control, at full strength rather than faded.\n- **No ARIA drag attributes:** `aria-dropeffect` and `aria-grabbed` are deprecated, and nothing\n overrides the input's role.",
|
|
58
58
|
"related": ["Field", "Fieldset", "File", "Progress", "useBulmaClasses"],
|
|
59
59
|
"storybook": "https://bestax.io/storybook/?path=/story/form-dropzone--default",
|
|
60
60
|
"summary": "The `Dropzone` component is an area to drop files on or click to pick them, which checks each file and lists the chosen ones with a way to remove each. It's Bulma's boxed, full-width file widget with the real `<input type=\"file\">` lying over it, so the input is the one tab stop, the click target and the drop target, and Enter and Space open the picker. The input holds the chosen files: a pick, drop or paste that passes the checks is written to it, so a form submits the files under `name`. It doesn't upload anything.",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"code": "<Icon ariaLabel=\"Custom SVG icon\" textColor=\"primary\">\n <svg viewBox=\"0 0 16 16\" width=\"1em\" height=\"1em\" fill=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"6\" />\n </svg>\n</Icon>"
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
"accessibility": "- **Decorative by default:** an `Icon` with no `ariaLabel` renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. A Material Icons or Material Symbols ligature (`rocket_launch`) stays out of that name too.\n- **Named icons:** set `ariaLabel` on an icon that means something on its own. The container span then renders `role=\"img\"` with that `aria-label`, so the name is the label alone, never the ligature text inside. A non-empty native `aria-label` or `aria-labelledby` counts as a name too, and an explicit `role` or `aria-hidden` wins over either default. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name. For Ionicons the `<ion-icon>` element inside is always `aria-hidden`, since Ionicons gives it an image role with no name, which such an icon would otherwise expose.\n- **Icon-only controls:** put the name on the control (e.g. `Button`'s `aria-label`) and leave the `Icon` unnamed.\n- **Keyboard:** If interactive, use with `Button` or `a` and put the ARIA (`aria-label`, roles) on that control.\n- **Color and size:** Use `textColor`, `bgColor`, and `size` for accessible, themeable icons.",
|
|
65
|
+
"accessibility": "- **Decorative by default:** an `Icon` with no `ariaLabel` renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. A Material Icons or Material Symbols ligature (`rocket_launch`) stays out of that name too.\n- **Named icons:** set `ariaLabel` on an icon that means something on its own. The container span then renders `role=\"img\"` with that `aria-label`, so the name is the label alone, never the ligature text inside. A non-empty native `aria-label` or `aria-labelledby` counts as a name too, and an explicit `role` or `aria-hidden` wins over either default. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name: without one, a Material ligature's text or an SVG inside it can name it, or the control around it, and a development build warns. For Ionicons the `<ion-icon>` element inside is always `aria-hidden`, since Ionicons gives it an image role with no name, which such an icon would otherwise expose.\n- **Icon-only controls:** put the name on the control (e.g. `Button`'s `aria-label`) and leave the `Icon` unnamed.\n- **Keyboard:** If interactive, use with `Button` or `a` and put the ARIA (`aria-label`, roles) on that control.\n- **Color and size:** Use `textColor`, `bgColor`, and `size` for accessible, themeable icons.",
|
|
66
66
|
"related": ["Button", "Card", "IconText", "useBulmaClasses"],
|
|
67
67
|
"storybook": "https://bestax.io/storybook/?path=/story/elements-icon--default",
|
|
68
68
|
"summary": "The `Icon` component is a Bulma-styled wrapper for displaying icons from various libraries (Font Awesome, Material Design Icons, Ionicons, Google Material Icons, Material Symbols, etc.).",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"name": "ariaLabel",
|
|
192
192
|
"type": "string",
|
|
193
193
|
"default": null,
|
|
194
|
-
"description": "Accessible name for an icon that means something on its own. Set it and the container span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. For an icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name. For Ionicons the `<ion-icon>` inside is always `aria-hidden`, so it adds no image of its own.",
|
|
194
|
+
"description": "Accessible name for an icon that means something on its own. Set it and the container span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. For an icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name: without one, a Material ligature's text or an SVG inside it can name it, or the control around it, and a development build warns. For Ionicons the `<ion-icon>` inside is always `aria-hidden`, so it adds no image of its own.",
|
|
195
195
|
"required": false,
|
|
196
196
|
"inherited": true,
|
|
197
197
|
"deprecated": false
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"name": "ariaLabel",
|
|
255
255
|
"type": "string",
|
|
256
256
|
"default": null,
|
|
257
|
-
"description": "Accessible name for an icon that means something on its own. Set it and the container span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. For an icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name. For Ionicons the `<ion-icon>` inside is always `aria-hidden`, so it adds no image of its own.",
|
|
257
|
+
"description": "Accessible name for an icon that means something on its own. Set it and the container span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. For an icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name: without one, a Material ligature's text or an SVG inside it can name it, or the control around it, and a development build warns. For Ionicons the `<ion-icon>` inside is always `aria-hidden`, so it adds no image of its own.",
|
|
258
258
|
"required": false,
|
|
259
259
|
"inherited": true,
|
|
260
260
|
"deprecated": false
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"code": "<Message color=\"danger\" title=\"Mixed Approach\">\n <Message.Body>\n <Paragraph>\n You can mix prop-based and compound component approaches!\n </Paragraph>\n <Paragraph>\n This message uses the title prop but compound components for the body.\n </Paragraph>\n </Message.Body>\n</Message>"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"accessibility": "- The message is rendered as `<article class=\"message\">`.\n- If `onClose` is provided, a close button is rendered, named \"delete\" unless `ariaCloseLabel` names it. It's drawn as an icon, so its name is all a screen reader says about it: in an app in another language, give it one in the page's language. An `aria-label` on `Message` names the `<article>`, not the button.\n- For optimal accessibility, use clear and descriptive titles/content.\n\n:::note\nAlways provide a visible or accessible way to dismiss important, interruptive messages.\n:::",
|
|
41
|
+
"accessibility": "- The message is rendered as `<article class=\"message\">`.\n- If `onClose` is provided, a close button is rendered, named \"delete\" unless `ariaCloseLabel` names it. It's drawn as an icon, so its name is all a screen reader says about it: in an app in another language, give it one in the page's language. An `aria-label` on `Message` names the `<article>`, not the button. It takes presses on a box at least 24px square around its circle, as [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) does.\n- For optimal accessibility, use clear and descriptive titles/content.\n\n:::note\nAlways provide a visible or accessible way to dismiss important, interruptive messages.\n:::",
|
|
42
42
|
"related": ["Notification", "useBulmaClasses"],
|
|
43
43
|
"storybook": "https://bestax.io/storybook/?path=/story/components-message--primary",
|
|
44
44
|
"summary": "The `Message` component provides Bulma's flexible notice/message box for your Bulma React UI.",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"code": "function example() {\n const [open, setOpen] = useState(false);\n const closeModal = () => setOpen(false);\n\n return (\n <>\n <Button color=\"success\" onClick={() => setOpen(true)}>\n Show Modal\n </Button>\n <Modal\n isActive={open}\n onClose={closeModal}\n aria-labelledby=\"custom-content-title\"\n >\n <Modal.Background onClick={closeModal} />\n <Modal.Content>\n <Box>\n <Title size=\"4\" id=\"custom-content-title\">\n Custom Content\n </Title>\n <Paragraph>Using compound components for full control!</Paragraph>\n </Box>\n </Modal.Content>\n <Modal.Close variant=\"floating\" />\n </Modal>\n </>\n );\n}"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
|
-
"accessibility": "- The modal root gets `role=\"dialog\"` and `aria-modal=\"true\"` while active — pass an explicit `role` to override (e.g. `Dialog` passes `role=\"presentation\"` on the `Modal` it wraps so its own `role=\"alertdialog\"` is the only one announced).\n- **Give the dialog an accessible name.** With the legacy API, `modalCardTitle` is wired up as `aria-labelledby` for you, and with `type=\"content\"`, which shows no card head, a title that's a string names the dialog as its `aria-label`. Without one, and with the compound API, pass your own `aria-label` or `aria-labelledby` on `<Modal>` — a `role=\"dialog\"` with no name is announced as just \"dialog\". An explicit `aria-labelledby` always wins over the generated one. A development build warns about an open modal nothing names.\n- Escape closes the modal (calls `onClose`) by default; opt out with `closeOnEscape={false}`. One Escape closes the topmost overlay only, whichever open Modal, [Dialog](https://bestax.io/docs/api/components/dialog), [Sidebar](https://bestax.io/docs/api/components/sidebar) or full-page [Loading](https://bestax.io/docs/api/components/loading) opened last, and the next Escape closes the one under it. A modal on top with `closeOnEscape={false}` still keeps Escape from the layers under it. A [Toast](https://bestax.io/docs/api/components/toast) waits until no overlay is open.\n- The modal calls `preventDefault()` on the Escape it closes on, so a listener of your own that runs after it can tell the key was used.\n- A popup inside the modal takes its own Escape first. With an Autocomplete list, a Dropdown menu, a Popover or a date picker's calendar open, the first Escape closes that and the next one closes the modal.\n- A popup of your own inside a modal should call `preventDefault()` on the Escape it closes on. The modal leaves an Escape that was prevented alone, whether your popup hears it in a React `onKeyDown` or in a listener on `document`. Call it only when the popup is open and the key was pressed in it, so an Escape with nothing to close still closes the modal, and so does one pressed in a modal opened over your popup.\n- The page doesn't scroll under the modal while it's active; opt out with `lockScroll={false}`. The lock is ref-counted and shared with `Dialog`, `Sidebar` and `Loading`, so whichever overlay closes first doesn't unlock the page underneath one that is still open.\n- Focus moves to the first tab stop (or the modal itself) on open, and is restored to the previously focused element on close — unless another modal is still open on top, in which case that one keeps focus.\n- A popup opened inside the modal, such as a `Popover`, `HoverCard` or `ContextMenu` panel, or a `Combobox` menu or picker popover with `appendToBody`, is portaled into the modal's root rather than to the end of `<body>`, so a screen reader that honors `aria-modal` reaches it, and it's inside the Tab cycle below. A `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config#where-portaled-content-goes) sets still takes it. A [Lightbox](https://bestax.io/docs/api/components/lightbox) is a Modal, so the same goes for it.\n- Tab and Shift+Tab cycle within the modal while it is the topmost modal overlay, so the keyboard order agrees with what `aria-modal=\"true\"` tells assistive technology. They wrap at the same tab stops [`useFocusTrap`](https://bestax.io/docs/api/helpers/usefocustrap) does, so disabled, hidden and `tabIndex={-1}` elements are skipped, and so is inert content, such as a closed [Sidebar](https://bestax.io/docs/api/components/sidebar) inside the modal, and the content of a closed `<details>`. A radio group counts once. A Tab from outside the modal brings focus back in, and so does a Tab the browser takes out anyway, as Safari does past links when its settings say to. With another Modal or Dialog, a [Sidebar](https://bestax.io/docs/api/components/sidebar) with an overlay or a full-page Loading opened over it, the modal leaves Tab alone until that one closes. A Sidebar without an overlay isn't modal: opened over the modal, it takes Escape first, but the modal keeps holding Tab and keeps focus, so the sidebar doesn't take focus when it opens, and a Tab from its controls comes back into the modal. A focus trap of your own inside it, such as a portaled panel's, keeps a Tab it calls `preventDefault()` on, and the modal leaves focus where your trap put it. Note that `aria-modal` does not by itself make background content inert, and no `inert` attribute is applied, so background content remains reachable by pointer and by browser UI such as find-in-page.\n- In the props form, the background closes the modal on click, and a close button is provided for both modal-card and modal-content variants (both call `onClose`, so pass it). The close button is named \"close\" unless `ariaCloseLabel` names it. It's drawn as an icon, so its name is all a screen reader says about it: in an app in another language, give it one in the page's language. An `aria-label` on `Modal` names the dialog, not the button, and a `Modal.Close` in the compound form takes an `aria-label` of its own.\n- In the compound form, `Modal.Close` calls the modal's `onClose` unless you give it an `onClick` of your own, and `Modal.Background` closes the modal only when you pass it `onClick={onClose}`.\n- A modal card's head and foot are a `<header>` and a `<footer>`. Outside `<main>`, `<article>`, `<aside>`, `<nav>` or `<section>`, a browser exposes those as the page's banner and content info landmarks. So when `portal` renders a modal card at the end of `<body>`, its head and foot are landmarks inside its dialog, and a screen reader user moving through the page by landmark is offered its title bar as the page's banner. Any of these avoids them:\n - Render the modal inline inside the page's `<main>`, or point `portal` at an element inside it that doesn't clip the modal.\n - In the compound form, pass `role=\"none\"` to `Modal.Card.Head` and `Modal.Card.Foot`, which drops them wherever the modal is. A browser ignores that role on an element with an `aria-label` or other global ARIA attribute, or a `tabIndex`, so give them none of those. The compound form leaves the dialog's name to you: point an `aria-labelledby` on `<Modal>` at the `Modal.Card.Title`.\n\n The props form's head and foot, from `modalCardTitle` and `modalCardFoot`, can't take a role.\n\n- In forced colors (Windows' contrast themes), which repaint the card's backgrounds and the backdrop's, a modal card keeps a one pixel edge in the system's text color, from bestax's `components/modal` partial, which `bestax.css` includes.\n\n:::note\nAlways provide an `onClose` handler for accessibility and to allow users to dismiss the modal.\n:::",
|
|
49
|
+
"accessibility": "- The modal root gets `role=\"dialog\"` and `aria-modal=\"true\"` while active — pass an explicit `role` to override (e.g. `Dialog` passes `role=\"presentation\"` on the `Modal` it wraps so its own `role=\"alertdialog\"` is the only one announced).\n- **Give the dialog an accessible name.** With the legacy API, `modalCardTitle` is wired up as `aria-labelledby` for you, and with `type=\"content\"`, which shows no card head, a title that's a string names the dialog as its `aria-label`. Without one, and with the compound API, pass your own `aria-label` or `aria-labelledby` on `<Modal>` — a `role=\"dialog\"` with no name is announced as just \"dialog\". An explicit `aria-labelledby` always wins over the generated one. A development build warns about an open modal nothing names.\n- Escape closes the modal (calls `onClose`) by default; opt out with `closeOnEscape={false}`. One Escape closes the topmost overlay only, whichever open Modal, [Dialog](https://bestax.io/docs/api/components/dialog), [Sidebar](https://bestax.io/docs/api/components/sidebar) or full-page [Loading](https://bestax.io/docs/api/components/loading) opened last, and the next Escape closes the one under it. A modal on top with `closeOnEscape={false}` still keeps Escape from the layers under it. A [Toast](https://bestax.io/docs/api/components/toast) waits until no overlay is open.\n- The modal calls `preventDefault()` on the Escape it closes on, so a listener of your own that runs after it can tell the key was used.\n- A popup inside the modal takes its own Escape first. With an Autocomplete list, a Dropdown menu, a Popover or a date picker's calendar open, the first Escape closes that and the next one closes the modal.\n- A popup of your own inside a modal should call `preventDefault()` on the Escape it closes on. The modal leaves an Escape that was prevented alone, whether your popup hears it in a React `onKeyDown` or in a listener on `document`. Call it only when the popup is open and the key was pressed in it, so an Escape with nothing to close still closes the modal, and so does one pressed in a modal opened over your popup.\n- The page doesn't scroll under the modal while it's active; opt out with `lockScroll={false}`. The lock is ref-counted and shared with `Dialog`, `Sidebar` and `Loading`, so whichever overlay closes first doesn't unlock the page underneath one that is still open.\n- Focus moves to the first tab stop (or the modal itself) on open, and is restored to the previously focused element on close — unless another modal is still open on top, in which case that one keeps focus.\n- A popup opened inside the modal, such as a `Popover`, `HoverCard` or `ContextMenu` panel, or a `Combobox` menu or picker popover with `appendToBody`, is portaled into the modal's root rather than to the end of `<body>`, so a screen reader that honors `aria-modal` reaches it, and it's inside the Tab cycle below. A `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config#where-portaled-content-goes) sets still takes it. A [Lightbox](https://bestax.io/docs/api/components/lightbox) is a Modal, so the same goes for it.\n- Tab and Shift+Tab cycle within the modal while it is the topmost modal overlay, so the keyboard order agrees with what `aria-modal=\"true\"` tells assistive technology. They wrap at the same tab stops [`useFocusTrap`](https://bestax.io/docs/api/helpers/usefocustrap) does, so disabled, hidden and `tabIndex={-1}` elements are skipped, and so is inert content, such as a closed [Sidebar](https://bestax.io/docs/api/components/sidebar) inside the modal, and the content of a closed `<details>`. A radio group counts once. A Tab from outside the modal brings focus back in, and so does a Tab the browser takes out anyway, as Safari does past links when its settings say to. With another Modal or Dialog, a [Sidebar](https://bestax.io/docs/api/components/sidebar) with an overlay or a full-page Loading opened over it, the modal leaves Tab alone until that one closes. A Sidebar without an overlay isn't modal: opened over the modal, it takes Escape first, but the modal keeps holding Tab and keeps focus, so the sidebar doesn't take focus when it opens, and a Tab from its controls comes back into the modal. A focus trap of your own inside it, such as a portaled panel's, keeps a Tab it calls `preventDefault()` on, and the modal leaves focus where your trap put it. Note that `aria-modal` does not by itself make background content inert, and no `inert` attribute is applied, so background content remains reachable by pointer and by browser UI such as find-in-page.\n- In the props form, the background closes the modal on click, and a close button is provided for both modal-card and modal-content variants (both call `onClose`, so pass it). The close button is named \"close\" unless `ariaCloseLabel` names it. It's drawn as an icon, so its name is all a screen reader says about it: in an app in another language, give it one in the page's language. An `aria-label` on `Modal` names the dialog, not the button, and a `Modal.Close` in the compound form takes an `aria-label` of its own. The close buttons, the card's and the floating one, and `Modal.Close` in either variant, take presses on a box at least 24px square centred on the button Bulma draws, as [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) does. A `Modal.Close` given `dangerouslySetInnerHTML` has no box, since React won't render it beside that.\n- In the compound form, `Modal.Close` calls the modal's `onClose` unless you give it an `onClick` of your own, and `Modal.Background` closes the modal only when you pass it `onClick={onClose}`.\n- A modal card's head and foot are a `<header>` and a `<footer>`. Outside `<main>`, `<article>`, `<aside>`, `<nav>` or `<section>`, a browser exposes those as the page's banner and content info landmarks. So when `portal` renders a modal card at the end of `<body>`, its head and foot are landmarks inside its dialog, and a screen reader user moving through the page by landmark is offered its title bar as the page's banner. Any of these avoids them:\n - Render the modal inline inside the page's `<main>`, or point `portal` at an element inside it that doesn't clip the modal.\n - In the compound form, pass `role=\"none\"` to `Modal.Card.Head` and `Modal.Card.Foot`, which drops them wherever the modal is. A browser ignores that role on an element with an `aria-label` or other global ARIA attribute, or a `tabIndex`, so give them none of those. The compound form leaves the dialog's name to you: point an `aria-labelledby` on `<Modal>` at the `Modal.Card.Title`.\n\n The props form's head and foot, from `modalCardTitle` and `modalCardFoot`, can't take a role.\n\n- In forced colors (Windows' contrast themes), which repaint the card's backgrounds and the backdrop's, a modal card keeps a one pixel edge in the system's text color, from bestax's `components/modal` partial, which `bestax.css` includes.\n\n:::note\nAlways provide an `onClose` handler for accessibility and to allow users to dismiss the modal.\n:::",
|
|
50
50
|
"related": [
|
|
51
51
|
"Button",
|
|
52
52
|
"Dialog",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"note": "A path under /img/ here stands for a picture your own app serves, such as a file in its public/img/ folder."
|
|
90
90
|
}
|
|
91
91
|
],
|
|
92
|
-
"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:::",
|
|
92
|
+
"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- **A fixed navbar:** with `fixed=\"top\"`, bestax's styles pad the page's scroll by\n `--bulma-navbar-height`, so the browser scrolls a control that takes focus, or an in-page link's\n target, to below the navbar rather than under it. `fixed=\"bottom\"` pads the bottom of the page\n the same way. The page's own padding, so its top doesn't start under the navbar, is still Bulma's\n `has-navbar-fixed-top` on `<html>`. A `scroll-padding-top` of your own on `<html>`, or an\n [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s, wins over it: set yours for a navbar taller than\n `--bulma-navbar-height`, as a spaced one is from the desktop breakpoint up, or to `0` where your\n anchor targets already carry a `scroll-margin-top`, which adds to it. This ships in `bestax.css`\n and `extras.css`, not in Bulma's own stylesheet.\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:::",
|
|
93
93
|
"related": ["Button", "Icon", "useBulmaClasses"],
|
|
94
94
|
"storybook": "https://bestax.io/storybook/?path=/story/components-navbar--default",
|
|
95
95
|
"summary": "The `Navbar` component implements Bulma's powerful, responsive navigation bar for your Bulma React UI.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"code": "<Notification color=\"warning\">\n <Strong>Warning!</Strong> This notification contains{' '}\n <Link href=\"#\">custom content</Link>.\n</Notification>"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"accessibility": "- **Delete button:** Named \"Close notification\" for screen readers. Pass `ariaCloseLabel`, on `Notification` or to `notification.show()`, to name it in your app's language.\n- **Keyboard:** The delete button is focusable and can be activated by keyboard.\n- **Content:** Use semantic HTML within the notification for best accessibility.\n- **Contrast:** A dark or light notification's text reads against its background the way a dark or light `Button`'s does, in both color schemes, and a white or black one with `isLight` gets the light color's text on its light gray background. That comes from bestax's stylesheets, as the `color` and `isLight` props' descriptions say.\n- **Announcements:** A notification shown through `notification` announces its message. `danger` and `warning` announce themselves: the message carries `role=\"alert\"` with `aria-live=\"assertive\"`, which screen readers reliably announce even though it arrives with its text. The rest are announced politely through a visually hidden `role=\"status\"` region that `NotificationContainer` keeps in the page from the moment it mounts, even with nothing showing, because a polite region that arrives already holding its text often isn't announced. A moment after one of those notifications appears, its message is written into the region, then cleared again shortly after.\n- **Closing:** When a notification shown through `notification` closes with focus inside it, focus moves to the close button of the next notification in its stack that stays open and has one, or else of the one before it, or, with neither, back to where it was before it went into a notification, while that's still on the page, rather than dropping to the page. Focus anywhere else stays where it is.\n- **Timing:** A notification shown through `notification` doesn't close on its timer while focus is inside it, on its close button or on a link in its message, whatever `pauseOnHover` says, so a keyboard user who reaches it can use it. Focus from a click counts too, in browsers that focus a clicked link or button, so after a click on one the notification stays up until focus moves elsewhere. Once focus leaves, it gets its whole `duration` again, the way it does after the pointer leaves with `pauseOnHover`.\n- **Testing:** A polite notification's message doesn't carry `role=\"status\"`, so `getByRole('status')` finds the container's region rather than the notification. Query the message text or `.notification` instead. A count or text [`Badge`](https://bestax.io/docs/api/components/badge) is a `role=\"status\"` node too, so with both on the page `getByRole('status')` matches more than one: find the badge by its accessible name, or use `getAllByRole`. While a message is in the region, the page also holds a second copy of its text, so a test that advances the clock past the announcement and then looks the message up by text can find both, and can still find the region's copy for a moment after the notification closes. Scope that query to the notification, for example with `within`.\n\n:::tip\nAlways provide clear, actionable text inside notifications.\n:::",
|
|
37
|
+
"accessibility": "- **Delete button:** Named \"Close notification\" for screen readers. Pass `ariaCloseLabel`, on `Notification` or to `notification.show()`, to name it in your app's language. It takes presses on a box at least 24px square around its circle, as [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) does.\n- **Keyboard:** The delete button is focusable and can be activated by keyboard.\n- **Content:** Use semantic HTML within the notification for best accessibility.\n- **Contrast:** A dark or light notification's text reads against its background the way a dark or light `Button`'s does, in both color schemes, and a white or black one with `isLight` gets the light color's text on its light gray background. That comes from bestax's stylesheets, as the `color` and `isLight` props' descriptions say.\n- **Announcements:** A notification shown through `notification` announces its message. `danger` and `warning` announce themselves: the message carries `role=\"alert\"` with `aria-live=\"assertive\"`, which screen readers reliably announce even though it arrives with its text. The rest are announced politely through a visually hidden `role=\"status\"` region that `NotificationContainer` keeps in the page from the moment it mounts, even with nothing showing, because a polite region that arrives already holding its text often isn't announced. A moment after one of those notifications appears, its message is written into the region, then cleared again shortly after.\n- **Closing:** When a notification shown through `notification` closes with focus inside it, focus moves to the close button of the next notification in its stack that stays open and has one, or else of the one before it, or, with neither, back to where it was before it went into a notification, while that's still on the page, rather than dropping to the page. Focus anywhere else stays where it is.\n- **Timing:** A notification shown through `notification` doesn't close on its timer while focus is inside it, on its close button or on a link in its message, whatever `pauseOnHover` says, so a keyboard user who reaches it can use it. Focus from a click counts too, in browsers that focus a clicked link or button, so after a click on one the notification stays up until focus moves elsewhere. Once focus leaves, it gets its whole `duration` again, the way it does after the pointer leaves with `pauseOnHover`.\n- **Testing:** A polite notification's message doesn't carry `role=\"status\"`, so `getByRole('status')` finds the container's region rather than the notification. Query the message text or `.notification` instead. A count or text [`Badge`](https://bestax.io/docs/api/components/badge) is a `role=\"status\"` node too, so with both on the page `getByRole('status')` matches more than one: find the badge by its accessible name, or use `getAllByRole`. While a message is in the region, the page also holds a second copy of its text, so a test that advances the clock past the announcement and then looks the message up by text can find both, and can still find the region's copy for a moment after the notification closes. Scope that query to the notification, for example with `within`.\n\n:::tip\nAlways provide clear, actionable text inside notifications.\n:::",
|
|
38
38
|
"related": ["Delete", "useBulmaClasses"],
|
|
39
39
|
"storybook": "https://bestax.io/storybook/?path=/story/elements-notification--default",
|
|
40
40
|
"summary": "The `Notification` component is a Bulma-styled alert/message area for providing feedback, warnings, or information to users.",
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
"name": "ariaLabel",
|
|
304
304
|
"type": "string",
|
|
305
305
|
"default": null,
|
|
306
|
-
"description": "Accessible name for an icon that means something on its own. Set it and the container span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. For an icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name. For Ionicons the `<ion-icon>` inside is always `aria-hidden`, so it adds no image of its own.",
|
|
306
|
+
"description": "Accessible name for an icon that means something on its own. Set it and the container span gets `role=\"img\"` with this `aria-label`, so the name is exactly this text: a Material ligature such as `rocket_launch` inside stays out of it. Leave it unset (or empty) and the icon is decorative: the span renders `aria-hidden=\"true\"` and no name, so it adds nothing to the accessible name of a `Button` or text around it. For an icon-only control, put the name on the control (e.g. `Button`'s `aria-label`) and leave this unset. A non-empty native `aria-label` or `aria-labelledby` passed instead also counts as a name, and an explicit `role` or `aria-hidden` wins over both defaults. An unnamed icon given a `role` or a `tabIndex` of its own isn't hidden, since hiding something focusable is a failure of its own, so give it a name: without one, a Material ligature's text or an SVG inside it can name it, or the control around it, and a development build warns. For Ionicons the `<ion-icon>` inside is always `aria-hidden`, so it adds no image of its own.",
|
|
307
307
|
"required": false,
|
|
308
308
|
"inherited": true,
|
|
309
309
|
"deprecated": false
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"code": "function example() {\n const [isOpen, setIsOpen] = useState(false);\n return (\n <>\n <Button color=\"primary\" onClick={() => setIsOpen(true)}>\n Open Sidebar\n </Button>\n <Sidebar\n inline\n isOpen={isOpen}\n onClose={() => setIsOpen(false)}\n aria-labelledby=\"sidebar-title-dot-notation\"\n >\n <Sidebar.Header>\n <Sidebar.Title id=\"sidebar-title-dot-notation\">\n Dot Notation\n </Sidebar.Title>\n <Sidebar.Close onClick={() => setIsOpen(false)} />\n </Sidebar.Header>\n <Sidebar.Body>\n <Paragraph>\n Header, Title, Close, Body, and Footer are all available from the\n single Sidebar import.\n </Paragraph>\n </Sidebar.Body>\n <Sidebar.Footer>\n <Button color=\"primary\" onClick={() => setIsOpen(false)}>\n Done\n </Button>\n </Sidebar.Footer>\n </Sidebar>\n </>\n );\n}"
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
|
-
"accessibility": "- Uses `role=\"dialog\"` for proper screen reader announcement\n- **Give the sidebar an accessible name.** Nothing names it on its own, `Sidebar.Title` included: give the title an `id` and the `Sidebar` an `aria-labelledby` pointing at it, as the examples here do, or pass an `aria-label` when there's no visible title. In a component you render more than once, take the `id` from `useId` so each sidebar points at its own title. A `role=\"dialog\"` with no name is announced as just \"dialog\"\n- Has `aria-modal=\"true\"` when overlay is shown\n- Focus moves into the sidebar when it opens, to its first tab stop or the sidebar itself, unless it has no overlay and a modal overlay is open under it (see below). That's decided as it opens, so changing `overlay` while it's open leaves focus where it is. When it closes, focus goes back to whatever had it when the sidebar opened, unless focus has already left the sidebar, say for an overlay that's still open on top\n- With an overlay, Tab and Shift+Tab stay inside the sidebar while it's the topmost modal overlay, so the keyboard order agrees with what `aria-modal=\"true\"` tells assistive technology. They wrap at the same tab stops [`useFocusTrap`](https://bestax.io/docs/api/helpers/usefocustrap) does, so hidden, disabled and `tabIndex={-1}` elements are skipped and a radio group counts once. A Tab from outside the sidebar brings focus back in, and so does a Tab the browser takes out anyway, as Safari does past links when its settings say to\n- A [Modal](https://bestax.io/docs/api/components/modal) or [Dialog](https://bestax.io/docs/api/components/dialog) opened over the sidebar, including one rendered inside it, holds Tab until it closes, and then the sidebar holds it again. A sidebar with an overlay opened over a Modal holds Tab until it closes, and then the Modal does\n- A focus trap of your own inside the sidebar, such as a portaled panel's, keeps a Tab it calls `preventDefault()` on, and the sidebar leaves focus where your trap put it\n- Without an overlay the sidebar isn't modal and holds no Tab. On the page, Tab moves in and out of it freely. Opened over a Modal, or over a sidebar with an overlay, it takes Escape first, but the one under it keeps holding Tab and keeps focus: the sidebar doesn't take focus when it opens, and a Tab from its controls, once a click puts focus there, goes back into that one\n- A closed sidebar stays in the page so it can slide out, and it's `inert` and `aria-hidden` while closed: Tab passes over its content and assistive technology doesn't read it\n- Escape key closes the sidebar by default. One Escape closes the topmost overlay only: a [Modal](https://bestax.io/docs/api/components/modal) or [Dialog](https://bestax.io/docs/api/components/dialog) opened over the sidebar closes first, and the sidebar on the next Escape. A sidebar opened over a Modal closes before it\n- A sidebar on top that can't close on Escape, with `escapeClose` or `canCancel` off, still keeps the key from the overlays under it. A [Toast](https://bestax.io/docs/api/components/toast) waits until no overlay is open\n- A popup open inside it, such as a Dropdown menu or a date picker's calendar, takes the first Escape, and the next one closes the sidebar. A popup of your own does the same by calling `preventDefault()` on the Escape it closes on, as the [Modal](https://bestax.io/docs/api/components/modal#accessibility) page explains.\n- The page doesn't scroll while the sidebar is open with an overlay, through the ref-counted lock shared with [`Modal`](https://bestax.io/docs/api/components/modal#accessibility), `Dialog` and `Loading`, so closing one overlay never unlocks the page underneath another that is still open\n- In forced colors (Windows' contrast themes), which drop the panel's shadow and repaint background colors, the panel keeps a one pixel edge in the system's text color, and `Sidebar.Close` keeps its cross, in the system's text color, or its color for a disabled control when the button is `disabled` or `aria-disabled`",
|
|
45
|
+
"accessibility": "- Uses `role=\"dialog\"` for proper screen reader announcement\n- **Give the sidebar an accessible name.** Nothing names it on its own, `Sidebar.Title` included: give the title an `id` and the `Sidebar` an `aria-labelledby` pointing at it, as the examples here do, or pass an `aria-label` when there's no visible title. In a component you render more than once, take the `id` from `useId` so each sidebar points at its own title. A `role=\"dialog\"` with no name is announced as just \"dialog\". A development build warns, once per page, about an open sidebar with no `aria-label`, `aria-labelledby` or `title`, and doesn't check what an `aria-labelledby` points at\n- Has `aria-modal=\"true\"` when overlay is shown\n- Focus moves into the sidebar when it opens, to its first tab stop or the sidebar itself, unless it has no overlay and a modal overlay is open under it (see below). That's decided as it opens, so changing `overlay` while it's open leaves focus where it is. When it closes, focus goes back to whatever had it when the sidebar opened, unless focus has already left the sidebar, say for an overlay that's still open on top\n- With an overlay, Tab and Shift+Tab stay inside the sidebar while it's the topmost modal overlay, so the keyboard order agrees with what `aria-modal=\"true\"` tells assistive technology. They wrap at the same tab stops [`useFocusTrap`](https://bestax.io/docs/api/helpers/usefocustrap) does, so hidden, disabled and `tabIndex={-1}` elements are skipped and a radio group counts once. A Tab from outside the sidebar brings focus back in, and so does a Tab the browser takes out anyway, as Safari does past links when its settings say to\n- A [Modal](https://bestax.io/docs/api/components/modal) or [Dialog](https://bestax.io/docs/api/components/dialog) opened over the sidebar, including one rendered inside it, holds Tab until it closes, and then the sidebar holds it again. A sidebar with an overlay opened over a Modal holds Tab until it closes, and then the Modal does\n- A focus trap of your own inside the sidebar, such as a portaled panel's, keeps a Tab it calls `preventDefault()` on, and the sidebar leaves focus where your trap put it\n- Without an overlay the sidebar isn't modal and holds no Tab. On the page, Tab moves in and out of it freely. Opened over a Modal, or over a sidebar with an overlay, it takes Escape first, but the one under it keeps holding Tab and keeps focus: the sidebar doesn't take focus when it opens, and a Tab from its controls, once a click puts focus there, goes back into that one\n- A closed sidebar stays in the page so it can slide out, and it's `inert` and `aria-hidden` while closed: Tab passes over its content and assistive technology doesn't read it\n- Escape key closes the sidebar by default. One Escape closes the topmost overlay only: a [Modal](https://bestax.io/docs/api/components/modal) or [Dialog](https://bestax.io/docs/api/components/dialog) opened over the sidebar closes first, and the sidebar on the next Escape. A sidebar opened over a Modal closes before it\n- A sidebar on top that can't close on Escape, with `escapeClose` or `canCancel` off, still keeps the key from the overlays under it. A [Toast](https://bestax.io/docs/api/components/toast) waits until no overlay is open\n- A popup open inside it, such as a Dropdown menu or a date picker's calendar, takes the first Escape, and the next one closes the sidebar. A popup of your own does the same by calling `preventDefault()` on the Escape it closes on, as the [Modal](https://bestax.io/docs/api/components/modal#accessibility) page explains.\n- The page doesn't scroll while the sidebar is open with an overlay, through the ref-counted lock shared with [`Modal`](https://bestax.io/docs/api/components/modal#accessibility), `Dialog` and `Loading`, so closing one overlay never unlocks the page underneath another that is still open\n- In forced colors (Windows' contrast themes), which drop the panel's shadow and repaint background colors, the panel keeps a one pixel edge in the system's text color, and `Sidebar.Close` keeps its cross, in the system's text color, or its color for a disabled control when the button is `disabled` or `aria-disabled`",
|
|
46
46
|
"related": ["Menu", "Modal"],
|
|
47
47
|
"storybook": "https://bestax.io/storybook/?path=/story/components-sidebar",
|
|
48
48
|
"summary": "The `Sidebar` component provides a slide-out navigation panel that appears from the left or right side of the screen.",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"name": "aria-labelledby",
|
|
189
189
|
"type": "string",
|
|
190
190
|
"default": null,
|
|
191
|
-
"description": "Names the sidebar, a `role=\"dialog\"` that nothing else names: point it at the `id` of its `Sidebar.Title`. With no visible title, pass an `aria-label` instead.",
|
|
191
|
+
"description": "Names the sidebar, a `role=\"dialog\"` that nothing else names: point it at the `id` of its `Sidebar.Title`. With no visible title, pass an `aria-label` instead. A development build warns, once per page, about an open sidebar with no `aria-label`, `aria-labelledby` or `title`, and doesn't check what an `aria-labelledby` points at.",
|
|
192
192
|
"required": false,
|
|
193
193
|
"inherited": false,
|
|
194
194
|
"deprecated": false
|
|
@@ -62,7 +62,7 @@
|
|
|
62
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}"
|
|
63
63
|
}
|
|
64
64
|
],
|
|
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- While the input has focus, the box around the tags draws Bulma's focus ring, a border and a shadow in the focus color, or in the `color` you set, inside a `Control` or not\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.",
|
|
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- Each remove button is Bulma's small delete button, with a box at least 24px square around its circle that takes presses too, as [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) has.\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- While the input has focus, the box around the tags draws Bulma's focus ring, a border and a shadow in the focus color, or in the `color` you set, inside a `Control` or not\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.",
|
|
66
66
|
"related": ["Autocomplete", "Input", "Tag"],
|
|
67
67
|
"storybook": "https://bestax.io/storybook/?path=/story/form-taginput",
|
|
68
68
|
"summary": "The `Taginput` component provides a tag/chip input field for managing multiple tags.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button onClick={() => setShowToast(true)}>Show Indefinite Toast</Button>\n {showToast && (\n <Toast\n inline\n message=\"This won't auto-dismiss\"\n indefinite\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"accessibility": "- Uses `role=\"alert\"` for screen reader announcement.\n- Has `aria-live=\"polite\"` for non-intrusive notifications.\n- The closable button is named \"Close\". Pass `ariaCloseLabel` to name it in your app's language.\n- `pauseOnHover` lets users keep the toast visible while reading.\n- A toast doesn't close on its timer while focus is inside it, on its action, cancel or close button, whatever `pauseOnHover` says, so a keyboard user who reaches it can use it. Once focus leaves, it gets its whole `duration` again.\n- When a toast shown through `toast` closes with focus inside it, as one does from its own buttons, focus moves to the first button of the next toast in its stack that stays and has one, or else of the one before it, or, with neither, back to where it was before it went into a toast, while that's still on the page, rather than dropping to the page. Focus anywhere else stays where it is. A `Toast` you render yourself leaves that to your `onClose`.\n- `ToastContainer`'s `hotkey`, F8 by default, moves focus to the newest toast's first button, or to the toast itself when it has none, so a keyboard or screen reader user reaches it before it closes. Each stack is a region named \"Notifications\" with the hotkey after it, such as \"Notifications (F8)\".\n- `cancelable` (default `true`) supports Escape-key dismiss. An Escape that closed a popup on the page, such as a Dropdown menu or a date picker's calendar, leaves the toast up.\n- A toast is a notification rather than a layer, so while a [Modal](https://bestax.io/docs/api/components/modal), [Dialog](https://bestax.io/docs/api/components/dialog), [Sidebar](https://bestax.io/docs/api/components/sidebar) or full-page [Loading](https://bestax.io/docs/api/components/loading) is open, Escape goes to that and the toast stays up. Once none is open, Escape dismisses the toast.\n- In forced colors (Windows' contrast themes), which drop the toast's shadow and paint its fill in the page's own color, the toast gets a one pixel edge in the system's text color, and the cancel button's text shows at full strength. A toast given a `tabIndex` shows the browser's focus ring in place of that edge while it has keyboard focus.",
|
|
37
|
+
"accessibility": "- Uses `role=\"alert\"` for screen reader announcement.\n- Has `aria-live=\"polite\"` for non-intrusive notifications.\n- The closable button is named \"Close\". Pass `ariaCloseLabel` to name it in your app's language. It's Bulma's small delete button, with a box at least 24px square around its circle that takes presses too, as [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) has.\n- `pauseOnHover` lets users keep the toast visible while reading.\n- A toast doesn't close on its timer while focus is inside it, on its action, cancel or close button, whatever `pauseOnHover` says, so a keyboard user who reaches it can use it. Once focus leaves, it gets its whole `duration` again.\n- When a toast shown through `toast` closes with focus inside it, as one does from its own buttons, focus moves to the first button of the next toast in its stack that stays and has one, or else of the one before it, or, with neither, back to where it was before it went into a toast, while that's still on the page, rather than dropping to the page. Focus anywhere else stays where it is. A `Toast` you render yourself leaves that to your `onClose`.\n- `ToastContainer`'s `hotkey`, F8 by default, moves focus to the newest toast's first button, or to the toast itself when it has none, so a keyboard or screen reader user reaches it before it closes. Each stack is a region named \"Notifications\" with the hotkey after it, such as \"Notifications (F8)\".\n- `cancelable` (default `true`) supports Escape-key dismiss. An Escape that closed a popup on the page, such as a Dropdown menu or a date picker's calendar, leaves the toast up.\n- A toast is a notification rather than a layer, so while a [Modal](https://bestax.io/docs/api/components/modal), [Dialog](https://bestax.io/docs/api/components/dialog), [Sidebar](https://bestax.io/docs/api/components/sidebar) or full-page [Loading](https://bestax.io/docs/api/components/loading) is open, Escape goes to that and the toast stays up. Once none is open, Escape dismisses the toast.\n- In forced colors (Windows' contrast themes), which drop the toast's shadow and paint its fill in the page's own color, the toast gets a one pixel edge in the system's text color, and the cancel button's text shows at full strength. A toast given a `tabIndex` shows the browser's focus ring in place of that edge while it has keyboard focus.",
|
|
38
38
|
"related": ["Dialog"],
|
|
39
39
|
"storybook": "https://bestax.io/storybook/?path=/story/components-toast",
|
|
40
40
|
"summary": "The `Toast` component provides brief notification messages with optional action and cancel buttons.",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"code": "function example() {\n const [open, setOpen] = useState(false);\n const searchRef = React.useRef<HTMLInputElement>(null);\n const tips = [\n { id: 'search', title: 'Search', body: 'Find any row by name.' },\n { id: 'done', title: 'That’s it', body: 'Open this tour again any time.' },\n ];\n\n return (\n <>\n <Input ref={searchRef} label=\"Search\" />\n <Button mt=\"3\" onClick={() => setOpen(true)}>\n Show me\n </Button>\n <Tour open={open} onOpenChange={setOpen}>\n {tips.map(tip => (\n <Tour.Step\n key={tip.id}\n target={tip.id === 'search' ? searchRef : undefined}\n title={tip.title}\n >\n {tip.body}\n </Tour.Step>\n ))}\n </Tour>\n </>\n );\n}"
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
|
-
"accessibility": "There's no WAI-ARIA pattern for a tour, so each step is a\n[dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/), modal with the overlay and\nnon-modal without it:\n\n- A step is a `role=\"dialog\"`, named by its title through `aria-labelledby`, or by an `aria-label`\n on the `Tour.Step`, and described by its body. A development build warns about a step with\n neither a title nor a label.\n- With the overlay, the step has `aria-modal=\"true\"`, and the page under it is out of reach for\n everyone: everything else on the page is `inert`, the page doesn't scroll, the overlay takes\n every click, and Tab and Shift+Tab stay in the step. The target is out of reach too, so say in\n the step's body what it is: the spotlight tells a screen reader nothing.\n- Without the overlay, nothing claims modality. The page and the target stay usable, by pointer\n and keyboard alike: Tab from the step's last control moves focus to the target, to its first\n control or the target itself when it takes focus, and Shift+Tab goes where the browser sends it. Escape ends the tour\n while focus is in the step, so an Escape meant for a field on the page stays with it.\n- Opening moves focus to Next, or, on a step without one that takes focus, to the footer's first\n control, else the body's, else the close button. Ending the tour hands focus back to whatever had it when the tour\n opened. On a step change, focus stays on the control used, so Enter on Next keeps going, and\n goes back to where the step starts when that control is gone, as Back is on the first step.\n- After each step change, a polite `role=\"status\"` line inside the step says where the tour is,\n \"Step 2 of 5: Filters\", since a dialog whose name changes isn't announced again.\n- <kbd>ArrowRight</kbd> and <kbd>ArrowLeft</kbd> press the step's Next and Back while focus is in\n the step, swapped under right-to-left text, but not from a text field, another control that\n uses the arrows, or a dialog inside the step. A step whose Next or Back is missing, hidden or\n disabled ignores that key, and nothing happens past either end: ArrowRight doesn't finish the\n tour. The key presses the button as a click does, so a Next or Back given `type=\"submit\"`\n submits its form.\n- Skip and the close button always end the tour, so a modal step is never a keyboard trap, and\n <kbd>Escape</kbd> does too unless `closeOnEscape={false}`. A Modal or Dialog opened from a step\n takes Escape and Tab until it closes.\n- The scroll to a target is the only motion: the spotlight and the step move with the target\n rather than glide after it, and under `prefers-reduced-motion: reduce` the scroll is instant.\n- With `mode=\"beacon\"`, the beacons are real `<button>`s with `aria-haspopup=\"dialog\"` and\n `aria-expanded=\"false\"`, in one `role=\"group\"` named \"Tips\", in step order after the page's\n content. Each is named \"Show tip\" and its step's title, has a hit area of at least 24 by 24\n pixels, and stops pulsing under `prefers-reduced-motion: reduce`. Showing them moves no focus,\n and closing a beacon's step hands focus back to its beacon.\n- In forced colors, the overlay keeps dimming the page, since it's an SVG fill, the spotlight gets\n a `Highlight` outline, and the step keeps its border.\n\nA tour sits at the modal layer, under toasts. In a modal step, a popup that renders through a portal\nof its own, such as a Popover with `appendToBody` or a picker's calendar, renders inside the step,\nas it does in a Modal, so it shows over the tour and stays reachable. A `ConfigProvider`'s\n`portalContainer` still comes first, there as in a Modal. A step without the overlay\nleaves it in `<body>`, under the tour, so keep such content in place inside a non-modal step.",
|
|
54
|
+
"accessibility": "There's no WAI-ARIA pattern for a tour, so each step is a\n[dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/), modal with the overlay and\nnon-modal without it:\n\n- A step is a `role=\"dialog\"`, named by its title through `aria-labelledby`, or by an `aria-label`\n on the `Tour.Step`, and described by its body. A development build warns about a step with\n neither a title nor a label.\n- With the overlay, the step has `aria-modal=\"true\"`, and the page under it is out of reach for\n everyone: everything else on the page is `inert`, the page doesn't scroll, the overlay takes\n every click, and Tab and Shift+Tab stay in the step. The target is out of reach too, so say in\n the step's body what it is: the spotlight tells a screen reader nothing.\n- Without the overlay, nothing claims modality. The page and the target stay usable, by pointer\n and keyboard alike: Tab from the step's last control moves focus to the target, to its first\n control or the target itself when it takes focus, and Shift+Tab goes where the browser sends it. Escape ends the tour\n while focus is in the step, so an Escape meant for a field on the page stays with it.\n- Opening moves focus to Next, or, on a step without one that takes focus, to the footer's first\n control, else the body's, else the close button. Ending the tour hands focus back to whatever had it when the tour\n opened. On a step change, focus stays on the control used, so Enter on Next keeps going, and\n goes back to where the step starts when that control is gone, as Back is on the first step.\n- After each step change, a polite `role=\"status\"` line inside the step says where the tour is,\n \"Step 2 of 5: Filters\", since a dialog whose name changes isn't announced again.\n- <kbd>ArrowRight</kbd> and <kbd>ArrowLeft</kbd> press the step's Next and Back while focus is in\n the step, swapped under right-to-left text, but not from a text field, another control that\n uses the arrows, or a dialog inside the step. A step whose Next or Back is missing, hidden or\n disabled ignores that key, and nothing happens past either end: ArrowRight doesn't finish the\n tour. The key presses the button as a click does, so a Next or Back given `type=\"submit\"`\n submits its form.\n- Skip and the close button always end the tour, so a modal step is never a keyboard trap, and\n <kbd>Escape</kbd> does too unless `closeOnEscape={false}`. The close button is a\n [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility), with a target at least 24px square around its circle. A Modal or Dialog opened from a step\n takes Escape and Tab until it closes.\n- The scroll to a target is the only motion: the spotlight and the step move with the target\n rather than glide after it, and under `prefers-reduced-motion: reduce` the scroll is instant.\n- With `mode=\"beacon\"`, the beacons are real `<button>`s with `aria-haspopup=\"dialog\"` and\n `aria-expanded=\"false\"`, in one `role=\"group\"` named \"Tips\", in step order after the page's\n content. Each is named \"Show tip\" and its step's title, has a hit area of at least 24 by 24\n pixels, and stops pulsing under `prefers-reduced-motion: reduce`. Showing them moves no focus,\n and closing a beacon's step hands focus back to its beacon.\n- In forced colors, the overlay keeps dimming the page, since it's an SVG fill, the spotlight gets\n a `Highlight` outline, and the step keeps its border.\n\nA tour sits at the modal layer, under toasts. In a modal step, a popup that renders through a portal\nof its own, such as a Popover with `appendToBody` or a picker's calendar, renders inside the step,\nas it does in a Modal, so it shows over the tour and stays reachable. A `ConfigProvider`'s\n`portalContainer` still comes first, there as in a Modal. A step without the overlay\nleaves it in `<body>`, under the tour, so keep such content in place inside a non-modal step.",
|
|
55
55
|
"related": [
|
|
56
56
|
"LocaleProvider",
|
|
57
57
|
"Modal",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "<LocaleProvider locale=\"ar\" dir=\"rtl\">\n <TreeSelect\n label=\"المجلد\"\n defaultValue=\"invoices\"\n clearable\n data={[\n {\n value: 'docs',\n label: 'المستندات',\n children: [{ value: 'invoices', label: 'الفواتير' }],\n },\n { value: 'photos', label: 'الصور' },\n ]}\n />\n</LocaleProvider>"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' is: `role=\"combobox\"`\n with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the panel is open,\n named by its `label`. It's read-only, and in `'single'` its value is the picked item's label.\n In the checkbox modes it's described by the tags.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked item, its branch open, or onto the search box when\n `searchable`, or else onto the first item. It holds focus while it's open, as the date\n pickers' panel does: Tab and Shift+Tab move between the search box and the tree, and wrap.\n Escape and Alt+Up close it and put focus back on the field, and so does a pick in `'single'`.\n A press outside closes it and leaves focus where the press put it.\n- **The tree** is TreeView's, with the same name as the panel: real focus with one tab stop, the\n arrow keys, Home, End, `*` and type-ahead, Right and Left swapped on a right-to-left page,\n `aria-level`, `aria-posinset` and `aria-setsize` on every item, `aria-selected` in `'single'`,\n `aria-checked` in the checkbox modes (`\"mixed\"` only in `'checkbox'`), and disabled items\n reachable and `aria-disabled`. Space joins a type-ahead search under way when an item starts\n with what's been typed and a space, so \"new y\" reaches \"New York\", and otherwise picks or\n checks. See [`TreeView`](https://bestax.io/docs/api/components/treeview#accessibility).\n- **The search box** is named \"Search\", or `labels.search`. When nothing matches, `empty` is said\n once through a polite status region, not again on every key.\n- **Each tag's button** is a `Delete` named \"Remove\" and the item's label, or `ariaCloseLabel`\n described by the tag's label.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the tree keep their edges in system colors, and the\n chevron is text.\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 field through `aria-describedby`, after any ids you pass there and, with checkboxes, after the picked tags.\n- `aria-invalid` and `aria-errormessage` go on the field, while the other attributes you pass go on the wrapper, so a screen reader hears the field is invalid when it takes focus.",
|
|
61
|
+
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' is: `role=\"combobox\"`\n with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the panel is open,\n named by its `label`. It's read-only, and in `'single'` its value is the picked item's label.\n In the checkbox modes it's described by the tags.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The clear button** is a [`Delete`](https://bestax.io/docs/api/elements/delete#accessibility) named \"Clear\", or\n `labels.clear`. Its target is a box at least 24px square around the circle, over the field, so\n a press just beside a small circle clears the field rather than opening the panel.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked item, its branch open, or onto the search box when\n `searchable`, or else onto the first item. It holds focus while it's open, as the date\n pickers' panel does: Tab and Shift+Tab move between the search box and the tree, and wrap.\n Escape and Alt+Up close it and put focus back on the field, and so does a pick in `'single'`.\n A press outside closes it and leaves focus where the press put it.\n- **The tree** is TreeView's, with the same name as the panel: real focus with one tab stop, the\n arrow keys, Home, End, `*` and type-ahead, Right and Left swapped on a right-to-left page,\n `aria-level`, `aria-posinset` and `aria-setsize` on every item, `aria-selected` in `'single'`,\n `aria-checked` in the checkbox modes (`\"mixed\"` only in `'checkbox'`), and disabled items\n reachable and `aria-disabled`. Space joins a type-ahead search under way when an item starts\n with what's been typed and a space, so \"new y\" reaches \"New York\", and otherwise picks or\n checks. See [`TreeView`](https://bestax.io/docs/api/components/treeview#accessibility).\n- **The search box** is named \"Search\", or `labels.search`. When nothing matches, `empty` is said\n once through a polite status region, not again on every key.\n- **Each tag's button** is a `Delete` named \"Remove\" and the item's label, or `ariaCloseLabel`\n described by the tag's label, with a target at least 24px square around its circle.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the tree keep their edges in system colors, and the\n chevron is text.\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 field through `aria-describedby`, after any ids you pass there and, with checkboxes, after the picked tags.\n- `aria-invalid` and `aria-errormessage` go on the field, while the other attributes you pass go on the wrapper, so a screen reader hears the field is invalid when it takes focus.",
|
|
62
62
|
"related": ["Combobox", "DateInput", "Select", "TreeView", "useBulmaClasses"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-treeselect--default",
|
|
64
64
|
"summary": "The `TreeSelect` component is a form field whose options are a tree, such as categories, places or teams: it opens a panel holding a real `TreeView`, picks one item or checks a branch at a time, and searches labels. The field is a read-only `role=\"combobox\"` that opens a dialog, wired as DateInput's is, so focus moves into the tree for real and the tree keeps TreeView's keys, type-ahead and spoken output. The tree is given as `data`, so the field and the tags can name what's picked while the panel is shut, and on the server. `selectionMode` picks the kind. `'single'` picks one item and closes. With `'checkbox'`, a check reaches every enabled item under it, closed or hidden by a search, and `checkedStrategy` decides what the value holds: the leaves, the topmost checked items or every one. With `'checkbox-independent'`, each box is its own item's, so a parent means itself alone (Mantine's and Ant Design's `checkStrictly`). The value shows as tags under the field. A value no node has is kept and shown as it is, with a warning in development, so a value under a branch that hasn't loaded survives until it does.",
|
|
@@ -144,8 +144,13 @@ code per the references, or deliberately keep the old markup with `className` st
|
|
|
144
144
|
its own `aria-label` names, becomes `Icon` too, which hides it, since the label is what a
|
|
145
145
|
screen reader reads there. Font Awesome 6's long style names (`fa-brands`) become the
|
|
146
146
|
`bestax-icons` skill's `variant` (`brands`), which renders the short name (`fab`), the same
|
|
147
|
-
style.
|
|
148
|
-
which style nothing under v1, become `m="0"` and `p="0"`.
|
|
147
|
+
style. Bulma 0.9's `is-marginless` and `is-paddingless`,
|
|
148
|
+
which style nothing under v1, become `m="0"` and `p="0"`. A loading `.button` becomes
|
|
149
|
+
`Button isLoading`, which also tells a screen reader it's busy and drops a click while it
|
|
150
|
+
loads. And a `.delete` becomes `Delete`, which holds an empty, hidden `<span>` that bestax's
|
|
151
|
+
stylesheet makes a 24px target around the same circle; under Bulma's own stylesheet it does
|
|
152
|
+
nothing.
|
|
153
|
+
Everything else stays as written, with a
|
|
149
154
|
TODO when there is something to decide. Static class strings convert, and so does a `clsx` or
|
|
150
155
|
`classnames` call of strings and conditional classes, where a condition on a flag becomes
|
|
151
156
|
its prop (`isLoading={busy}`);
|
|
@@ -179,8 +179,9 @@ Notes:
|
|
|
179
179
|
edge there from the desktop breakpoint up as a CanvasText outline, where Bulma's shadow is
|
|
180
180
|
dropped, marks the active item there
|
|
181
181
|
with a bar in the system's highlight color, where Bulma's colors for it are replaced, keeps a
|
|
182
|
-
`fixed` navbar in place while an overlay locks the page's scrolling,
|
|
183
|
-
|
|
182
|
+
`fixed` navbar in place while an overlay locks the page's scrolling, pads the page's scroll by
|
|
183
|
+
a `fixed` navbar's height so a control that takes focus doesn't scroll under it, gives an
|
|
184
|
+
active item's text the invert of the link color it sits on, where Bulma's leaves it in the navbar's text
|
|
184
185
|
color, draws a navbar in a colored `Hero` in the hero's colors, where Bulma's draws its active item and burger in the link
|
|
185
186
|
color, and, in a build with a class prefix, draws a dropdown's active link row, other than a tab, as it draws without one,
|
|
186
187
|
where Bulma's draws it as a plain row), so an app using `Navbar` needs both, in either order. `AppFrame.Burger` renders `Navbar.Burger`, so a build with one
|
|
@@ -295,8 +296,8 @@ Notes:
|
|
|
295
296
|
- `Lightbox`'s viewer is Bulma's modal, with Bulma buttons for its controls and a `Loader` for a
|
|
296
297
|
slow image, so an app using it needs `bulma/sass/components/modal`,
|
|
297
298
|
`bulma/sass/elements/button` and `bulma/sass/elements/loader` next to
|
|
298
|
-
`scss/components/lightbox`, and the `delete` partial below for its close button
|
|
299
|
-
colors.
|
|
299
|
+
`scss/components/lightbox`, and the `delete` partial below for its close button's target and
|
|
300
|
+
forced colors.
|
|
300
301
|
- `Loader` is stock Bulma styled by `bulma/sass/elements/loader`, and the `isLoading`
|
|
301
302
|
spinners on `Button`, `Control` and `Select` are Bulma's too. The `loader` extras partial
|
|
302
303
|
stops all of them under `prefers-reduced-motion: reduce`, hides everything inside a loading
|
|
@@ -338,9 +339,11 @@ Notes:
|
|
|
338
339
|
exception, since `bulma/sass/components/modal` draws that one itself. Bulma draws the circle and
|
|
339
340
|
cross as background colors, which forced colors (Windows' contrast themes) replaces, so they
|
|
340
341
|
vanish there. The `delete` extras partial keeps them drawn in the system's button colors, and
|
|
341
|
-
the `Modal`'s floating close and `Tag isDelete` (`bulma/sass/elements/tag`) with them
|
|
342
|
-
|
|
343
|
-
Bulma's
|
|
342
|
+
the `Modal`'s floating close and `Tag isDelete` (`bulma/sass/elements/tag`) with them. It also
|
|
343
|
+
gives the delete button and the floating close a target at least 24px square around the circle,
|
|
344
|
+
WCAG 2.5.8's minimum, where Bulma's is 20px or 16px small, so without it a press just beside
|
|
345
|
+
the circle misses. Include it (`as bestax-delete`) in any build that shows a close button. Its
|
|
346
|
+
rules win over Bulma's either way, so the order of the `@use` lines does not matter.
|
|
344
347
|
- `Button` is stock Bulma too (`bulma/sass/elements/button`). Bulma shows a focused button with its
|
|
345
348
|
border and a shadow, which a ghost button doesn't have and a static one doesn't show, and forced
|
|
346
349
|
colors (Windows' contrast themes) drops the shadow and sets the border's color, so a focused
|
|
@@ -503,7 +506,7 @@ Scaffolded with an icon library, the starter also needs `bulma/sass/elements/ico
|
|
|
503
506
|
@use '@allxsmith/bestax-bulma/scss/components/card' as bestax-card; // the edge and header line in forced colors
|
|
504
507
|
@use '@allxsmith/bestax-bulma/scss/elements/box' as bestax-box; // the edge in forced colors
|
|
505
508
|
@use '@allxsmith/bestax-bulma/scss/elements/button' as bestax-button; // focus outline and edge in forced colors
|
|
506
|
-
@use '@allxsmith/bestax-bulma/scss/elements/delete' as bestax-delete; // the close button in forced colors
|
|
509
|
+
@use '@allxsmith/bestax-bulma/scss/elements/delete' as bestax-delete; // the close button's target, and in forced colors
|
|
507
510
|
@use '@allxsmith/bestax-bulma/scss/elements/notification' as bestax-notification; // text clears the close button
|
|
508
511
|
```
|
|
509
512
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-mcp",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.88",
|
|
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.78.
|
|
45
|
+
"@allxsmith/bestax-bulma": "^5.78.10"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^26.6.6",
|