bestax-mcp 1.18.73 → 1.18.75
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/bulma-classes.json +1 -1
- package/data/catalog.json +9 -9
- package/data/components/Badge.json +18 -15
- package/data/components/Card.json +26 -6
- package/data/components/Carousel.json +14 -1
- package/data/components/Checkbox.json +1 -1
- package/data/components/CheckboxCard.json +1 -1
- package/data/components/ColorPicker.json +1 -1
- package/data/components/Columns.json +3 -3
- package/data/components/Combobox.json +3 -3
- package/data/components/ContextMenu.json +1 -1
- package/data/components/DateInput.json +7 -7
- package/data/components/DateRangeInput.json +1 -1
- package/data/components/DateTimeInput.json +7 -7
- package/data/components/Dropdown.json +1 -1
- package/data/components/Field.json +3 -3
- package/data/components/Fieldset.json +1 -1
- package/data/components/Input.json +10 -10
- package/data/components/Level.json +3 -3
- package/data/components/Menu.json +1 -1
- package/data/components/Modal.json +5 -5
- package/data/components/Navbar.json +5 -5
- package/data/components/Notification.json +2 -2
- package/data/components/Numberinput.json +4 -4
- package/data/components/Panel.json +7 -7
- package/data/components/Radio.json +1 -1
- package/data/components/RadioCard.json +1 -1
- package/data/components/Rate.json +1 -1
- package/data/components/Reveal.json +2 -2
- package/data/components/Select.json +5 -5
- package/data/components/Slider.json +2 -2
- package/data/components/Stack.json +1 -1
- package/data/components/Switch.json +1 -1
- package/data/components/Tabs.json +16 -16
- package/data/components/Taginput.json +3 -3
- package/data/components/TimeInput.json +7 -7
- package/data/components/Timeline.json +2 -2
- package/data/components/Toast.json +21 -3
- package/data/components/Tooltip.json +3 -3
- package/data/skills/bestax-form/SKILL.md +12 -6
- package/data/skills/bestax-layout-scaffold/references/layout-components.md +15 -15
- package/data/skills/bestax-migrate/SKILL.md +3 -2
- package/data/skills/bestax-migrate/references/bloomer/unmappables.md +21 -1
- package/data/skills/bestax-migrate/references/rbx/unmappables.md +21 -1
- package/data/skills/bestax-migrate/references/react-bulma-components/unmappables.md +22 -1
- package/data/skills/bestax-optimize/SKILL.md +3 -1
- package/data/skills/bestax-optimize/references/modular-build.md +32 -6
- package/data/skills/bestax-theming/references/css-variables.md +11 -3
- package/package.json +2 -2
package/data/bulma-classes.json
CHANGED
|
@@ -4051,7 +4051,7 @@
|
|
|
4051
4051
|
"textColor": null,
|
|
4052
4052
|
"bgColor": null,
|
|
4053
4053
|
"part": false,
|
|
4054
|
-
"why": "bestax `Modal` writes `data-testid=\"modal\"` when it's given none, and adds dialog attributes and focus handling, so rebuild the root with it by hand; its parts convert on their own",
|
|
4054
|
+
"why": "bestax `Modal` writes `data-testid=\"modal\"` when it's given none, and adds dialog attributes and focus handling, so rebuild the root with it by hand, keeping or adding a name for the dialog it becomes: an `aria-label`, or an `aria-labelledby` pointing at the `id` of its title; its parts convert on their own",
|
|
4055
4055
|
"modifiers": {},
|
|
4056
4056
|
"omits": {},
|
|
4057
4057
|
"wrapsChildren": null,
|
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.77.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",
|
|
@@ -3839,7 +3839,7 @@
|
|
|
3839
3839
|
"ModalCardHead": {
|
|
3840
3840
|
"component": "Modal",
|
|
3841
3841
|
"path": "Modal.Card.Head",
|
|
3842
|
-
"purpose": "Modal.Card.Head - Renders modal card header section
|
|
3842
|
+
"purpose": "Modal.Card.Head - Renders modal card header section, a `<header>`."
|
|
3843
3843
|
},
|
|
3844
3844
|
"ModalCardTitle": {
|
|
3845
3845
|
"component": "Modal",
|
|
@@ -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",
|
|
@@ -3955,7 +3955,7 @@
|
|
|
3955
3955
|
"PanelHeading": {
|
|
3956
3956
|
"component": "Panel",
|
|
3957
3957
|
"path": "Panel.Heading",
|
|
3958
|
-
"purpose": "
|
|
3958
|
+
"purpose": "The panel's title: a paragraph to assistive tech, until you give it `role=\"heading\"` and an `aria-level`."
|
|
3959
3959
|
},
|
|
3960
3960
|
"PanelIcon": {
|
|
3961
3961
|
"component": "Panel",
|
|
@@ -3970,7 +3970,7 @@
|
|
|
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",
|
|
@@ -4077,12 +4077,12 @@
|
|
|
4077
4077
|
"TabItem": {
|
|
4078
4078
|
"component": "Tabs",
|
|
4079
4079
|
"path": "Tabs.Item",
|
|
4080
|
-
"purpose": "
|
|
4080
|
+
"purpose": "A navigation tab: an `<li>` holding a link of your own, with an `href`."
|
|
4081
4081
|
},
|
|
4082
4082
|
"TabList": {
|
|
4083
4083
|
"component": "Tabs",
|
|
4084
4084
|
"path": "Tabs.List",
|
|
4085
|
-
"purpose": "The `<ul>`
|
|
4085
|
+
"purpose": "The `<ul role=\"tablist\">` that holds the `Tabs.Tab`s."
|
|
4086
4086
|
},
|
|
4087
4087
|
"TabsContent": {
|
|
4088
4088
|
"component": "Tabs",
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
9
|
"title": "Status Dot on an Avatar",
|
|
10
|
-
"code": "<Badge dot color=\"success\" overlap=\"circle\">\n <Avatar name=\"Ada Lovelace\" />\n</Badge>"
|
|
10
|
+
"code": "<Badge dot color=\"success\" overlap=\"circle\">\n <Avatar name=\"Ada Lovelace\" alt=\"Ada Lovelace, online\" />\n</Badge>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Unread Count",
|
|
14
|
-
"code": "<Badge content={128} max={99} color=\"danger\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" />\n</Badge>"
|
|
14
|
+
"code": "<Badge content={128} max={99} color=\"danger\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 128 unread\" />\n</Badge>"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "Unread Mail",
|
|
@@ -19,40 +19,43 @@
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"title": "Badge on a Button",
|
|
22
|
-
"code": "<Badge content={3} color=\"danger\" overlap=\"square\">\n <Button color=\"primary\">\n <Icon name=\"shopping-cart\"
|
|
22
|
+
"code": "<Badge content={3} color=\"danger\" overlap=\"square\">\n <Button color=\"primary\" aria-label=\"Cart, 3 items\">\n <Icon name=\"shopping-cart\" />\n <span>Cart</span>\n </Button>\n</Badge>"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "Positions",
|
|
26
|
-
"code": "<Block display=\"flex\">\n <Badge content={1} position=\"top-right\" mr=\"5\">\n <Avatar name=\"A\" shape=\"square\" />\n </Badge>\n <Badge content={2} position=\"top-left\" mr=\"5\">\n <Avatar name=\"B\" shape=\"square\" />\n </Badge>\n <Badge content={3} position=\"bottom-right\" mr=\"5\">\n <Avatar name=\"C\" shape=\"square\" />\n </Badge>\n <Badge content={4} position=\"bottom-left\">\n <Avatar name=\"D\" shape=\"square\" />\n </Badge>\n</Block>"
|
|
26
|
+
"code": "<Block display=\"flex\">\n <Badge content={1} position=\"top-right\" mr=\"5\">\n <Avatar name=\"A\" alt=\"A, 1 new message\" shape=\"square\" />\n </Badge>\n <Badge content={2} position=\"top-left\" mr=\"5\">\n <Avatar name=\"B\" alt=\"B, 2 new messages\" shape=\"square\" />\n </Badge>\n <Badge content={3} position=\"bottom-right\" mr=\"5\">\n <Avatar name=\"C\" alt=\"C, 3 new messages\" shape=\"square\" />\n </Badge>\n <Badge content={4} position=\"bottom-left\">\n <Avatar name=\"D\" alt=\"D, 4 new messages\" shape=\"square\" />\n </Badge>\n</Block>"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Overlap: Circle vs Square",
|
|
30
|
-
"code": "<Block display=\"flex\">\n <Badge content={5} overlap=\"square\" mr=\"5\">\n <Avatar name=\"Square\" shape=\"square\" />\n </Badge>\n <Badge content={5} overlap=\"circle\">\n <Avatar name=\"Circle\" shape=\"circle\" />\n </Badge>\n</Block>"
|
|
30
|
+
"code": "<Block display=\"flex\">\n <Badge content={5} overlap=\"square\" mr=\"5\">\n <Avatar name=\"Square\" alt=\"Square, 5 new messages\" shape=\"square\" />\n </Badge>\n <Badge content={5} overlap=\"circle\">\n <Avatar name=\"Circle\" alt=\"Circle, 5 new messages\" shape=\"circle\" />\n </Badge>\n</Block>"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Colors",
|
|
34
|
-
"code": "<Block display=\"flex\">\n <Badge content={1} color=\"primary\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n <Badge content={2} color=\"info\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n <Badge content={3} color=\"success\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n <Badge content={4} color=\"warning\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n <Badge content={5} color=\"danger\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n</Block>"
|
|
34
|
+
"code": "<Block display=\"flex\">\n <Badge content={1} color=\"primary\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 1 unread\" size=\"large\" />\n </Badge>\n <Badge content={2} color=\"info\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 2 unread\" size=\"large\" />\n </Badge>\n <Badge content={3} color=\"success\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 3 unread\" size=\"large\" />\n </Badge>\n <Badge content={4} color=\"warning\" mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 4 unread\" size=\"large\" />\n </Badge>\n <Badge content={5} color=\"danger\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 5 unread\" size=\"large\" />\n </Badge>\n</Block>"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "Pulse",
|
|
38
|
-
"code": "<Badge dot color=\"success\" pulse overlap=\"circle\">\n <Avatar name=\"Ada Lovelace\" />\n</Badge>"
|
|
38
|
+
"code": "<Badge dot color=\"success\" pulse overlap=\"circle\">\n <Avatar name=\"Ada Lovelace\" alt=\"Ada Lovelace, syncing\" />\n</Badge>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "Toggling Visibility",
|
|
42
|
-
"code": "function example() {\n const [muted, setMuted] = useState(false);\n\n return (\n <Block display=\"flex\" alignItems=\"center\">\n <Badge content={4} color=\"danger\" invisible={muted} mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n <Button onClick={() => setMuted(m => !m)}>\n {muted ? 'Show badge' : 'Hide badge'}\n </Button>\n </Block>\n );\n}"
|
|
42
|
+
"code": "function example() {\n const [muted, setMuted] = useState(false);\n\n return (\n <Block display=\"flex\" alignItems=\"center\">\n <Badge content={4} color=\"danger\" invisible={muted} mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, 4 unread\" size=\"large\" />\n </Badge>\n <Button onClick={() => setMuted(m => !m)}>\n {muted ? 'Show badge' : 'Hide badge'}\n </Button>\n </Block>\n );\n}"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"title": "Hidden at Zero (unless `showZero`)",
|
|
46
|
-
"code": "<Block display=\"flex\">\n <Badge content={0} mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n <Badge content={0} showZero>\n <Icon name=\"bell\" ariaLabel=\"Notifications\" size=\"large\" />\n </Badge>\n</Block>"
|
|
46
|
+
"code": "<Block display=\"flex\">\n <Badge content={0} mr=\"5\">\n <Icon name=\"bell\" ariaLabel=\"Notifications, none unread\" size=\"large\" />\n </Badge>\n <Badge content={0} showZero>\n <Icon name=\"bell\" ariaLabel=\"Notifications, none unread\" size=\"large\" />\n </Badge>\n</Block>"
|
|
47
47
|
},
|
|
48
|
-
{ "title": "Standalone", "code": "<Badge content={5} color=\"info\" />" },
|
|
49
48
|
{
|
|
50
|
-
"title": "Standalone
|
|
51
|
-
"code": "
|
|
49
|
+
"title": "Standalone",
|
|
50
|
+
"code": "<Block display=\"flex\" alignItems=\"center\">\n <Badge content={5} color=\"info\" mr=\"2\" />\n <span>new messages</span>\n</Block>"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
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}"
|
|
52
55
|
},
|
|
53
56
|
{
|
|
54
57
|
"title": "Standalone, Pulse",
|
|
55
|
-
"code": "<Badge content={5} color=\"danger\" pulse
|
|
58
|
+
"code": "<Block display=\"flex\" alignItems=\"center\">\n <Badge content={5} color=\"danger\" pulse mr=\"2\" />\n <span>new alerts</span>\n</Block>"
|
|
56
59
|
},
|
|
57
60
|
{
|
|
58
61
|
"title": "Text Child",
|
|
@@ -60,10 +63,10 @@
|
|
|
60
63
|
},
|
|
61
64
|
{
|
|
62
65
|
"title": "Custom Node Content",
|
|
63
|
-
"code": "<Badge content={<Icon name=\"check\" />} color=\"success\">\n <Avatar name=\"Ada Lovelace\" />\n</Badge>"
|
|
66
|
+
"code": "<Badge content={<Icon name=\"check\" />} color=\"success\">\n <Avatar name=\"Ada Lovelace\" alt=\"Ada Lovelace, verified\" />\n</Badge>"
|
|
64
67
|
}
|
|
65
68
|
],
|
|
66
|
-
"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
|
|
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.",
|
|
67
70
|
"related": ["Avatar", "Icon", "Tag", "useBulmaClasses"],
|
|
68
71
|
"storybook": "https://bestax.io/storybook/?path=/story/components-badge--unread-count",
|
|
69
72
|
"summary": "The `Badge` component is a small status/count indicator overlaid on the corner of another element, or rendered standalone.",
|
|
@@ -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- 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. 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.",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"name": "header",
|
|
127
127
|
"type": "React.ReactNode",
|
|
128
128
|
"default": null,
|
|
129
|
-
"description": "Card header content, rendered inside `.card-header-title`.",
|
|
129
|
+
"description": "Card header content, rendered inside `.card-header-title`. The header is a `<header>`, which is a banner landmark outside `<main>`, the sectioning elements and their roles.",
|
|
130
130
|
"required": false,
|
|
131
131
|
"inherited": false,
|
|
132
132
|
"deprecated": false
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"name": "headerIcon",
|
|
145
145
|
"type": "React.ReactNode",
|
|
146
146
|
"default": null,
|
|
147
|
-
"description": "Card header icon, rendered as a sibling to the header title.",
|
|
147
|
+
"description": "Card header icon, rendered as a sibling to the header title. Even with no `header`, it renders the card's `<header>`, a landmark where `header`'s is.",
|
|
148
148
|
"required": false,
|
|
149
149
|
"inherited": false,
|
|
150
150
|
"deprecated": false
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"name": "footer",
|
|
154
154
|
"type": "React.ReactNode | React.ReactNode[]",
|
|
155
155
|
"default": null,
|
|
156
|
-
"description": "Card footer content; each item is wrapped in `.card-footer-item`.",
|
|
156
|
+
"description": "Card footer content; each item is wrapped in `.card-footer-item`. The footer is a `<footer>`, which is a content info landmark outside `<main>`, the sectioning elements and their roles.",
|
|
157
157
|
"required": false,
|
|
158
158
|
"inherited": false,
|
|
159
159
|
"deprecated": false
|
|
@@ -263,7 +263,17 @@
|
|
|
263
263
|
"deprecated": false
|
|
264
264
|
}
|
|
265
265
|
],
|
|
266
|
-
"extraProps": [
|
|
266
|
+
"extraProps": [
|
|
267
|
+
{
|
|
268
|
+
"name": "role",
|
|
269
|
+
"type": "React.AriaRole",
|
|
270
|
+
"default": null,
|
|
271
|
+
"description": "Its `<header>` is a banner landmark outside `<main>`, the sectioning elements and their roles. `role=\"none\"` drops the landmark.",
|
|
272
|
+
"required": false,
|
|
273
|
+
"inherited": false,
|
|
274
|
+
"deprecated": false
|
|
275
|
+
}
|
|
276
|
+
],
|
|
267
277
|
"catchAll": "All standard HTML attributes and Bulma helper props",
|
|
268
278
|
"types": []
|
|
269
279
|
},
|
|
@@ -590,7 +600,17 @@
|
|
|
590
600
|
"deprecated": false
|
|
591
601
|
}
|
|
592
602
|
],
|
|
593
|
-
"extraProps": [
|
|
603
|
+
"extraProps": [
|
|
604
|
+
{
|
|
605
|
+
"name": "role",
|
|
606
|
+
"type": "React.AriaRole",
|
|
607
|
+
"default": null,
|
|
608
|
+
"description": "Its `<footer>` is a content info landmark outside `<main>`, the sectioning elements and their roles. `role=\"none\"` drops the landmark.",
|
|
609
|
+
"required": false,
|
|
610
|
+
"inherited": false,
|
|
611
|
+
"deprecated": false
|
|
612
|
+
}
|
|
613
|
+
],
|
|
594
614
|
"catchAll": "All standard HTML attributes and Bulma helper props",
|
|
595
615
|
"types": []
|
|
596
616
|
},
|
|
@@ -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 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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"code": "<Checkbox className=\"compact-checkbox\">Remember me</Checkbox>"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"accessibility": "- Each `Checkbox` is rendered as a `<label>` wrapping an `<input type=\"checkbox\">` and the label text, for optimal accessibility.\n- The clickable area includes both box and label by default.\n- Browsers expose a box with `indeterminate` set as mixed, so the component adds no ARIA for it.\n- The box is at least 24px square, the minimum size WCAG 2.2 sets for a target (2.5.8), whatever `--bulma-checkbox-size` says. [Box Size](https://bestax.io/docs/api/form/checkbox#box-size) shows how to make it smaller, and why to keep the label text inside the `Checkbox` when you do.\n- An unchecked box shows only its border, `--bulma-checkbox-border-color`. It defaults to `--bulma-text-weak`, which holds the 3:1 contrast WCAG asks of a control's boundary (non-text contrast) on Bulma's page and card surfaces in light and dark. Hold a replacement border, and a custom check color on its fill, to 3:1 as well.\n- In forced colors (Windows contrast themes), the box, the check mark and the mixed dash take system colors, so they stay visible whatever the variables hold.",
|
|
41
|
+
"accessibility": "- Each `Checkbox` is rendered as a `<label>` wrapping an `<input type=\"checkbox\">` and the label text, for optimal accessibility.\n- The clickable area includes both box and label by default.\n- Browsers expose a box with `indeterminate` set as mixed, so the component adds no ARIA for it.\n- The box is at least 24px square, the minimum size WCAG 2.2 sets for a target (2.5.8), whatever `--bulma-checkbox-size` says. [Box Size](https://bestax.io/docs/api/form/checkbox#box-size) shows how to make it smaller, and why to keep the label text inside the `Checkbox` when you do.\n- An unchecked box shows only its border, `--bulma-checkbox-border-color`. It defaults to `--bulma-text-weak`, which holds the 3:1 contrast WCAG asks of a control's boundary (non-text contrast) on Bulma's page and card surfaces in light and dark. Hold a replacement border, and a custom check color on its fill, to 3:1 as well.\n- In forced colors (Windows contrast themes), the box, the check mark and the mixed dash take system colors, so they stay visible whatever the variables hold. A disabled box and its label draw in the system's color for disabled text there, at full strength rather than dimmed, a checked one filled with it and a mixed one with its dash in it.",
|
|
42
42
|
"related": ["Checkboxes", "Field", "useBulmaClasses"],
|
|
43
43
|
"storybook": "https://bestax.io/storybook/?path=/story/form-checkbox--default",
|
|
44
44
|
"summary": "The `Checkbox` component provides a Bulma-styled checkbox input.",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"code": "<CheckboxCard\n className=\"compact-card\"\n title=\"Daily backups\"\n description=\"Kept for 30 days.\"\n/>"
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
|
-
"accessibility": "- The card is a `<label>` around a native `<input type=\"checkbox\">`, so a click anywhere on it\n toggles the checkbox, Space toggles it from the keyboard, and it sends its value with a form.\n- The checkbox is named by the title, through `aria-labelledby`, and described by the\n description, through `aria-describedby`. An `aria-label` or `aria-labelledby` you pass wins.\n Without a title, the card's own text names it, as a label's text does.\n- The children aren't read when the checkbox takes focus. Put what matters in `title` and\n `description`.\n- A link inside the card is its own Tab stop, and following it doesn't toggle the card. A button\n or another input can't go inside a `<label>`.\n- Keyboard focus draws an outline around the whole card, in Bulma's focus color, whatever the\n card's color.\n- The selection never rests on color: the checkbox shows it, and a checked card's edge is twice\n as thick, with or without the checkbox.\n- Contrast: against the card, a checked edge in `primary` or `link` clears WCAG 1.4.11's 3:1 on a\n light page, and in every color on a dark one. `info`, `success`, `warning` and `danger` fall\n short on a light page, where the edge's width and the checkbox still show the selection.\n- In forced colors (Windows contrast themes), Bulma's card loses its shadow, so the edge is a\n real border there: the system's text color, `Highlight` and still thicker when checked, and\n gray when disabled. The checkbox takes system colors as `Checkbox`'s does, and the focus outline\n is `Highlight
|
|
45
|
+
"accessibility": "- The card is a `<label>` around a native `<input type=\"checkbox\">`, so a click anywhere on it\n toggles the checkbox, Space toggles it from the keyboard, and it sends its value with a form.\n- The checkbox is named by the title, through `aria-labelledby`, and described by the\n description, through `aria-describedby`. An `aria-label` or `aria-labelledby` you pass wins.\n Without a title, the card's own text names it, as a label's text does.\n- The children aren't read when the checkbox takes focus. Put what matters in `title` and\n `description`.\n- A link inside the card is its own Tab stop, and following it doesn't toggle the card. A button\n or another input can't go inside a `<label>`.\n- Keyboard focus draws an outline around the whole card, in Bulma's focus color, whatever the\n card's color.\n- The selection never rests on color: the checkbox shows it, and a checked card's edge is twice\n as thick, with or without the checkbox.\n- Contrast: against the card, a checked edge in `primary` or `link` clears WCAG 1.4.11's 3:1 on a\n light page, and in every color on a dark one. `info`, `success`, `warning` and `danger` fall\n short on a light page, where the edge's width and the checkbox still show the selection.\n- In forced colors (Windows contrast themes), Bulma's card loses its shadow, so the edge is a\n real border there: the system's text color, `Highlight` and still thicker when checked, and\n gray when disabled. The checkbox takes system colors as `Checkbox`'s does, and the focus outline\n is `Highlight`. A disabled card draws at full strength there, its text, description and\n checkbox gray, rather than dimmed.\n- The edge and the checkbox change without a transition under `prefers-reduced-motion: reduce`.",
|
|
46
46
|
"related": ["Card", "Checkbox", "Checkboxes", "RadioCard", "useBulmaClasses"],
|
|
47
47
|
"storybook": "https://bestax.io/storybook/?path=/story/form-checkboxcard--default",
|
|
48
48
|
"summary": "The `CheckboxCard` component is a checkbox drawn as a card, with a title and a description, that toggles wherever you click it. It's a `<label>` around a real checkbox, so it sends its `value` with a form and Space toggles it. The title names the checkbox and the description describes it. Alone it's one choice; inside `Checkboxes` it takes the group's name and selection, as `Checkbox` does.",
|
|
@@ -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.\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.",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Columns on Mobile and Desktop",
|
|
14
|
-
"code": "<>\n {\n // Columns
|
|
14
|
+
"code": "<>\n {\n // Columns side by side on mobile screens and up\n }\n <Columns isMobile>\n <Column>\n <Notification color=\"primary\">1</Notification>\n </Column>\n <Column>\n <Notification color=\"primary\">2</Notification>\n </Column>\n <Column>\n <Notification color=\"primary\">3</Notification>\n </Column>\n </Columns>\n\n {\n // Columns enabled on desktop screens and up\n }\n <Columns isDesktop>\n <Column>\n <Notification color=\"primary\">1</Notification>\n </Column>\n <Column>\n <Notification color=\"primary\">2</Notification>\n </Column>\n <Column>\n <Notification color=\"primary\">3</Notification>\n </Column>\n <Column>\n <Notification color=\"primary\">4</Notification>\n </Column>\n <Column>\n <Notification color=\"primary\">5</Notification>\n </Column>\n </Columns>\n</>"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "Different Column Sizes Per Breakpoint",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"code": "<Columns>\n <Columns.Column>\n <Notification color=\"primary\">First column</Notification>\n </Columns.Column>\n <Columns.Column>\n <Notification color=\"info\">Second column</Notification>\n </Columns.Column>\n</Columns>"
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
|
-
"accessibility":
|
|
73
|
+
"accessibility": "- **No role of its own:** `Columns` and `Column` render `<div>`s, which add nothing to the\n accessibility tree. Columns are read, and tabbed through, in the order they're written, so lay\n them out in that order: a reversed `flexDirection` changes only what's seen (WCAG 1.3.2 and\n 2.4.3). An offset only adds room before a column.\n- **Reflow:** below tablet, columns stack. `isMobile` keeps them side by side at every width, and\n a row that doesn't fit a 320px screen runs past its edge, where Bulma's default\n `overflow-x: hidden` on the page cuts it off (WCAG 1.4.10 Reflow). Keep it for a row that fits.",
|
|
74
74
|
"related": [],
|
|
75
75
|
"storybook": null,
|
|
76
76
|
"summary": "The `Columns` component provides Bulma's flexible, responsive grid container for aligning and distributing [`Column`](https://bestax.io/docs/api/columns/column) components.",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"name": "isMobile",
|
|
162
162
|
"type": "boolean",
|
|
163
163
|
"default": "false",
|
|
164
|
-
"description": "
|
|
164
|
+
"description": "Keeps the columns side by side on a phone too (Bulma's `is-mobile`). Without it they stack below tablet. A row that doesn't fit a 320px screen runs past its edge, where Bulma's default `overflow-x: hidden` on the page cuts it off (WCAG 1.4.10 Reflow), so keep it for a row that fits.",
|
|
165
165
|
"required": false,
|
|
166
166
|
"inherited": false,
|
|
167
167
|
"deprecated": false
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
9
|
"title": "A Searchable Select",
|
|
10
|
-
"code": "<form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"Country\"\n placeholder=\"Pick a country\"\n data={['Canada', 'France', 'Germany', 'Japan', 'Kenya', 'Mexico']}\n empty=\"No countries match\"\n />\n <Input label=\"City\" />\n <Input label=\"Postal code\" />\n <Button type=\"submit\" color=\"primary\">\n Save address\n </Button>\n</form>"
|
|
10
|
+
"code": "<form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"Country\"\n placeholder=\"Pick a country\"\n data={['Canada', 'France', 'Germany', 'Japan', 'Kenya', 'Mexico']}\n empty=\"No countries match\"\n />\n <Input autoComplete=\"address-level2\" label=\"City\" />\n <Input autoComplete=\"postal-code\" label=\"Postal code\" />\n <Button type=\"submit\" color=\"primary\">\n Save address\n </Button>\n</form>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Groups",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "A Controlled Value",
|
|
26
|
-
"code": "function example() {\n const [city, setCity] = useState<string | null>('lisbon');\n\n return (\n <form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"City\"\n value={city}\n onChange={setCity}\n data={[\n { value: 'lisbon', label: 'Lisbon' },\n { value: 'osaka', label: 'Osaka' },\n { value: 'oslo', label: 'Oslo' },\n { value: 'paris', label: 'Paris' },\n ]}\n />\n <Paragraph mb=\"3\">\n The value is <Code>{JSON.stringify(city)}</Code>.\n </Paragraph>\n <Buttons>\n <Button onClick={() => setCity('paris')}>Paris</Button>\n <Button onClick={() => setCity(null)}>Clear</Button>\n </Buttons>\n <Input label=\"Postal code\" />\n </form>\n );\n}"
|
|
26
|
+
"code": "function example() {\n const [city, setCity] = useState<string | null>('lisbon');\n\n return (\n <form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"City\"\n value={city}\n onChange={setCity}\n data={[\n { value: 'lisbon', label: 'Lisbon' },\n { value: 'osaka', label: 'Osaka' },\n { value: 'oslo', label: 'Oslo' },\n { value: 'paris', label: 'Paris' },\n ]}\n />\n <Paragraph mb=\"3\">\n The value is <Code>{JSON.stringify(city)}</Code>.\n </Paragraph>\n <Buttons>\n <Button onClick={() => setCity('paris')}>Paris</Button>\n <Button onClick={() => setCity(null)}>Clear</Button>\n </Buttons>\n <Input autoComplete=\"postal-code\" label=\"Postal code\" />\n </form>\n );\n}"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Custom Items",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "Building It Yourself",
|
|
42
|
-
"code": "function example() {\n const countries = ['Canada', 'France', 'Germany', 'Japan', 'Kenya', 'Mexico'];\n const [value, setValue] = useState<string | null>(null);\n const [query, setQuery] = useState('');\n // Showing the value isn't a search, so the whole list opens.\n const term = query === value ? '' : query.trim().toLowerCase();\n const matches = countries.filter(c => c.toLowerCase().includes(term));\n\n return (\n <form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"Country\"\n onSelect={picked => {\n setValue(picked);\n setQuery(picked);\n }}\n >\n <Combobox.Input\n placeholder=\"Pick a country\"\n value={query}\n onChange={e => setQuery(e.target.value)}\n onBlur={() => setQuery(value ?? '')}\n />\n <Combobox.Menu>\n {matches.length > 0 ? (\n <Combobox.List>\n {matches.map(c => (\n <Combobox.Item key={c} value={c} checked={c === value}>\n {c}\n </Combobox.Item>\n ))}\n </Combobox.List>\n ) : (\n <Combobox.Empty>No countries match</Combobox.Empty>\n )}\n </Combobox.Menu>\n </Combobox>\n <Input label=\"City\" />\n <Input label=\"Postal code\" />\n <Button type=\"submit\" color=\"primary\">\n Save address\n </Button>\n </form>\n );\n}"
|
|
42
|
+
"code": "function example() {\n const countries = ['Canada', 'France', 'Germany', 'Japan', 'Kenya', 'Mexico'];\n const [value, setValue] = useState<string | null>(null);\n const [query, setQuery] = useState('');\n // Showing the value isn't a search, so the whole list opens.\n const term = query === value ? '' : query.trim().toLowerCase();\n const matches = countries.filter(c => c.toLowerCase().includes(term));\n\n return (\n <form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"Country\"\n onSelect={picked => {\n setValue(picked);\n setQuery(picked);\n }}\n >\n <Combobox.Input\n placeholder=\"Pick a country\"\n value={query}\n onChange={e => setQuery(e.target.value)}\n onBlur={() => setQuery(value ?? '')}\n />\n <Combobox.Menu>\n {matches.length > 0 ? (\n <Combobox.List>\n {matches.map(c => (\n <Combobox.Item key={c} value={c} checked={c === value}>\n {c}\n </Combobox.Item>\n ))}\n </Combobox.List>\n ) : (\n <Combobox.Empty>No countries match</Combobox.Empty>\n )}\n </Combobox.Menu>\n </Combobox>\n <Input autoComplete=\"address-level2\" label=\"City\" />\n <Input autoComplete=\"postal-code\" label=\"Postal code\" />\n <Button type=\"submit\" color=\"primary\">\n Save address\n </Button>\n </form>\n );\n}"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"title": "Server Search",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"code": "<ContextMenu\n aria-label=\"Actions for notes.txt\"\n trigger={\n <Box tabIndex={0} p=\"6\" textAlign=\"centered\">\n notes.txt\n </Box>\n }\n>\n <ContextMenu.Item as=\"button\">Open</ContextMenu.Item>\n <ContextMenu.Item as=\"button\">Rename</ContextMenu.Item>\n <ContextMenu.Divider />\n <ContextMenu.Item as=\"button\">Delete</ContextMenu.Item>\n</ContextMenu>"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"accessibility": "`ContextMenu` follows the [WAI-ARIA menu pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/),\nwithout a menubar or submenus:\n\n- **Opening:** APG names \"a command, such as Shift + F10 in Windows, that opens a context specific\n menu\". That's the browser's `contextmenu` event, which <kbd>Shift</kbd>+<kbd>F10</kbd> and the\n context menu key fire on Windows and Linux, and VoiceOver's <kbd>VO</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd>\n fires on macOS. `ContextMenu` adds no key handler of its own, so the menu never opens twice for\n one key.\n- **Focus on open** goes to the first enabled item, or to the menu itself when there's none.\n- <kbd>ArrowDown</kbd> and <kbd>ArrowUp</kbd> move to the next and previous item, wrapping, and\n <kbd>Home</kbd> and <kbd>End</kbd> go to the first and last.\n- **Typing** a letter moves to the next item whose text starts with what's been typed. Letters typed\n in quick succession add up to one search, and the same letter again cycles through the items that\n start with it. Each opening starts a new search.\n- <kbd>Enter</kbd> and <kbd>Space</kbd> activate the focused item the way a click does, so its\n `onClick` runs, and a key held down activates it once.\n- <kbd>Escape</kbd> closes the menu and returns focus to what had it before the menu opened. It\n stops there, so a `Popover` or a `Modal` around the menu stays open.\n- <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> close it and return focus too. The menu sits at\n the end of the page, so letting Tab go on from it would skip the rest of the page.\n- An item that runs closes the menu and returns focus, unless it moved focus somewhere else, such as\n into a `Modal` it opened or a rename field.\n\nRoles and names:\n\n- The menu is `role=\"menu\"`, named by the `aria-label` or `aria-labelledby` you pass. There's no\n button to borrow a name from, and a development build warns when a menu opens without one.\n- Items are `menuitem` by default, and `menuitemcheckbox` or `menuitemradio` with `aria-checked`\n through the item's `role`. A divider is an `<hr>`, which is a separator.\n- An `active` item has `aria-current=\"true\"`, as in `Dropdown`, and an `aria-current` you pass\n wins.\n- Disabled items, a `button` with `disabled` or an item with `aria-disabled=\"true\"`, are skipped by\n the arrow keys and by typing, as in `Dropdown`, and they go on from an item that turns disabled\n while it keeps focus.\n- The trigger gets no ARIA, no role and no tab stop. `aria-haspopup` describes a popup that opens\n when an element is activated, and a right-click on a row isn't that. So nothing tells a screen\n reader user the menu is there, and on macOS only VoiceOver opens it from the keyboard: every action\n in it has to be reachable from a visible control as well, which\n [WCAG 2.1.1](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html) asks for.\n\nAnd around it:\n\n- The menu isn't modal. A press outside it closes it and does whatever it does, the rest of the page\n stays reachable, and nothing locks scrolling.\n- Nothing listens on the page while the menu is closed and no finger is held on its trigger, so a\n table with a menu on every row adds no listeners until one is used.\n- The menu doesn't animate.\n- In forced colors (Windows' contrast themes), a divider is drawn in the system's text color,
|
|
41
|
+
"accessibility": "`ContextMenu` follows the [WAI-ARIA menu pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/),\nwithout a menubar or submenus:\n\n- **Opening:** APG names \"a command, such as Shift + F10 in Windows, that opens a context specific\n menu\". That's the browser's `contextmenu` event, which <kbd>Shift</kbd>+<kbd>F10</kbd> and the\n context menu key fire on Windows and Linux, and VoiceOver's <kbd>VO</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd>\n fires on macOS. `ContextMenu` adds no key handler of its own, so the menu never opens twice for\n one key.\n- **Focus on open** goes to the first enabled item, or to the menu itself when there's none.\n- <kbd>ArrowDown</kbd> and <kbd>ArrowUp</kbd> move to the next and previous item, wrapping, and\n <kbd>Home</kbd> and <kbd>End</kbd> go to the first and last.\n- **Typing** a letter moves to the next item whose text starts with what's been typed. Letters typed\n in quick succession add up to one search, and the same letter again cycles through the items that\n start with it. Each opening starts a new search.\n- <kbd>Enter</kbd> and <kbd>Space</kbd> activate the focused item the way a click does, so its\n `onClick` runs, and a key held down activates it once.\n- <kbd>Escape</kbd> closes the menu and returns focus to what had it before the menu opened. It\n stops there, so a `Popover` or a `Modal` around the menu stays open.\n- <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> close it and return focus too. The menu sits at\n the end of the page, so letting Tab go on from it would skip the rest of the page.\n- An item that runs closes the menu and returns focus, unless it moved focus somewhere else, such as\n into a `Modal` it opened or a rename field.\n\nRoles and names:\n\n- The menu is `role=\"menu\"`, named by the `aria-label` or `aria-labelledby` you pass. There's no\n button to borrow a name from, and a development build warns when a menu opens without one.\n- Items are `menuitem` by default, and `menuitemcheckbox` or `menuitemradio` with `aria-checked`\n through the item's `role`. A divider is an `<hr>`, which is a separator.\n- An `active` item has `aria-current=\"true\"`, as in `Dropdown`, and an `aria-current` you pass\n wins.\n- Disabled items, a `button` with `disabled` or an item with `aria-disabled=\"true\"`, are skipped by\n the arrow keys and by typing, as in `Dropdown`, and they go on from an item that turns disabled\n while it keeps focus.\n- The trigger gets no ARIA, no role and no tab stop. `aria-haspopup` describes a popup that opens\n when an element is activated, and a right-click on a row isn't that. So nothing tells a screen\n reader user the menu is there, and on macOS only VoiceOver opens it from the keyboard: every action\n in it has to be reachable from a visible control as well, which\n [WCAG 2.1.1](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html) asks for.\n\nAnd around it:\n\n- The menu isn't modal. A press outside it closes it and does whatever it does, the rest of the page\n stays reachable, and nothing locks scrolling.\n- Nothing listens on the page while the menu is closed and no finger is held on its trigger, so a\n table with a menu on every row adds no listeners until one is used.\n- The menu doesn't animate.\n- In forced colors (Windows' contrast themes), a divider is drawn in the system's text color, and\n an `active` item is marked with a bar in the system's highlight color, as in `Dropdown`. Those\n rules ship in `bestax.css` and `extras.css`, from the dropdown partial, so a modular build adds\n `scss/components/dropdown` for them.",
|
|
42
42
|
"related": [
|
|
43
43
|
"ConfigProvider",
|
|
44
44
|
"Dropdown",
|
|
@@ -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- 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
|
|
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.",
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"name": "label",
|
|
196
196
|
"type": "React.ReactNode",
|
|
197
197
|
"default": null,
|
|
198
|
-
"description": "Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one.
|
|
198
|
+
"description": "Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In `inline` mode, where there's no input, it names the picker instead, which is then a `role=\"group\"`, through `aria-labelledby`, unless `labelProps.htmlFor` wires it by hand. An `aria-label` or `aria-labelledby` you set names the picker over it, and an `aria-labelledby` key counts even when undefined. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here. Inline, that `Field`'s label names the picker's group whatever the `id`.",
|
|
199
199
|
"required": false,
|
|
200
200
|
"inherited": false,
|
|
201
201
|
"deprecated": false
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
"name": "message",
|
|
331
331
|
"type": "React.ReactNode",
|
|
332
332
|
"default": null,
|
|
333
|
-
"description": "Help or validation text under the input. It describes the input through `aria-describedby`; inline, with no input, it describes
|
|
333
|
+
"description": "Help or validation text under the input. It describes the input through `aria-describedby`; inline, with no input, it describes the picker's group when something names it.",
|
|
334
334
|
"required": false,
|
|
335
335
|
"inherited": false,
|
|
336
336
|
"deprecated": false
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
"name": "inline",
|
|
493
493
|
"type": "boolean",
|
|
494
494
|
"default": "false",
|
|
495
|
-
"description": "Render the calendar inline (no popover). On a server-rendered page it marks today once the page hydrates, by the browser's clock rather than the server's. With no `value` or `defaultValue` it opens on the month the clock reads, and around the end of a month the server's clock and the browser's can read different months, so give it a date both render the same.",
|
|
495
|
+
"description": "Render the calendar inline (no popover). On a server-rendered page it marks today once the page hydrates, by the browser's clock rather than the server's. With no `value` or `defaultValue` it opens on the month the clock reads, and around the end of a month the server's clock and the browser's can read different months, so give it a date both render the same. Inline, the root is a `role=\"group\"` when something names it: a labeled `Field` around it that isn't `grouped` or `hasAddons` and has no `labelProps.htmlFor`, or an `aria-label` or `aria-labelledby` you give it. The `message` of a wrapper around it describes it then.",
|
|
496
496
|
"required": false,
|
|
497
497
|
"inherited": true,
|
|
498
498
|
"deprecated": false
|
|
@@ -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
|
{
|
|
@@ -855,7 +855,7 @@
|
|
|
855
855
|
"name": "inline",
|
|
856
856
|
"type": "boolean",
|
|
857
857
|
"default": "false",
|
|
858
|
-
"description": "Render the calendar inline (no popover). On a server-rendered page it marks today once the page hydrates, by the browser's clock rather than the server's. With no `value` or `defaultValue` it opens on the month the clock reads, and around the end of a month the server's clock and the browser's can read different months, so give it a date both render the same.",
|
|
858
|
+
"description": "Render the calendar inline (no popover). On a server-rendered page it marks today once the page hydrates, by the browser's clock rather than the server's. With no `value` or `defaultValue` it opens on the month the clock reads, and around the end of a month the server's clock and the browser's can read different months, so give it a date both render the same. Inline, the root is a `role=\"group\"` when something names it: a labeled `Field` around it that isn't `grouped` or `hasAddons` and has no `labelProps.htmlFor`, or an `aria-label` or `aria-labelledby` you give it. The `message` of a wrapper around it describes it then.",
|
|
859
859
|
"required": false,
|
|
860
860
|
"inherited": false,
|
|
861
861
|
"deprecated": false
|
|
@@ -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
|
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"code": "<Field label=\"Leave\">\n <Control iconLeftName=\"calendar-alt\">\n <DateRangeInput />\n </Control>\n</Field>"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"accessibility": "- The root is a `role=\"group\"` named by `label` through `aria-labelledby`, since the label names two inputs rather than one. Inside a labeled `Field`, that `Field`'s label names the group the same way, whether the `Field` holds `DateRangeInput` or a `DateRangeInputBase` you composed in a `Control` yourself, `inline` or not. An `aria-label` or `aria-labelledby` you give the group wins over either label.\n- Each input is a `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded` and `aria-controls`, and its own name: \"Start date\" or \"End date\", from the `labels` keys `rangeStart` and `rangeEnd`. The separator between them is hidden from assistive technology.\n- The popover is a `role=\"dialog\"` named \"Choose date range\" (`labels.chooseDateRange`). Opening it puts focus on the calendar's focused day, and closing it returns focus to the input you were last in, or to the start input.\n- With `monthsToShow`, each month is a grid of its own, named by its month and year, and the calendar keeps one tab stop across them.\n- The day grid is `aria-multiselectable`, and its days sit in a `role=\"row\"` per week. Every day of the range is `aria-selected`, both ends included. While the end is still being picked, only the start is: the preview is not a selection.\n- In forced colors (Windows' contrast themes), the fill and the band that mark the range are replaced, so bestax's styles draw every day of a picked range, both ends included, and the year the header's year list is on, in the system's highlight colors there, or in the system's color for a disabled control when it's disabled. While the end is still being picked, only the start is filled, and the day the range would end on keeps its dashed edge.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, keeps its tab stop and keys, and picks nothing.\n- The start and end days are described as \"Start date\" and \"End date\", so moving onto either says which it is. While the end is still being picked, the day the range would end on is described as \"Choose as end date\" (`labels.rangePreviewEnd`).\n- A polite live region in the calendar states the range in words, such as \"Start date: June 10, 2024, End date: June 13, 2024\", and announces each pick. The grid points at it too, so moving into the grid reads the current range.\n- Everything else is the calendar `DateInput` uses: a roving `tabindex`, weekday column headers named in full (or by your `dayNames`), `aria-disabled` on disabled days, `aria-current=\"date\"` on today, and focus back on the grid as the year list closes.\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.\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 group through `aria-describedby`, after any ids you pass there, as the label names it.",
|
|
53
|
+
"accessibility": "- The root is a `role=\"group\"` named by `label` through `aria-labelledby`, since the label names two inputs rather than one. Inside a labeled `Field`, that `Field`'s label names the group the same way, whether the `Field` holds `DateRangeInput` or a `DateRangeInputBase` you composed in a `Control` yourself, `inline` or not. An `aria-label` or `aria-labelledby` you give the group wins over either label.\n- Each input is a `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded` and `aria-controls`, and its own name: \"Start date\" or \"End date\", from the `labels` keys `rangeStart` and `rangeEnd`. The separator between them is hidden from assistive technology.\n- `aria-invalid` and `aria-errormessage` go on both inputs, marking the range as a whole, while the other attributes you pass go on the group, so a screen reader hears an input is invalid when it takes focus. An `inline` picker has no input, and they stay on its group.\n- The popover is a `role=\"dialog\"` named \"Choose date range\" (`labels.chooseDateRange`). Opening it puts focus on the calendar's focused day, and closing it returns focus to the input you were last in, or to the start input.\n- With `monthsToShow`, each month is a grid of its own, named by its month and year, and the calendar keeps one tab stop across them.\n- The day grid is `aria-multiselectable`, and its days sit in a `role=\"row\"` per week. Every day of the range is `aria-selected`, both ends included. While the end is still being picked, only the start is: the preview is not a selection.\n- In forced colors (Windows' contrast themes), the fill and the band that mark the range are replaced, so bestax's styles draw every day of a picked range, both ends included, and the year the header's year list is on, in the system's highlight colors there, or in the system's color for a disabled control when it's disabled. While the end is still being picked, only the start is filled, and the day the range would end on keeps its dashed edge.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, keeps its tab stop and keys, and picks nothing.\n- The start and end days are described as \"Start date\" and \"End date\", so moving onto either says which it is. While the end is still being picked, the day the range would end on is described as \"Choose as end date\" (`labels.rangePreviewEnd`).\n- A polite live region in the calendar states the range in words, such as \"Start date: June 10, 2024, End date: June 13, 2024\", and announces each pick. The grid points at it too, so moving into the grid reads the current range.\n- Everything else is the calendar `DateInput` uses: a roving `tabindex`, weekday column headers named in full (or by your `dayNames`), `aria-disabled` on disabled days, `aria-current=\"date\"` on today, and focus back on the grid as the year list closes.\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.\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 group through `aria-describedby`, after any ids you pass there, as the label names it.",
|
|
54
54
|
"related": ["DateInput", "DateTimeInput", "Field"],
|
|
55
55
|
"storybook": "https://bestax.io/storybook/?path=/story/form-daterangeinput",
|
|
56
56
|
"summary": "The `DateRangeInput` component is a form input for a start and end date, picked from one popover calendar or typed into two segmented inputs.",
|