bestax-mcp 1.18.74 → 1.18.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/catalog.json +9 -9
- package/data/components/Autocomplete.json +4 -4
- package/data/components/Badge.json +3 -3
- package/data/components/Button.json +1 -1
- package/data/components/Card.json +1 -1
- package/data/components/Carousel.json +14 -1
- package/data/components/ColorPicker.json +1 -1
- package/data/components/Combobox.json +1 -1
- package/data/components/Command.json +1 -1
- package/data/components/Control.json +3 -3
- package/data/components/CopyButton.json +1 -1
- package/data/components/DateInput.json +3 -3
- package/data/components/DateTimeInput.json +5 -5
- package/data/components/Field.json +4 -4
- package/data/components/IconButton.json +1 -1
- package/data/components/Input.json +3 -3
- package/data/components/LinkButton.json +1 -1
- package/data/components/Navbar.json +2 -2
- package/data/components/Numberinput.json +4 -4
- package/data/components/Panel.json +12 -8
- package/data/components/PasswordInput.json +2 -2
- package/data/components/SegmentedControl.json +1 -1
- package/data/components/Select.json +4 -4
- package/data/components/Slider.json +1 -1
- package/data/components/Taginput.json +16 -3
- package/data/components/TextArea.json +3 -3
- package/data/components/TimeInput.json +5 -5
- package/data/components/Toast.json +1 -1
- package/data/components/ToggleButton.json +1 -1
- package/data/skills/bestax-form/SKILL.md +14 -3
- package/data/skills/bestax-form/references/api.md +2 -2
- package/data/skills/bestax-migrate/references/bulma-classes/unmappables.md +4 -0
- package/data/skills/bestax-optimize/SKILL.md +2 -1
- package/data/skills/bestax-optimize/references/modular-build.md +21 -7
- package/data/skills/bestax-theming/references/css-variables.md +10 -1
- package/data/skills/bestax-theming/references/themeable-components.md +2 -2
- package/package.json +2 -2
package/data/catalog.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"generatedFrom": {
|
|
4
4
|
"package": "@allxsmith/bestax-bulma",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.78.0"
|
|
6
6
|
},
|
|
7
7
|
"docsBase": "https://bestax.io/docs",
|
|
8
8
|
"categories": [
|
|
@@ -330,8 +330,8 @@
|
|
|
330
330
|
"slug": "components/carousel",
|
|
331
331
|
"import": "import { Carousel, CarouselItem } from '@allxsmith/bestax-bulma';",
|
|
332
332
|
"compound": false,
|
|
333
|
-
"propCount":
|
|
334
|
-
"exampleCount":
|
|
333
|
+
"propCount": 32,
|
|
334
|
+
"exampleCount": 17
|
|
335
335
|
},
|
|
336
336
|
{
|
|
337
337
|
"name": "Cascader",
|
|
@@ -1123,7 +1123,7 @@
|
|
|
1123
1123
|
"import": "import { Panel } from '@allxsmith/bestax-bulma';",
|
|
1124
1124
|
"compound": true,
|
|
1125
1125
|
"propCount": 37,
|
|
1126
|
-
"exampleCount":
|
|
1126
|
+
"exampleCount": 5
|
|
1127
1127
|
},
|
|
1128
1128
|
{
|
|
1129
1129
|
"name": "Paragraph",
|
|
@@ -1496,8 +1496,8 @@
|
|
|
1496
1496
|
"slug": "form/taginput",
|
|
1497
1497
|
"import": "import { Taginput } from '@allxsmith/bestax-bulma';",
|
|
1498
1498
|
"compound": false,
|
|
1499
|
-
"propCount":
|
|
1500
|
-
"exampleCount":
|
|
1499
|
+
"propCount": 49,
|
|
1500
|
+
"exampleCount": 14
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
1503
|
"name": "Tags",
|
|
@@ -3940,7 +3940,7 @@
|
|
|
3940
3940
|
"PanelBlock": {
|
|
3941
3941
|
"component": "Panel",
|
|
3942
3942
|
"path": "Panel.Block",
|
|
3943
|
-
"purpose": "Individual panel block (renders as `<a class=\"panel-block\">` unless `as` says otherwise)"
|
|
3943
|
+
"purpose": "Individual panel block (renders as `<a class=\"panel-block\">` unless `as` says otherwise)."
|
|
3944
3944
|
},
|
|
3945
3945
|
"PanelButtonBlock": {
|
|
3946
3946
|
"component": "Panel",
|
|
@@ -3965,12 +3965,12 @@
|
|
|
3965
3965
|
"PanelInputBlock": {
|
|
3966
3966
|
"component": "Panel",
|
|
3967
3967
|
"path": "Panel.InputBlock",
|
|
3968
|
-
"purpose": "Search input with icon (renders as `<div class=\"panel-block\">`)"
|
|
3968
|
+
"purpose": "Search input with icon (renders as `<div class=\"panel-block\">` around the `<input>`)."
|
|
3969
3969
|
},
|
|
3970
3970
|
"PanelTabs": {
|
|
3971
3971
|
"component": "Panel",
|
|
3972
3972
|
"path": "Panel.Tabs",
|
|
3973
|
-
"purpose": "Panel tabs (renders as `<p class=\"panel-tabs\">`)"
|
|
3973
|
+
"purpose": "Panel tabs (renders as `<p class=\"panel-tabs\">`)."
|
|
3974
3974
|
},
|
|
3975
3975
|
"PasswordInputBase": {
|
|
3976
3976
|
"component": "PasswordInput",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Fruit\"\n labelProps={{\n htmlFor: 'fruit-field-control',\n id: 'fruit-field-control-label',\n }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"search\">\n <Autocomplete\n id=\"fruit-field-control\"\n data={['Apple', 'Banana', 'Cherry']}\n placeholder=\"Search fruit...\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"accessibility": "- The `label` prop is automatically associated with the inner text input (`htmlFor` plus a generated `id`, or your own `id` if you pass one), so clicking the label focuses the input and assistive technology announces it. Inside a labeled `Field`, that `Field`'s label names the input instead when it points at it: a `Field` that is not `grouped` or `hasAddons` points it there on its own when the Autocomplete has no `id` and no inner `Field` sits between them, and a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- Uses `role=\"combobox\"` with `aria-expanded`, which is true only while the list is on screen. When nothing matches, the dropdown shows the `empty` content but no list, so it stays false\n- Has `aria-haspopup=\"listbox\"` and `aria-autocomplete=\"list\"`, and, while the list is on screen, `aria-controls` pointing at it\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted option as the arrow keys move it. Clicking an option leaves focus in the input too, with the picked value in it\n- The list is a `role=\"listbox\"` named through `aria-labelledby` by the label that names the input, when that label has an id: the `label` prop's label always has one, and so does a `Field`'s label that the `Field` wires itself. A `Field` label you wire by hand with `labelProps.htmlFor`, which is how a horizontal form names an Autocomplete in an inner `Field`, needs an `id` in its `labelProps` as well. Otherwise the list falls back to `aria-label=\"Suggestions\"
|
|
61
|
+
"accessibility": "- The `label` prop is automatically associated with the inner text input (`htmlFor` plus a generated `id`, or your own `id` if you pass one), so clicking the label focuses the input and assistive technology announces it. Inside a labeled `Field`, that `Field`'s label names the input instead when it points at it: a `Field` that is not `grouped` or `hasAddons` points it there on its own when the Autocomplete has no `id` and no inner `Field` sits between them, and a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- Uses `role=\"combobox\"` with `aria-expanded`, which is true only while the list is on screen. When nothing matches, the dropdown shows the `empty` content but no list, so it stays false\n- Has `aria-haspopup=\"listbox\"` and `aria-autocomplete=\"list\"`, and, while the list is on screen, `aria-controls` pointing at it\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted option as the arrow keys move it. Clicking an option leaves focus in the input too, with the picked value in it\n- The list is a `role=\"listbox\"` named through `aria-labelledby` by the label that names the input, when that label has an id: the `label` prop's label always has one, and so does a `Field`'s label that the `Field` wires itself. A `Field` label you wire by hand with `labelProps.htmlFor`, which is how a horizontal form names an Autocomplete in an inner `Field`, needs an `id` in its `labelProps` as well. Otherwise the list falls back to `aria-label=\"Suggestions\"`, or `labels.suggestions` in your language\n- The list holds only the options. The `header`, `footer` and `empty` content sit beside it in the dropdown, so a screen reader doesn't count them as options\n- When the user's typing leaves nothing that matches, the `empty` text is announced through a polite `role=\"status\"` region. That region is in the page from the start, so it's there before the message arrives. It's said once each time the matches run out, not again on every keystroke while they stay out, and the next search that comes up empty is announced too: after matches come back, after the field is emptied, or after the list closes and the user types again\n- While `loading` is on, or a `Control` with `isLoading` around the Autocomplete, the announcement waits, so the `empty` text that shows while results are on their way isn't read out. It's said once loading ends with nothing matching, for each search that comes back empty. Pass `loading` while you fetch results, as the async story in Storybook does\n- Focusing the field, opening the list with `openOnFocus` or `↓`, or emptying the field announces nothing. Without `empty`, nothing is announced at all, since there's no built-in message to say\n- `empty` is a message, so keep it to text. `Tab` closes the list, so a keyboard user can't reach a link or a button in it\n- Keep that message static, like \"No results found\". Its text is read when the matches first run out and isn't read again while they stay out, so a message that names the query, like \"No results for xyz\", is only heard for the query that ran them out\n- Dropdown items use `role=\"option\"`, and the highlighted one is `aria-selected` unless it's disabled\n- In forced colors (Windows' contrast themes), which take away the dropdown's shadow and the highlighted option's fill, the open dropdown is drawn with an edge, whether it shows options or the `empty` content, and the highlighted option with an outline in the system's highlight color\n- Disabled items have `aria-disabled`\n- The `clearable` clear button is a native button named \"Clear\", or `labels.clear`: `Tab` from the input reaches it, and `Enter` or `Space` clears the input and puts focus back in it\n- Full keyboard navigation support\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the wrapper, so a screen reader hears the input is invalid when it takes focus.",
|
|
62
62
|
"related": ["Combobox", "Input", "Select", "Taginput"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-autocomplete",
|
|
64
64
|
"summary": "The `Autocomplete` component provides an input field with dropdown suggestions that filter based on user input.",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"name": "label",
|
|
76
76
|
"type": "React.ReactNode",
|
|
77
77
|
"default": null,
|
|
78
|
-
"description": "Field label, associated with the text input via `htmlFor`: through your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose label names the input instead when it points at it. The `Field` points its label there itself when the Autocomplete has no `id` and no inner `Field` sits between them (and the `Field` is not `grouped` or `hasAddons`); a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`. The label naming the input also names the open suggestion list, through `aria-labelledby`, when it has an id: this label always does, and an outer `Field`'s does unless you wired it by hand without an `id` in its `labelProps`. Otherwise the list is named \"Suggestions\".",
|
|
78
|
+
"description": "Field label, associated with the text input via `htmlFor`: through your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose label names the input instead when it points at it. The `Field` points its label there itself when the Autocomplete has no `id` and no inner `Field` sits between them (and the `Field` is not `grouped` or `hasAddons`); a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`. The label naming the input also names the open suggestion list, through `aria-labelledby`, when it has an id: this label always does, and an outer `Field`'s does unless you wired it by hand without an `id` in its `labelProps`. Otherwise the list is named \"Suggestions\", or `labels.suggestions`.",
|
|
79
79
|
"required": false,
|
|
80
80
|
"inherited": false,
|
|
81
81
|
"deprecated": false
|
|
@@ -155,9 +155,9 @@
|
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"name": "labels",
|
|
158
|
-
"type": "{ clear?: string }",
|
|
158
|
+
"type": "{ clear?: string; suggestions?: string }",
|
|
159
159
|
"default": null,
|
|
160
|
-
"description": "The
|
|
160
|
+
"description": "The accessible names it gives its parts, in your app's language. A `LocaleProvider` doesn't change them.",
|
|
161
161
|
"required": false,
|
|
162
162
|
"inherited": false,
|
|
163
163
|
"deprecated": false
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"code": "<Block display=\"flex\" alignItems=\"center\">\n <Badge content={5} color=\"info\" mr=\"2\" />\n <span>new messages</span>\n</Block>"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
"title": "Standalone,
|
|
54
|
-
"code": "function example() {\n const [
|
|
53
|
+
"title": "Standalone, Beside a Control",
|
|
54
|
+
"code": "function example() {\n const [likes, setLikes] = useState(0);\n\n return (\n <Block display=\"flex\" alignItems=\"center\">\n <Button onClick={() => setLikes(n => n + 1)} mr=\"3\">\n Like\n </Button>\n <Badge content={likes} showZero color=\"info\" mr=\"2\" />\n <span>likes</span>\n </Block>\n );\n}"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"title": "Standalone, Pulse",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"code": "<Badge content={<Icon name=\"check\" />} color=\"success\">\n <Avatar name=\"Ada Lovelace\" alt=\"Ada Lovelace, verified\" />\n</Badge>"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"accessibility": "- A count/text badge exposes `role=\"status\"` and an `aria-label` announcing its content.\n- At `content={0}` without `showZero`, the pill is visually hidden but stays mounted as an\n empty `role=\"status\"` node, so a later `0 -> 1` change mutates an existing live region and\n is reliably announced (a live region inserted already populated often isn't).\n- A bare number in a `role=\"status\"` span is not enough context on its own — put the full\n meaning on the anchor itself, e.g. `<Icon ariaLabel=\"Inbox, 4 unread messages\" />` rather than\n relying on the badge to read out just \"4\".\n- A `dot` badge is `aria-hidden`, and only its look tells what it means, so say what a dot means\n in words in the anchor's name: an `Avatar`'s `alt`, an `Icon`'s `ariaLabel`, or the\n `aria-label` of a button it sits on. A standalone dot has no anchor, so say it in text beside\n the dot, as for any standalone badge. An `Icon` passed as `content` with no `ariaLabel` is\n hidden too, so the badge reads\n nothing; name what it means on the anchor as well.\n- `pulse` respects `prefers-reduced-motion: reduce` and renders without animation.\n- **Forced colors:** a badge is drawn as a fill with a ring, and forced colors (Windows' contrast\n themes) paints the fill in the page's own color and drops the ring, so bestax's styles draw a\n count or text badge's edge in the system's text color there, and fill a dot in it, with its ring\n in the page's color. A pulsing badge pulses in the same color. A badge's text stays in the\n contrast theme's colors.\n- Note the two hide mechanisms differ: the Bulma `visibility=\"invisible\"` helper hides the whole\n wrapper (anchor included), while the `invisible` **prop** hides only the badge pill.",
|
|
69
|
+
"accessibility": "- A count/text badge exposes `role=\"status\"` and an `aria-label` announcing its content.\n- At `content={0}` without `showZero`, the pill is visually hidden but stays mounted as an\n empty `role=\"status\"` node, so a later `0 -> 1` change mutates an existing live region and\n is reliably announced (a live region inserted already populated often isn't).\n- A bare number in a `role=\"status\"` span is not enough context on its own — put the full\n meaning on the anchor itself, e.g. `<Icon ariaLabel=\"Inbox, 4 unread messages\" />` rather than\n relying on the badge to read out just \"4\".\n- A `dot` badge is `aria-hidden`, and only its look tells what it means, so say what a dot means\n in words in the anchor's name: an `Avatar`'s `alt`, an `Icon`'s `ariaLabel`, or the\n `aria-label` of a button it sits on. A standalone dot has no anchor, so say it in text beside\n the dot, as for any standalone badge. An `Icon` passed as `content` with no `ariaLabel` is\n hidden too, so the badge reads\n nothing; name what it means on the anchor as well.\n- A badge is a status, not a control: it isn't in the tab order and takes no keys, so a click\n handler on a standalone badge reaches only a pointer. Put the click on a control beside it, as\n [Standalone, Beside a Control](https://bestax.io/docs/api/components/badge#standalone-beside-a-control) does.\n- `pulse` respects `prefers-reduced-motion: reduce` and renders without animation.\n- **Forced colors:** a badge is drawn as a fill with a ring, and forced colors (Windows' contrast\n themes) paints the fill in the page's own color and drops the ring, so bestax's styles draw a\n count or text badge's edge in the system's text color there, and fill a dot in it, with its ring\n in the page's color. A pulsing badge pulses in the same color. A badge's text stays in the\n contrast theme's colors.\n- Note the two hide mechanisms differ: the Bulma `visibility=\"invisible\"` helper hides the whole\n wrapper (anchor included), while the `invisible` **prop** hides only the badge pill.",
|
|
70
70
|
"related": ["Avatar", "Icon", "Tag", "useBulmaClasses"],
|
|
71
71
|
"storybook": "https://bestax.io/storybook/?path=/story/components-badge--unread-count",
|
|
72
72
|
"summary": "The `Badge` component is a small status/count indicator overlaid on the corner of another element, or rendered standalone.",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"code": "function example() {\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const [tag, setTag] = React.useState<string>();\n\n return (\n <>\n <Button color=\"primary\" ref={buttonRef}>\n Target\n </Button>\n <Button ml=\"2\" onClick={() => setTag(buttonRef.current?.tagName)}>\n Read the tag from its ref\n </Button>\n <p>Rendered element: {tag ?? '—'}</p>\n </>\n );\n}"
|
|
105
105
|
}
|
|
106
106
|
],
|
|
107
|
-
"accessibility": "- **Labeling:** Always provide descriptive content for buttons for screen readers.\n- **Icons beside text:** Leave the `Icon` unnamed, so the text alone names the button. The icons in [With an Icon](https://bestax.io/docs/api/elements/button#with-an-icon) write out `aria-hidden=\"true\"`, and `Icon` would render it for them anyway, since they have no `ariaLabel`, `aria-label` or `aria-labelledby` to name them and no `role` or `tabIndex` of their own. A named icon joins the button's name instead, so `ariaLabel=\"Download\"` on the icon of a Download button makes a screen reader announce \"Download Download\".\n- **States:** The `isDisabled` and `disabled` props ensure correct `aria-disabled` and `disabled` attributes.\n- **Loading:** while `isLoading` is set, the button carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`, so a screen reader can tell it won't respond, and a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing: `onClick` doesn't run, a submit button doesn't submit its form, and a click on a link doesn't follow its `href`. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would.\n- **Keyboard:** When rendered as `<a>`, disabled buttons are not focusable.\n- **Focus:** Use `isFocused` and `isActive` for visual feedback, but rely on browser focus for actual accessibility.\n- **Focus ring:** Bulma shows a focused button with its border and a shadow. A ghost button has neither. A loading or static one has no shadow. All a loading one keeps is its border turning the focus color, which on a colored one is drawn on its own fill, and a loading outlined or text one, or a static one, doesn't change at all. Forced colors (Windows' contrast themes) drops the shadow and sets the border's color. So bestax's styles give a focused ghost, loading or static button, and every focused button in forced colors, an outline. `isFocused` draws it too.\n- **Forced colors:** In Windows' contrast themes a colored button keeps a 1px border, so it still has an edge when the theme replaces its fill, while an outlined button and a `text` one are left as they are. A button with Bulma's `is-selected`, such as a pressed [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton) or the selected button of a `Buttons hasAddons` row, is drawn in the system's highlight colors there, since the fill that marks it is replaced, and a disabled one in the system's color for a disabled control, filled.\n- **Outlined on the dark scheme:** bestax's styles draw an outlined button's label and border at the lightness Bulma picks for its color's text on the page wherever that's lighter than the color's own, so a dark color, such as Bulma's link or bestax's blue primary, reads on the dark page. On a light page an outlined button keeps its color's own lightness. On a surface that stays light on both schemes, such as `bgColor=\"white\"`, give the surface Bulma's `theme-light` class (`bestax-theme-light` under the `bestax-` prefix), which keeps what's inside it on the light scheme's values.\n- **Static labels:** `isStatic` only styles the button, so a `<button>` with it is still a tab stop that a screen reader announces as a button. Render a label that does nothing, such as an addon's \"@gmail.com\", `as=\"span\"`.\n- **Toggles:** `isActive` tells a screen reader nothing. A button that turns something on or off is a [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which sets `aria-pressed`.\n\n:::note\nA button that shows only an icon is an [`IconButton`](https://bestax.io/docs/api/elements/iconbutton), whose types require an\n`aria-label` or an `aria-labelledby`, and whose `isRounded` makes a circle. On a plain `Button` holding only\nan icon, name it with `aria-label` yourself.\n:::",
|
|
107
|
+
"accessibility": "- **Labeling:** Always provide descriptive content for buttons for screen readers.\n- **Icons beside text:** Leave the `Icon` unnamed, so the text alone names the button. The icons in [With an Icon](https://bestax.io/docs/api/elements/button#with-an-icon) write out `aria-hidden=\"true\"`, and `Icon` would render it for them anyway, since they have no `ariaLabel`, `aria-label` or `aria-labelledby` to name them and no `role` or `tabIndex` of their own. A named icon joins the button's name instead, so `ariaLabel=\"Download\"` on the icon of a Download button makes a screen reader announce \"Download Download\".\n- **States:** The `isDisabled` and `disabled` props ensure correct `aria-disabled` and `disabled` attributes.\n- **Loading:** while `isLoading` is set, the button carries `aria-busy=\"true\"` and `aria-disabled=\"true\"`, so a screen reader can tell it won't respond, and a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing: `onClick` doesn't run, a submit button doesn't submit its form, and a click on a link doesn't follow its `href`. It keeps focus, since `aria-disabled` doesn't take it away the way `disabled` would.\n- **Keyboard:** When rendered as `<a>`, disabled buttons are not focusable.\n- **Focus:** Use `isFocused` and `isActive` for visual feedback, but rely on browser focus for actual accessibility.\n- **Focus ring:** Bulma shows a focused button with its border and a shadow. A ghost button has neither. A loading or static one has no shadow. All a loading one keeps is its border turning the focus color, which on a colored one is drawn on its own fill, and a loading outlined or text one, or a static one, doesn't change at all. Forced colors (Windows' contrast themes) drops the shadow and sets the border's color. So bestax's styles give a focused ghost, loading or static button, and every focused button in forced colors, an outline. `isFocused` draws it too.\n- **Forced colors:** In Windows' contrast themes a colored button keeps a 1px border, so it still has an edge when the theme replaces its fill, while an outlined button and a `text` one are left as they are. Bulma's disabled opacity doesn't apply there, since it would only fade the system's color for a disabled control: a disabled button, one with `disabled` or inside a disabled `<fieldset>`, is drawn in that color at full strength, and so is a link with `isDisabled`. Bulma also dims a link in a disabled `<fieldset>`, and a button in its first `<legend>`, though both still work, so there they're drawn at full strength in their own colors. A button with Bulma's `is-selected`, such as a pressed [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton) or the selected button of a `Buttons hasAddons` row, is drawn in the system's highlight colors there, since the fill that marks it is replaced, and a disabled one in the system's color for a disabled control, filled.\n- **Outlined on the dark scheme:** bestax's styles draw an outlined button's label and border at the lightness Bulma picks for its color's text on the page wherever that's lighter than the color's own, so a dark color, such as Bulma's link or bestax's blue primary, reads on the dark page. On a light page an outlined button keeps its color's own lightness. On a surface that stays light on both schemes, such as `bgColor=\"white\"`, give the surface Bulma's `theme-light` class (`bestax-theme-light` under the `bestax-` prefix), which keeps what's inside it on the light scheme's values.\n- **Static labels:** `isStatic` only styles the button, so a `<button>` with it is still a tab stop that a screen reader announces as a button. Render a label that does nothing, such as an addon's \"@gmail.com\", `as=\"span\"`.\n- **Toggles:** `isActive` tells a screen reader nothing. A button that turns something on or off is a [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which sets `aria-pressed`.\n\n:::note\nA button that shows only an icon is an [`IconButton`](https://bestax.io/docs/api/elements/iconbutton), whose types require an\n`aria-label` or an `aria-labelledby`, and whose `isRounded` makes a circle. On a plain `Button` holding only\nan icon, name it with `aria-label` yourself.\n:::",
|
|
108
108
|
"related": [
|
|
109
109
|
"Buttons",
|
|
110
110
|
"CopyButton",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"code": "<Card>\n <Card.Header>\n <Card.Header.Title as=\"p\">Component</Card.Header.Title>\n </Card.Header>\n <Card.Content>Card content goes here.</Card.Content>\n <Card.Footer>\n <Card.FooterItem as=\"a\" href=\"#save\">\n Save\n </Card.FooterItem>\n <Card.FooterItem as=\"a\" href=\"#edit\">\n Edit\n </Card.FooterItem>\n </Card.Footer>\n</Card>"
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
"accessibility": "- **Image alternate text:** An image URL passed as `image` renders an `<img>` whose `alt` is `imageAlt`. Describe what the picture shows, or pass `imageAlt=\"\"` for a decorative image so screen readers skip it. Without `imageAlt`, the `alt` is \"Card image\", which tells a screen reader nothing about the picture. An image you render yourself, as a node in `image` or inside `Card.Image`, takes its own `alt`, and `imageAlt` doesn't reach it.\n- **Header and footer landmarks:** a card's header and footer are Bulma's `<header class=\"card-header\">` and `<footer class=\"card-footer\">`, which `header` or `headerIcon`, `footer`, `Card.Header` and `Card.Footer` render. Outside `<main>`, `<article>`, `<aside>`, `<nav>`, `<section>` and elements with one of their roles, a `<header>` is a banner landmark and a `<footer>` a content info landmark, so a screen reader that lists landmarks lists a banner for each card with a header and a content info for each card with a footer, beside the page's own. Inside one of them they aren't landmarks. Put cards in the page's `<main>`. For a card that can't be there, such as one portaled outside it, give the card `role=\"article\"`, or wrap it in an `<article>`, which scopes them the same way, or, built from the parts, pass `role=\"none\"` to its `Card.Header` and `Card.Footer`, which ARIA in HTML allows on both.\n- Use semantic content for the header, body, and footer as needed.",
|
|
65
|
+
"accessibility": "- **Image alternate text:** An image URL passed as `image` renders an `<img>` whose `alt` is `imageAlt`. Describe what the picture shows, or pass `imageAlt=\"\"` for a decorative image so screen readers skip it. Without `imageAlt`, the `alt` is \"Card image\", which tells a screen reader nothing about the picture. An image you render yourself, as a node in `image` or inside `Card.Image`, takes its own `alt`, and `imageAlt` doesn't reach it.\n- **Header and footer landmarks:** a card's header and footer are Bulma's `<header class=\"card-header\">` and `<footer class=\"card-footer\">`, which `header` or `headerIcon`, `footer`, `Card.Header` and `Card.Footer` render. Outside `<main>`, `<article>`, `<aside>`, `<nav>`, `<section>` and elements with one of their roles, a `<header>` is a banner landmark and a `<footer>` a content info landmark, so a screen reader that lists landmarks lists a banner for each card with a header and a content info for each card with a footer, beside the page's own. Inside one of them they aren't landmarks. Put cards in the page's `<main>`. For a card that can't be there, such as one portaled outside it, give the card `role=\"article\"`, or wrap it in an `<article>`, which scopes them the same way, or, built from the parts, pass `role=\"none\"` to its `Card.Header` and `Card.Footer`, which ARIA in HTML allows on both.\n- Use semantic content for the header, body, and footer as needed.\n- **Forced colors:** in Windows' contrast themes, which drop shadows and paint the card in the\n page's own color, the card's edge is drawn as an outline in the system's text color, so a row of\n cards still shows which image, text and actions belong together. While the card has keyboard\n focus, the browser's focus ring shows in its place. The line under a card's header, from\n `header`, `headerIcon` or `Card.Header`, is a shadow too, and is drawn as a one pixel line in\n the same color inside the header, so nothing moves. CheckboxCard and RadioCard keep the edge they\n draw themselves.",
|
|
66
66
|
"related": ["Icon", "Image", "useBulmaClasses"],
|
|
67
67
|
"storybook": "https://bestax.io/storybook/?path=/story/components-card--default",
|
|
68
68
|
"summary": "The `Card` component renders a Bulma-styled card with optional header, image, content, and footer.",
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
"title": "With Material Design Icons",
|
|
62
62
|
"code": "<Carousel\n ariaLabel=\"Material Design arrows\"\n iconPrev=\"arrow-left\"\n iconNext=\"arrow-right\"\n iconLibrary=\"mdi\"\n>\n <CarouselItem>\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 1</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 2</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
"title": "In Another Language",
|
|
66
|
+
"code": "<Carousel\n lang=\"fr\"\n aria-roledescription=\"carrousel\"\n ariaLabel=\"Couleurs\"\n labels={{\n previous: 'Diapositive précédente',\n next: 'Diapositive suivante',\n indicator: slide => `Aller à la diapositive ${slide}`,\n item: (current, total) => `${current} sur ${total}`,\n }}\n>\n <CarouselItem aria-roledescription=\"diapositive\">\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Diapositive 1</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem aria-roledescription=\"diapositive\">\n <Hero color=\"info\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Diapositive 2</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem aria-roledescription=\"diapositive\">\n <Hero color=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Diapositive 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
67
|
+
},
|
|
64
68
|
{
|
|
65
69
|
"title": "Controlled Carousel",
|
|
66
70
|
"code": "function ControlledExample() {\n const [currentSlide, setCurrentSlide] = useState(0);\n return (\n <Block>\n <Buttons mb=\"4\">\n <Button\n onClick={() => setCurrentSlide(0)}\n color={currentSlide === 0 ? 'primary' : undefined}\n >\n 1\n </Button>\n <Button\n onClick={() => setCurrentSlide(1)}\n color={currentSlide === 1 ? 'primary' : undefined}\n >\n 2\n </Button>\n <Button\n onClick={() => setCurrentSlide(2)}\n color={currentSlide === 2 ? 'primary' : undefined}\n >\n 3\n </Button>\n </Buttons>\n <Carousel\n ariaLabel=\"Controlled slides\"\n value={currentSlide}\n onChange={setCurrentSlide}\n indicator={false}\n >\n <CarouselItem>\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Slide 1</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Slide 2</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Slide 3</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n </Carousel>\n <Paragraph mt=\"2\">Current slide: {currentSlide + 1}</Paragraph>\n </Block>\n );\n}"
|
|
@@ -70,7 +74,7 @@
|
|
|
70
74
|
"code": "<Carousel ariaLabel=\"Slides without repeat\" repeat={false}>\n <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">First (no previous)</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"warning\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph>Middle slide</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Last (no next)</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
71
75
|
}
|
|
72
76
|
],
|
|
73
|
-
"accessibility": "- Uses `role=\"region\"` with `aria-roledescription=\"carousel\"`\n- Name each carousel for what it shows with `ariaLabel`, such as \"Featured products\", and leave the word \"carousel\" out of it, since the role description already says it. Under a visible heading, pass `aria-labelledby` with the heading's id instead, which names it ahead of the `aria-label` the default still sets. The default, \"Image carousel\", is a placeholder: with the role description it says \"carousel\" twice, and every carousel left with it has the same name\n- Each item is a `group` with `aria-roledescription=\"slide\"`, named for its place, such as \"2 of 6\". An item's own `aria-label` or `aria-labelledby` takes the place of that name\n- Items out of view are `aria-hidden` and `inert`, so screen readers skip them and nothing in them takes focus. With several in view, every item in view is exposed. The copies a loop adds at each end of the track follow the same rule, so where the view runs past the last item, the copies on screen are the ones exposed\n- The track is a polite live region, so what comes into view is announced, except while autoplay is moving it (`aria-live=\"off\"`)\n- Autoplay waits while the pointer is over the carousel (with `pauseOnHover`) and while focus is anywhere inside it, on an item, an arrow or an indicator, so nothing moves while someone reads or works it. A browser that leaves focus on an arrow or an indicator a click pressed keeps it waiting until focus moves on. It's a pause, not a stop: once the pointer and focus leave, autoplay goes on\n- When the system asks for reduced motion, each step changes the view at once, with no slide, and a step past either end with `repeat` goes straight to the other end. The arrows and indicators change without a transition too. A drag still follows the pointer, since that's the user's own movement\n- When something else takes the item holding focus out of view (a swipe, a change of width that changes the count, a new controlled `value`, or the item's removal), focus moves to the first item in view rather than dropping to the page\n- Navigation arrows have `aria-label` for screen readers\n- With `arrowBackground={false}`, an arrow with keyboard focus shows Bulma's focus outline, as a ghost `Button` does, in the overlay look too. With `arrowHover`, an arrow shows while keyboard focus is on it\n- Indicators use `role=\"tablist\"` and `role=\"tab\"` semantics, one for each position a step can land on\n- The indicators take Bulma's look: a resting dot, line or bar is filled in the border color and the current one in the primary color, and a circle is a ring in the border color, filled when current. A resting one falls short of the 3:1 against the page that WCAG asks of a graphic. For that, set `--bulma-carousel-indicator-border-color` to a color such as `var(--bulma-text-weak)` on a class you pass through `className`, with the carousel's class in the selector (`.carousel.my-carousel`, `.bestax-carousel.my-carousel` under the prefixed flavor) so it wins whatever order the stylesheets load in. It draws a ring at each resting indicator's edge, circles included, and leaves the current one, and the dots, lines and bars in the overlay look, as they are. Forced colors (Windows' contrast themes) replaces the fills, so there each indicator shows its ring in the buttons' text color and the current one is filled in it.\n- The Left and Right arrow keys move the carousel while focus is on its arrows or indicators, unless Alt, Ctrl or Meta is held, which leaves them to the browser. Inside an item they're left to the item's content, such as a field or a slider. On an indicator they move focus to the indicator beside it and bring its slide into view, as a click on it does\n- Previous/Next buttons are disabled at the ends when not repeating. When the one holding focus is disabled, focus moves to the current indicator, or to the other arrow when there are no indicators. When a focused arrow or indicator goes away, as an indicator does when a change of width leaves fewer positions, focus moves to the current indicator, an arrow that works, or the first item in view, rather than dropping to the page\n- On a right-to-left page the slides run from right to left. The previous arrow sits on the right, at the start of the line, and the next arrow on the left, and the built-in chevrons flip to match. An `iconPrev` or `iconNext` is drawn as you give it. <kbd>ArrowLeft</kbd> and a swipe to the right go to the next slide, the way the track moves.",
|
|
77
|
+
"accessibility": "- Uses `role=\"region\"` with `aria-roledescription=\"carousel\"`\n- Name each carousel for what it shows with `ariaLabel`, such as \"Featured products\", and leave the word \"carousel\" out of it, since the role description already says it. Under a visible heading, pass `aria-labelledby` with the heading's id instead, which names it ahead of the `aria-label` the default still sets. The default, \"Image carousel\", is a placeholder: with the role description it says \"carousel\" twice, and every carousel left with it has the same name\n- Each item is a `group` with `aria-roledescription=\"slide\"`, named for its place, such as \"2 of 6\". An item's own `aria-label` or `aria-labelledby` takes the place of that name\n- Items out of view are `aria-hidden` and `inert`, so screen readers skip them and nothing in them takes focus. With several in view, every item in view is exposed. The copies a loop adds at each end of the track follow the same rule, so where the view runs past the last item, the copies on screen are the ones exposed\n- The track is a polite live region, so what comes into view is announced, except while autoplay is moving it (`aria-live=\"off\"`)\n- Autoplay waits while the pointer is over the carousel (with `pauseOnHover`) and while focus is anywhere inside it, on an item, an arrow or an indicator, so nothing moves while someone reads or works it. A browser that leaves focus on an arrow or an indicator a click pressed keeps it waiting until focus moves on. It's a pause, not a stop: once the pointer and focus leave, autoplay goes on\n- When the system asks for reduced motion, each step changes the view at once, with no slide, and a step past either end with `repeat` goes straight to the other end. The arrows and indicators change without a transition too. A drag still follows the pointer, since that's the user's own movement\n- When something else takes the item holding focus out of view (a swipe, a change of width that changes the count, a new controlled `value`, or the item's removal), focus moves to the first item in view rather than dropping to the page\n- Navigation arrows have `aria-label` for screen readers\n- The arrows', the indicators' and the items' names are English unless `labels` gives the words in the page's language, and the role descriptions take `aria-roledescription` on the `Carousel` and on each `CarouselItem`\n- With `arrowBackground={false}`, an arrow with keyboard focus shows Bulma's focus outline, as a ghost `Button` does, in the overlay look too. With `arrowHover`, an arrow shows while keyboard focus is on it\n- Indicators use `role=\"tablist\"` and `role=\"tab\"` semantics, one for each position a step can land on\n- The indicators take Bulma's look: a resting dot, line or bar is filled in the border color and the current one in the primary color, and a circle is a ring in the border color, filled when current. A resting one falls short of the 3:1 against the page that WCAG asks of a graphic. For that, set `--bulma-carousel-indicator-border-color` to a color such as `var(--bulma-text-weak)` on a class you pass through `className`, with the carousel's class in the selector (`.carousel.my-carousel`, `.bestax-carousel.my-carousel` under the prefixed flavor) so it wins whatever order the stylesheets load in. It draws a ring at each resting indicator's edge, circles included, and leaves the current one, and the dots, lines and bars in the overlay look, as they are. Forced colors (Windows' contrast themes) replaces the fills, so there each indicator shows its ring in the buttons' text color and the current one is filled in it.\n- The Left and Right arrow keys move the carousel while focus is on its arrows or indicators, unless Alt, Ctrl or Meta is held, which leaves them to the browser. Inside an item they're left to the item's content, such as a field or a slider. On an indicator they move focus to the indicator beside it and bring its slide into view, as a click on it does\n- Previous/Next buttons are disabled at the ends when not repeating. When the one holding focus is disabled, focus moves to the current indicator, or to the other arrow when there are no indicators. When a focused arrow or indicator goes away, as an indicator does when a change of width leaves fewer positions, focus moves to the current indicator, an arrow that works, or the first item in view, rather than dropping to the page\n- On a right-to-left page the slides run from right to left. The previous arrow sits on the right, at the start of the line, and the next arrow on the left, and the built-in chevrons flip to match. An `iconPrev` or `iconNext` is drawn as you give it. <kbd>ArrowLeft</kbd> and a swipe to the right go to the next slide, the way the track moves.",
|
|
74
78
|
"related": ["Modal", "Tabs"],
|
|
75
79
|
"storybook": "https://bestax.io/storybook/?path=/story/components-carousel",
|
|
76
80
|
"summary": "The `Carousel` component provides an image/content slider with navigation arrows and indicators.",
|
|
@@ -344,6 +348,15 @@
|
|
|
344
348
|
"inherited": false,
|
|
345
349
|
"deprecated": false
|
|
346
350
|
},
|
|
351
|
+
{
|
|
352
|
+
"name": "labels",
|
|
353
|
+
"type": "CarouselLabels",
|
|
354
|
+
"default": null,
|
|
355
|
+
"description": "The words it writes for its arrows, indicators and items, for another language.",
|
|
356
|
+
"required": false,
|
|
357
|
+
"inherited": false,
|
|
358
|
+
"deprecated": false
|
|
359
|
+
},
|
|
347
360
|
{
|
|
348
361
|
"name": "onChange",
|
|
349
362
|
"type": "(value: number) => void",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"code": "<ColorPicker\n aria-label=\"Accent\"\n format=\"hex\"\n defaultValue=\"#00d1b2\"\n swatches={['#1e6b99', '#00d1b2', '#ff6685', '#ffdd57']}\n>\n <ColorPicker.Swatches />\n <ColorPickerArea />\n <ColorPicker.HueSlider />\n <ColorPicker.Input />\n</ColorPicker>"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"accessibility": "- **The square is one 2D slider made of two native range inputs**, saturation and brightness,\n the way React Aria builds it. Only the input for the axis moved last is a tab stop, and the\n other is hidden until a key moves it, so a screen reader lists one control, \"Saturation and\n brightness, 2D slider\", with value text such as \"Saturation 50%, Brightness 80%\", the moved\n channel first. On a touch device both inputs stay exposed, so a touch screen reader can adjust\n each with its own gestures.\n- **Keys in the square:** the arrows move by 1, with Shift by 10; Page Up and Page Down move\n brightness by 10, and Home and End move saturation by 10. Focus follows the axis a key moved.\n- **The sliders** are native range inputs named \"Hue\" and \"Alpha\", read as \"171 degrees\" and\n \"50%\". The arrows step by 1, with Shift or Page Up and Page Down by 10, and Home and End go to\n the ends.\n- **Right to left,** the horizontal arrows follow the screen.\n- **Pointer:** a press anywhere on the square or a track sets the value there, so nothing needs a\n drag (WCAG 2.5.7), and the sliders, the square and the swatch buttons are at least 24 by 24 CSS\n pixels (WCAG 2.5.8).\n- **Swatches** are a radio group named \"Swatches\": each swatch is a radio named by its label or\n its color, the chosen one checked and marked by a check and a ring as well as its color.\n- **The value is always in words:** the field shows it and takes a typed color, and a value it\n can't read is marked invalid and put back when you leave the field. An `aria-invalid` or\n `aria-errormessage` you give `ColorPicker.Input` goes on that field rather than the row around\n it, so a screen reader hears it with the field.\n- **The group** is named by its `label`, or by `aria-label`.\n- **Strings** come from `labels`, with English defaults.\n- **Forced colors:** the square, the tracks and the swatches keep their colors with an edge in the\n system's text color, and the chosen swatch's ring is drawn in the system's highlight color.\n- **The eye dropper** button is named \"Pick a color from the screen\" and only appears where the\n browser can do it.\n- The `message` describes the group through `aria-describedby`, after any ids you pass there, as the label names it.",
|
|
53
|
+
"accessibility": "- **The square is one 2D slider made of two native range inputs**, saturation and brightness,\n the way React Aria builds it. Only the input for the axis moved last is a tab stop, and the\n other is hidden until a key moves it, so a screen reader lists one control, \"Saturation and\n brightness, 2D slider\", with value text such as \"Saturation 50%, Brightness 80%\", the moved\n channel first. On a touch device both inputs stay exposed, so a touch screen reader can adjust\n each with its own gestures.\n- **Keys in the square:** the arrows move by 1, with Shift by 10; Page Up and Page Down move\n brightness by 10, and Home and End move saturation by 10. Focus follows the axis a key moved.\n- **The sliders** are native range inputs named \"Hue\" and \"Alpha\", read as \"171 degrees\" and\n \"50%\". The arrows step by 1, with Shift or Page Up and Page Down by 10, and Home and End go to\n the ends.\n- **Right to left,** the horizontal arrows follow the screen.\n- **Pointer:** a press anywhere on the square or a track sets the value there, so nothing needs a\n drag (WCAG 2.5.7), and the sliders, the square and the swatch buttons are at least 24 by 24 CSS\n pixels (WCAG 2.5.8).\n- **Swatches** are a radio group named \"Swatches\": each swatch is a radio named by its label or\n its color, the chosen one checked and marked by a check and a ring as well as its color.\n- **The value is always in words:** the field shows it and takes a typed color, and a value it\n can't read is marked invalid and put back when you leave the field. An `aria-invalid` or\n `aria-errormessage` you give `ColorPicker.Input` goes on that field rather than the row around\n it, so a screen reader hears it with the field. Ones you give the `ColorPicker` reach that field\n as well, unless `ColorPicker.Input` has either of its own.\n- **The group** is named by its `label`, or by `aria-label`.\n- **Strings** come from `labels`, with English defaults.\n- **Forced colors:** the square, the tracks and the swatches keep their colors with an edge in the\n system's text color, and the chosen swatch's ring is drawn in the system's highlight color.\n- **The eye dropper** button is named \"Pick a color from the screen\" and only appears where the\n browser can do it.\n- The `message` describes the group through `aria-describedby`, after any ids you pass there, as the label names it.",
|
|
54
54
|
"related": ["ColorSwatch", "Slider", "Theme", "useBulmaClasses"],
|
|
55
55
|
"storybook": "https://bestax.io/storybook/?path=/story/form-colorpicker--default",
|
|
56
56
|
"summary": "The `ColorPicker` component is a panel for choosing a color: a saturation and brightness square, a hue slider, and the value as text, with alpha and swatches when asked for. Every part is operable by keyboard, and the square is two native range inputs, one per axis, with one tab stop. The value is a CSS color string in `format`, HSL by default.",
|
|
@@ -487,7 +487,7 @@
|
|
|
487
487
|
"name": "isLoading",
|
|
488
488
|
"type": "boolean",
|
|
489
489
|
"default": "false",
|
|
490
|
-
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading.",
|
|
490
|
+
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes it, tied to it with `aria-describedby`, which a screen reader reads when the field takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
491
491
|
"required": false,
|
|
492
492
|
"inherited": true,
|
|
493
493
|
"deprecated": false
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
"name": "isLoading",
|
|
266
266
|
"type": "boolean",
|
|
267
267
|
"default": "false",
|
|
268
|
-
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading.",
|
|
268
|
+
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes it, tied to it with `aria-describedby`, which a screen reader reads when the field takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
269
269
|
"required": false,
|
|
270
270
|
"inherited": true,
|
|
271
271
|
"deprecated": false
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "Loading State",
|
|
38
|
-
"code": "<Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" />\n </Control>\n</Field>"
|
|
38
|
+
"code": "<Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" message=\"Loading…\" />\n </Control>\n</Field>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "Loading State with Size Variations",
|
|
42
|
-
"code": "<>\n <Field label=\"Loading Small\">\n <Control isLoading size=\"small\">\n <Input size=\"small\" placeholder=\"Loading small\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Medium\">\n <Control isLoading size=\"medium\">\n <Input size=\"medium\" placeholder=\"Loading medium\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Large\">\n <Control isLoading size=\"large\">\n <Input size=\"large\" placeholder=\"Loading large\" />\n </Control>\n </Field>\n</>"
|
|
42
|
+
"code": "<>\n <Field label=\"Loading Small\">\n <Control isLoading size=\"small\">\n <Input size=\"small\" placeholder=\"Loading small\" message=\"Loading…\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Medium\">\n <Control isLoading size=\"medium\">\n <Input size=\"medium\" placeholder=\"Loading medium\" message=\"Loading…\" />\n </Control>\n </Field>\n\n <Field label=\"Loading Large\">\n <Control isLoading size=\"large\">\n <Input size=\"large\" placeholder=\"Loading large\" message=\"Loading…\" />\n </Control>\n </Field>\n</>"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"title": "Expanded Control",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"name": "isLoading",
|
|
116
116
|
"type": "boolean",
|
|
117
117
|
"default": "false",
|
|
118
|
-
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading.",
|
|
118
|
+
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes the input, select or textarea inside, such as its `message`, or text tied to that control with `aria-describedby`, which a screen reader reads when the control takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
119
119
|
"required": false,
|
|
120
120
|
"inherited": true,
|
|
121
121
|
"deprecated": false
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"code": "<CopyButton value=\"https://bestax.io\" isDisabled />"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"accessibility": "- **The name follows the words:** with its label shown, the button has no `aria-label`, so its name\n is the text on it, \"Copy\" and then \"Copied\", and a voice control user can say what they see\n ([WCAG 2.5.3](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)).\n- **The result is announced:** a change to a focused button's label isn't read out by every screen\n reader and browser pairing, so each copy, and each failure, is also a polite `role=\"status\"`\n message\n ([WCAG 4.1.3](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html), technique\n [ARIA22](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA22)). The region is in the page from\n hydration, well before any click, and is visually hidden. It's portaled to the end of the page,\n or to a `ConfigProvider`'s `portalContainer`, so it isn't a child of the button's `Control` or\n `Buttons` row. Inside an open modal dialog (`aria-modal=\"true\"`), such as a `Modal`, a `Dialog`\n or a `Sidebar` with an overlay, it goes inside the dialog instead, since a screen reader ignores\n a live region behind one. It moves there when the button takes focus or a click. A copy repeated\n while the button still reads \"Copied\" is announced again.\n- **Icon-only, it's still named:** `labels.copy` is its `aria-label` in both states, since there are\n no words to follow, and only the glyph swaps. Give it a name that says what it copies when there\n are several on a page (\"Copy the Production key\").\n- **The glyphs are decorative:** both render `aria-hidden=\"true\"`; the label and the status carry the\n meaning.\n- **Failures aren't hidden:** a copy that didn't happen never shows \"Copied\".\n- **Keyboard and focus:** it's a native `<button type=\"button\">`, so <kbd>Enter</kbd> and\n <kbd>Space</kbd> copy, focus stays on it, and it never submits the form it sits in. While\n `isLoading` is set it copies nothing, as `Button` drops the click, and carries `aria-busy` and\n `aria-disabled`.\n- **Forced colors:** the glyphs are drawn in `currentColor`, so they take the system's button text\n color.",
|
|
53
|
+
"accessibility": "- **The name follows the words:** with its label shown, the button has no `aria-label`, so its name\n is the text on it, \"Copy\" and then \"Copied\", and a voice control user can say what they see\n ([WCAG 2.5.3](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)).\n- **The result is announced:** a change to a focused button's label isn't read out by every screen\n reader and browser pairing, so each copy, and each failure, is also a polite `role=\"status\"`\n message\n ([WCAG 4.1.3](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html), technique\n [ARIA22](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA22)). The region is in the page from\n hydration, well before any click, and is visually hidden. It's portaled to the end of the page,\n or to a `ConfigProvider`'s `portalContainer`, so it isn't a child of the button's `Control` or\n `Buttons` row. Inside an open modal dialog (`aria-modal=\"true\"`), such as a `Modal`, a `Dialog`\n or a `Sidebar` with an overlay, it goes inside the dialog instead, since a screen reader ignores\n a live region behind one. It moves there when the button takes focus or a click. A copy repeated\n while the button still reads \"Copied\" is announced again.\n- **Icon-only, it's still named:** `labels.copy` is its `aria-label` in both states, since there are\n no words to follow, and only the glyph swaps. Give it a name that says what it copies when there\n are several on a page (\"Copy the Production key\").\n- **The glyphs are decorative:** both render `aria-hidden=\"true\"`; the label and the status carry the\n meaning.\n- **Failures aren't hidden:** a copy that didn't happen never shows \"Copied\".\n- **Keyboard and focus:** it's a native `<button type=\"button\">`, so <kbd>Enter</kbd> and\n <kbd>Space</kbd> copy, focus stays on it, and it never submits the form it sits in. While\n `isLoading` is set it copies nothing, as `Button` drops the click, and carries `aria-busy` and\n `aria-disabled`.\n- **Forced colors:** the glyphs are drawn in `currentColor`, so they take the system's button text\n color, and on a disabled one the system's color for a disabled control, at full strength.",
|
|
54
54
|
"related": [
|
|
55
55
|
"Button",
|
|
56
56
|
"Code",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Date\"\n labelProps={{ htmlFor: 'date-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"calendar-alt\">\n <DateInput id=\"date-field-control\" placeholder=\"YYYY-MM-DD\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
179
179
|
}
|
|
180
180
|
],
|
|
181
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date, month or year.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid or year list inside keep their own names.\n- Closing the popover with `Escape` or a pick returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Dismissing without a pick commits nothing: an empty field stays empty, and leaving afterwards commits only what you typed.\n- Calendar uses `role=\"grid\"` with cells as `role=\"gridcell\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today's day, month and year get it once the page hydrates, so the reader's clock decides which.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, month or year, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid or year list and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` on the grid or year list it picks from, and keeps its tab stop and keys.\n- Roving `tabindex` keeps a single grid cell focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- The month grid is a `role=\"grid\"` of `role=\"row\"`s, labelled by the year in its header. Each month cell carries the full month name as its accessible name, `aria-current=\"date\"` for this month and `aria-disabled` for a month with no selectable day.\n- The year list is a `role=\"listbox\"`, named by the `chooseYear` label where it is the selection surface and by the heading that opens it otherwise. As the selection surface its options take `aria-selected` from the value's year rather than from focus, which roves through the list. When the focused year is disabled, the nearest enabled year takes the tab stop, so `Tab` still reaches the list.\n- The launcher and popover are named \"Choose month\" or \"Choose year\" to match the granularity; override them, and the month grid's \"Previous year\" / \"Next year\" buttons, through `labels` (`chooseMonth`, `chooseYear`, `prevYear`, `nextYear`).\n- Honors `prefers-reduced-motion` (skip popover fade-in).\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right. The month names follow the page.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.",
|
|
181
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date, month or year.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid or year list inside keep their own names.\n- Closing the popover with `Escape` or a pick returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Dismissing without a pick commits nothing: an empty field stays empty, and leaving afterwards commits only what you typed.\n- Calendar uses `role=\"grid\"` with cells as `role=\"gridcell\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today's day, month and year get it once the page hydrates, so the reader's clock decides which.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, month or year, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid or year list and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` on the grid or year list it picks from, and keeps its tab stop and keys.\n- Roving `tabindex` keeps a single grid cell focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- The month grid is a `role=\"grid\"` of `role=\"row\"`s, labelled by the year in its header. Each month cell carries the full month name as its accessible name, `aria-current=\"date\"` for this month and `aria-disabled` for a month with no selectable day.\n- The year list is a `role=\"listbox\"`, named by the `chooseYear` label where it is the selection surface and by the heading that opens it otherwise. As the selection surface its options take `aria-selected` from the value's year rather than from focus, which roves through the list. When the focused year is disabled, the nearest enabled year takes the tab stop, so `Tab` still reaches the list.\n- The launcher and popover are named \"Choose month\" or \"Choose year\" to match the granularity; override them, and the month grid's \"Previous year\" / \"Next year\" buttons, through `labels` (`chooseMonth`, `chooseYear`, `prevYear`, `nextYear`).\n- Honors `prefers-reduced-motion` (skip popover fade-in).\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right. The month names follow the page.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.",
|
|
182
182
|
"related": ["DateTimeInput", "Input", "TimeInput"],
|
|
183
183
|
"storybook": "https://bestax.io/storybook/?path=/story/form-dateinput",
|
|
184
184
|
"summary": "The `DateInput` component is a form input that opens a popover calendar for date selection.",
|
|
@@ -717,7 +717,7 @@
|
|
|
717
717
|
}
|
|
718
718
|
],
|
|
719
719
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
720
|
-
"helperPropsNote": "Helper props go on the `.dateinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
720
|
+
"helperPropsNote": "Helper props go on the `.dateinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`. Among the other attributes, `aria-label`, `aria-labelledby` and `aria-describedby` go on the `<div>` too, so they don't name or describe the `<input>`, except the native one `mobileNative` renders. Name it with `DateInput`'s `label`; with a labeled `Field` that isn't `grouped` or `hasAddons`, if you give it no `id`; or with an `id` and a `<label htmlFor>` of your own. Describe it with `DateInput`'s `message`: `DateInputBase` on its own has no way to describe it. Inline there is no `<input>` to name.",
|
|
721
721
|
"types": []
|
|
722
722
|
},
|
|
723
723
|
{
|
|
@@ -1061,7 +1061,7 @@
|
|
|
1061
1061
|
],
|
|
1062
1062
|
"extraProps": [],
|
|
1063
1063
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
1064
|
-
"helperPropsNote": "Helper props go on the `.dateinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
1064
|
+
"helperPropsNote": "Helper props go on the `.dateinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`. Among the other attributes, `aria-label`, `aria-labelledby` and `aria-describedby` go on the `<div>` too, so they don't name or describe the `<input>`, except the native one `mobileNative` renders. Name it with `DateInput`'s `label`; with a labeled `Field` that isn't `grouped` or `hasAddons`, if you give it no `id`; or with an `id` and a `<label htmlFor>` of your own. Describe it with `DateInput`'s `message`: `DateInputBase` on its own has no way to describe it. Inline there is no `<input>` to name.",
|
|
1065
1065
|
"types": [],
|
|
1066
1066
|
"standalone": "base"
|
|
1067
1067
|
}
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"code": "<DateTimeInput label=\"Input only\" popover={false} defaultValue={new Date()} />"
|
|
171
171
|
}
|
|
172
172
|
],
|
|
173
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid and its wheels inside keep their own names.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today gets it once the page hydrates, so the reader's clock decides which day.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.",
|
|
173
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid and its wheels inside keep their own names.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today gets it once the page hydrates, so the reader's clock decides which day.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- In forced colors (Windows' contrast themes), the time wheels' band is drawn in the system's highlight color, since its fill is replaced there, and the values keep the system's text color.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateTimeInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.",
|
|
174
174
|
"related": ["DateInput", "Input", "TimeInput"],
|
|
175
175
|
"storybook": "https://bestax.io/storybook/?path=/story/form-datetimeinput",
|
|
176
176
|
"summary": "The `DateTimeInput` combines a calendar and a time **wheel spinner** in a single popover — an iOS-style layout.",
|
|
@@ -547,7 +547,7 @@
|
|
|
547
547
|
"name": "color",
|
|
548
548
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
549
549
|
"default": null,
|
|
550
|
-
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill, so there the selected date is drawn in the system's highlight colors instead, whatever the color, which needs bestax's CSS.",
|
|
550
|
+
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill and the wheels' band, so there the selected date is drawn in the system's highlight colors and the band in its highlight color instead, whatever the color, which needs bestax's CSS.",
|
|
551
551
|
"required": false,
|
|
552
552
|
"inherited": true,
|
|
553
553
|
"deprecated": false
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
}
|
|
773
773
|
],
|
|
774
774
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
775
|
-
"helperPropsNote": "Helper props go on the `.datetimeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
775
|
+
"helperPropsNote": "Helper props go on the `.datetimeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`. Among the other attributes, `aria-label`, `aria-labelledby` and `aria-describedby` go on the `<div>` too, so they don't name or describe the `<input>`, except the native one `mobileNative` renders. Name it with `DateTimeInput`'s `label`; with a labeled `Field` that isn't `grouped` or `hasAddons`, if you give it no `id`; or with an `id` and a `<label htmlFor>` of your own. Describe it with `DateTimeInput`'s `message`: `DateTimeInputBase` on its own has no way to describe it. Inline there is no `<input>` to name.",
|
|
776
776
|
"types": []
|
|
777
777
|
},
|
|
778
778
|
{
|
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
"name": "color",
|
|
974
974
|
"type": "'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
975
975
|
"default": null,
|
|
976
|
-
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill, so there the selected date is drawn in the system's highlight colors instead, whatever the color, which needs bestax's CSS.",
|
|
976
|
+
"description": "Bulma color modifier for the input, also carried by the calendar and the time wheels, where it colors the selected date and the selection band. Today's date and the calendar's keyboard focus ring take the color's `-on-scheme` variant, which Bulma adjusts to contrast with the background, so pale colors stay readable. A focused wheel's ring is drawn inside the band in the color's `-invert`, like the selected value, so it shows on the fill. Unset, they use their `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which follow `primary` by default. The footer's time pill and Done button do not follow `color`. Forced colors (Windows' contrast themes) replaces the calendar's fill and the wheels' band, so there the selected date is drawn in the system's highlight colors and the band in its highlight color instead, whatever the color, which needs bestax's CSS.",
|
|
977
977
|
"required": false,
|
|
978
978
|
"inherited": false,
|
|
979
979
|
"deprecated": false
|
|
@@ -1179,7 +1179,7 @@
|
|
|
1179
1179
|
],
|
|
1180
1180
|
"extraProps": [],
|
|
1181
1181
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
1182
|
-
"helperPropsNote": "Helper props go on the `.datetimeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
1182
|
+
"helperPropsNote": "Helper props go on the `.datetimeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`. Among the other attributes, `aria-label`, `aria-labelledby` and `aria-describedby` go on the `<div>` too, so they don't name or describe the `<input>`, except the native one `mobileNative` renders. Name it with `DateTimeInput`'s `label`; with a labeled `Field` that isn't `grouped` or `hasAddons`, if you give it no `id`; or with an `id` and a `<label htmlFor>` of your own. Describe it with `DateTimeInput`'s `message`: `DateTimeInputBase` on its own has no way to describe it. Inline there is no `<input>` to name.",
|
|
1183
1183
|
"types": [],
|
|
1184
1184
|
"standalone": "base"
|
|
1185
1185
|
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "With Input (States)",
|
|
38
|
-
"code": "<>\n <Field label=\"Normal\">\n <Control>\n <Input placeholder=\"Normal state\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <Input isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Focus\">\n <Control>\n <Input isFocused placeholder=\"Focused state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" />\n </Control>\n </Field>\n</>"
|
|
38
|
+
"code": "<>\n <Field label=\"Normal\">\n <Control>\n <Input placeholder=\"Normal state\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <Input isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Focus\">\n <Control>\n <Input isFocused placeholder=\"Focused state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Input placeholder=\"Loading state\" message=\"Loading…\" />\n </Control>\n </Field>\n</>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "With Input (Disabled & Read Only)",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"title": "With Select (Colors, Sizes, Rounded, Loading, Icons)",
|
|
70
|
-
"code": "<>\n <Field label=\"Primary\">\n <Control>\n <Select color=\"primary\">\n <option value=\"1\">Option 1</option>\n <option value=\"2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Rounded\">\n <Control>\n <Select isRounded>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"With Icons\">\n <Control hasIconsLeft iconLeft={{ name: 'person' }}>\n <Select>\n <option value=\"huck\">Huckleberry Finn</option>\n <option value=\"tom\">Tom Sawyer</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Select isLoading>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n</>"
|
|
70
|
+
"code": "<>\n <Field label=\"Primary\">\n <Control>\n <Select color=\"primary\">\n <option value=\"1\">Option 1</option>\n <option value=\"2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Rounded\">\n <Control>\n <Select isRounded>\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"With Icons\">\n <Control hasIconsLeft iconLeft={{ name: 'person' }}>\n <Select>\n <option value=\"huck\">Huckleberry Finn</option>\n <option value=\"tom\">Tom Sawyer</option>\n </Select>\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <Select isLoading message=\"Loading options…\">\n <option value=\"\">Please select</option>\n <option value=\"option1\">Option 1</option>\n <option value=\"option2\">Option 2</option>\n </Select>\n </Control>\n </Field>\n</>"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"title": "With TextArea",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"title": "With TextArea (Rows, Colors, Sizes, States, Loading, Fixed Size)",
|
|
78
|
-
"code": "<>\n <Field label=\"Rows\">\n <Control>\n <TextArea rows={8} placeholder=\"8 rows\" />\n </Control>\n </Field>\n\n <Field label=\"Primary\">\n <Control>\n <TextArea color=\"primary\" placeholder=\"Primary (color='primary')\" />\n </Control>\n </Field>\n\n <Field label=\"Small\">\n <Control>\n <TextArea size=\"small\" placeholder=\"Small\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <TextArea isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <TextArea placeholder=\"Loading state\" />\n </Control>\n </Field>\n\n <Field label=\"Fixed Size\">\n <Control>\n <TextArea hasFixedSize placeholder=\"Fixed size textarea\" rows={3} />\n </Control>\n </Field>\n</>"
|
|
78
|
+
"code": "<>\n <Field label=\"Rows\">\n <Control>\n <TextArea rows={8} placeholder=\"8 rows\" />\n </Control>\n </Field>\n\n <Field label=\"Primary\">\n <Control>\n <TextArea color=\"primary\" placeholder=\"Primary (color='primary')\" />\n </Control>\n </Field>\n\n <Field label=\"Small\">\n <Control>\n <TextArea size=\"small\" placeholder=\"Small\" />\n </Control>\n </Field>\n\n <Field label=\"Hover\">\n <Control>\n <TextArea isHovered placeholder=\"Hovered state\" />\n </Control>\n </Field>\n\n <Field label=\"Loading\">\n <Control isLoading>\n <TextArea placeholder=\"Loading state\" message=\"Loading…\" />\n </Control>\n </Field>\n\n <Field label=\"Fixed Size\">\n <Control>\n <TextArea hasFixedSize placeholder=\"Fixed size textarea\" rows={3} />\n </Control>\n </Field>\n</>"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"title": "Grouped Controls",
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
"name": "isLoading",
|
|
405
405
|
"type": "boolean",
|
|
406
406
|
"default": "false",
|
|
407
|
-
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading.",
|
|
407
|
+
"description": "Shows a loading spinner inside the control. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where a right icon also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes the input, select or textarea inside, such as its `message`, or text tied to that control with `aria-describedby`, which a screen reader reads when the control takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
408
408
|
"required": false,
|
|
409
409
|
"inherited": true,
|
|
410
410
|
"deprecated": false
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"code": "<IconButton\n as=\"a\"\n href=\"https://bulma.io/documentation/elements/button/\"\n target=\"_blank\"\n rel=\"noreferrer\"\n icon=\"arrow-up-right-from-square\"\n aria-label=\"Bulma's button docs, in a new tab\"\n/>"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
|
-
"accessibility": "- **A name every time:** an icon-only button's name is its text alternative\n ([WCAG 1.1.1](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) and\n [4.1.2](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html)), so the types require\n `aria-label` or `aria-labelledby`, and a development build warns about an empty or blank one. Name\n the action, not the picture.\n- **The name is the button's:** its `aria-label` or `aria-labelledby` names it over anything inside\n it, so a name on the `Icon` is ignored, and there's no need to give one.\n- **Tooltips describe:** a [`Tooltip`](https://bestax.io/docs/api/components/tooltip) around it points the button's\n `aria-describedby` at itself, so the name and the description stay separate. Give the tooltip\n something to add, not the name again.\n- **Keyboard and focus:** it's a native `<button>`, so <kbd>Enter</kbd> and <kbd>Space</kbd> press\n it, with Bulma's focus style. `isLoading` leaves it focusable and holds it still, as on `Button`:\n a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing, and it carries `aria-busy` and\n `aria-disabled` meanwhile. While it loads, Bulma takes away the shadow that shows focus, so it\n shows Bulma's focus outline instead when it has keyboard focus.\n- **Target size:** Bulma's smallest is 30 by 30 pixels, above the 24 by 24\n [WCAG 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) asks for.\n- **Toggles** are [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which reports `aria-pressed`. Give an\n icon-only one an `aria-label` the same way.\n- **Forced colors:** a font icon, or an SVG drawn in `currentColor`, takes the system's text\n color, as a button's text does.",
|
|
57
|
+
"accessibility": "- **A name every time:** an icon-only button's name is its text alternative\n ([WCAG 1.1.1](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) and\n [4.1.2](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html)), so the types require\n `aria-label` or `aria-labelledby`, and a development build warns about an empty or blank one. Name\n the action, not the picture.\n- **The name is the button's:** its `aria-label` or `aria-labelledby` names it over anything inside\n it, so a name on the `Icon` is ignored, and there's no need to give one.\n- **Tooltips describe:** a [`Tooltip`](https://bestax.io/docs/api/components/tooltip) around it points the button's\n `aria-describedby` at itself, so the name and the description stay separate. Give the tooltip\n something to add, not the name again.\n- **Keyboard and focus:** it's a native `<button>`, so <kbd>Enter</kbd> and <kbd>Space</kbd> press\n it, with Bulma's focus style. `isLoading` leaves it focusable and holds it still, as on `Button`:\n a click, <kbd>Enter</kbd> or <kbd>Space</kbd> does nothing, and it carries `aria-busy` and\n `aria-disabled` meanwhile. While it loads, Bulma takes away the shadow that shows focus, so it\n shows Bulma's focus outline instead when it has keyboard focus.\n- **Target size:** Bulma's smallest is 30 by 30 pixels, above the 24 by 24\n [WCAG 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) asks for.\n- **Toggles** are [`ToggleButton`](https://bestax.io/docs/api/elements/togglebutton), which reports `aria-pressed`. Give an\n icon-only one an `aria-label` the same way.\n- **Forced colors:** a font icon, or an SVG drawn in `currentColor`, takes the system's text\n color, as a button's text does, and on a disabled one the system's color for a disabled\n control, at full strength.",
|
|
58
58
|
"related": [
|
|
59
59
|
"Button",
|
|
60
60
|
"Buttons",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "States",
|
|
26
|
-
"code": "<>\n <Input label=\"Normal\" placeholder=\"Normal state\" />\n <Input label=\"Hover\" isHovered placeholder=\"Hovered state\" />\n <Input label=\"Focus\" isFocused placeholder=\"Focused state\" />\n <Input
|
|
26
|
+
"code": "<>\n <Input label=\"Normal\" placeholder=\"Normal state\" />\n <Input label=\"Hover\" isHovered placeholder=\"Hovered state\" />\n <Input label=\"Focus\" isFocused placeholder=\"Focused state\" />\n <Input\n label=\"Loading\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading state\"\n />\n</>"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Loading States by Size",
|
|
30
|
-
"code": "<>\n <Input\n label=\"Loading Small\"\n size=\"small\"\n controlSize=\"small\"\n isLoading\n placeholder=\"Loading small\"\n />\n <Input
|
|
30
|
+
"code": "<>\n <Input\n label=\"Loading Small\"\n size=\"small\"\n controlSize=\"small\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading small\"\n />\n <Input\n label=\"Loading Normal\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading normal\"\n />\n <Input\n label=\"Loading Medium\"\n size=\"medium\"\n controlSize=\"medium\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading medium\"\n />\n <Input\n label=\"Loading Large\"\n size=\"large\"\n controlSize=\"large\"\n isLoading\n message=\"Loading…\"\n placeholder=\"Loading large\"\n />\n</>"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Disabled & Read Only",
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
"name": "isLoading",
|
|
260
260
|
"type": "boolean",
|
|
261
261
|
"default": "false",
|
|
262
|
-
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading.",
|
|
262
|
+
"description": "Shows a loading spinner on the `Control` it renders. Under `prefers-reduced-motion: reduce` the spinner stops and stays drawn (with bestax's CSS loaded). The spinner sits at the right edge, where `iconRight` also sits, and the two overlap; leave the right icon out while loading. The spinner is only drawn, so a screen reader hears nothing of it. Say that the field is loading in text that describes it, tied to it with `aria-describedby`, which a screen reader reads when the field takes focus. A load that starts while the user is in the field, such as a search as they type, isn't reliably heard without a live region, such as a `role=\"status\"` element.",
|
|
263
263
|
"required": false,
|
|
264
264
|
"inherited": false,
|
|
265
265
|
"deprecated": false
|