bestax-mcp 1.18.72 → 1.18.74
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 +11 -11
- package/data/components/Autocomplete.json +1 -1
- package/data/components/Badge.json +16 -13
- package/data/components/Card.json +26 -6
- package/data/components/Carousel.json +18 -18
- package/data/components/Cascader.json +1 -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 +4 -4
- package/data/components/ContextMenu.json +1 -1
- package/data/components/DateInput.json +5 -5
- package/data/components/DateRangeInput.json +1 -1
- package/data/components/DateTimeInput.json +5 -5
- package/data/components/Dialog.json +11 -2
- 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/LocaleProvider.json +1 -1
- 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 +11 -2
- package/data/components/Numberinput.json +15 -2
- package/data/components/Panel.json +5 -5
- package/data/components/Radio.json +1 -1
- package/data/components/RadioCard.json +1 -1
- package/data/components/Rate.json +15 -2
- package/data/components/Reveal.json +2 -2
- package/data/components/Select.json +5 -5
- package/data/components/Slider.json +7 -7
- 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 +2 -2
- package/data/components/TimeInput.json +5 -5
- package/data/components/Timeline.json +2 -2
- package/data/components/Toast.json +29 -2
- package/data/components/Tooltip.json +3 -3
- package/data/components/TreeSelect.json +1 -1
- package/data/skills/bestax-form/SKILL.md +9 -7
- package/data/skills/bestax-form/references/api.md +4 -3
- 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/bulma-classes/unmappables.md +3 -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 +1 -0
- package/data/skills/bestax-optimize/references/modular-build.md +20 -5
- package/data/skills/bestax-theming/references/css-variables.md +9 -2
- 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.76.0"
|
|
6
6
|
},
|
|
7
7
|
"docsBase": "https://bestax.io/docs",
|
|
8
8
|
"categories": [
|
|
@@ -1067,7 +1067,7 @@
|
|
|
1067
1067
|
"slug": "elements/notification",
|
|
1068
1068
|
"import": "import { Notification, NotificationContainer, notification } from '@allxsmith/bestax-bulma';",
|
|
1069
1069
|
"compound": false,
|
|
1070
|
-
"propCount":
|
|
1070
|
+
"propCount": 8,
|
|
1071
1071
|
"exampleCount": 7
|
|
1072
1072
|
},
|
|
1073
1073
|
{
|
|
@@ -1089,8 +1089,8 @@
|
|
|
1089
1089
|
"slug": "form/numberinput",
|
|
1090
1090
|
"import": "import { Numberinput } from '@allxsmith/bestax-bulma';",
|
|
1091
1091
|
"compound": false,
|
|
1092
|
-
"propCount":
|
|
1093
|
-
"exampleCount":
|
|
1092
|
+
"propCount": 26,
|
|
1093
|
+
"exampleCount": 13
|
|
1094
1094
|
},
|
|
1095
1095
|
{
|
|
1096
1096
|
"name": "OrderedList",
|
|
@@ -1243,8 +1243,8 @@
|
|
|
1243
1243
|
"slug": "form/rate",
|
|
1244
1244
|
"import": "import { Rate } from '@allxsmith/bestax-bulma';",
|
|
1245
1245
|
"compound": false,
|
|
1246
|
-
"propCount":
|
|
1247
|
-
"exampleCount":
|
|
1246
|
+
"propCount": 29,
|
|
1247
|
+
"exampleCount": 13
|
|
1248
1248
|
},
|
|
1249
1249
|
{
|
|
1250
1250
|
"name": "Reveal",
|
|
@@ -1573,7 +1573,7 @@
|
|
|
1573
1573
|
"slug": "components/toast",
|
|
1574
1574
|
"import": "import { Toast, ToastContainer, toast } from '@allxsmith/bestax-bulma';",
|
|
1575
1575
|
"compound": false,
|
|
1576
|
-
"propCount":
|
|
1576
|
+
"propCount": 18,
|
|
1577
1577
|
"exampleCount": 7
|
|
1578
1578
|
},
|
|
1579
1579
|
{
|
|
@@ -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",
|
|
@@ -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",
|
|
@@ -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",
|
|
@@ -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\"`\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.",
|
|
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\"`\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.",
|
|
@@ -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
|
+
},
|
|
48
|
+
{
|
|
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>"
|
|
47
51
|
},
|
|
48
|
-
{ "title": "Standalone", "code": "<Badge content={5} color=\"info\" />" },
|
|
49
52
|
{
|
|
50
53
|
"title": "Standalone, Interactive",
|
|
51
54
|
"code": "function example() {\n const [clicks, setClicks] = useState(0);\n\n return (\n <Badge content={clicks} showZero onClick={() => setClicks(c => c + 1)} />\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- `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.",
|
|
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
|
},
|
|
@@ -7,70 +7,70 @@
|
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
9
|
"title": "Basic Carousel",
|
|
10
|
-
"code": "<Carousel indicatorStyle=\"dots\">\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 <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
10
|
+
"code": "<Carousel ariaLabel=\"Highlights\" indicatorStyle=\"dots\">\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 <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Several Items in View",
|
|
14
|
-
"code": "<Carousel
|
|
14
|
+
"code": "<Carousel\n ariaLabel=\"Rooms\"\n itemsToShow={1}\n itemsToShowTablet={2}\n itemsToShowDesktop={3}\n>\n {[\n 'Garden Room',\n 'Harbor Suite',\n 'Loft',\n 'Courtyard Twin',\n 'Terrace Room',\n 'Family Suite',\n ].map(room => (\n <CarouselItem key={room}>\n <Card m=\"2\">\n <Card.Content>\n <Title as=\"p\" size=\"5\">\n {room}\n </Title>\n <SubTitle as=\"p\" size=\"6\">\n Sleeps two\n </SubTitle>\n </Card.Content>\n </Card>\n </CarouselItem>\n ))}\n</Carousel>"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "Several Items in View › Stepping and indicators",
|
|
18
|
-
"code": "<Carousel itemsToShow={3}
|
|
18
|
+
"code": "<Carousel\n ariaLabel=\"Numbered items\"\n itemsToShow={3}\n itemsToScroll={3}\n repeat={false}\n>\n {[1, 2, 3, 4, 5, 6, 7].map(n => (\n <CarouselItem key={n}>\n <Box m=\"2\" textAlign=\"centered\">\n Item {n}\n </Box>\n </CarouselItem>\n ))}\n</Carousel>"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"title": "Several Items in View › Spacing between items",
|
|
22
|
-
"code": "<Carousel className=\"room-gallery\" itemsToShow={3}>\n {/* items */}\n</Carousel>"
|
|
22
|
+
"code": "<Carousel ariaLabel=\"Room gallery\" className=\"room-gallery\" itemsToShow={3}>\n {/* items */}\n</Carousel>"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "Auto-playing Carousel",
|
|
26
|
-
"code": "<Carousel autoplay interval={3000}>\n <CarouselItem>\n <Hero color=\"info\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Info</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"warning\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Warning</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\">Success</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
26
|
+
"code": "<Carousel ariaLabel=\"Status colors\" autoplay interval={3000}>\n <CarouselItem>\n <Hero color=\"info\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Info</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"warning\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Warning</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\">Success</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Indicator Styles",
|
|
30
|
-
"code": "function IndicatorExample() {\n const [style, setStyle] = useState<'dots' | 'circles' | 'lines' | 'bars'>(\n 'dots'\n );\n return (\n <Block>\n <Buttons mb=\"4\">\n <Button\n onClick={() => setStyle('dots')}\n color={style === 'dots' ? 'primary' : undefined}\n >\n Dots\n </Button>\n <Button\n onClick={() => setStyle('circles')}\n color={style === 'circles' ? 'primary' : undefined}\n >\n Circles\n </Button>\n <Button\n onClick={() => setStyle('lines')}\n color={style === 'lines' ? 'primary' : undefined}\n >\n Lines\n </Button>\n <Button\n onClick={() => setStyle('bars')}\n color={style === 'bars' ? 'primary' : undefined}\n >\n Bars\n </Button>\n </Buttons>\n <Carousel indicatorStyle={style}>\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 </Block>\n );\n}"
|
|
30
|
+
"code": "function IndicatorExample() {\n const [style, setStyle] = useState<'dots' | 'circles' | 'lines' | 'bars'>(\n 'dots'\n );\n return (\n <Block>\n <Buttons mb=\"4\">\n <Button\n onClick={() => setStyle('dots')}\n color={style === 'dots' ? 'primary' : undefined}\n >\n Dots\n </Button>\n <Button\n onClick={() => setStyle('circles')}\n color={style === 'circles' ? 'primary' : undefined}\n >\n Circles\n </Button>\n <Button\n onClick={() => setStyle('lines')}\n color={style === 'lines' ? 'primary' : undefined}\n >\n Lines\n </Button>\n <Button\n onClick={() => setStyle('bars')}\n color={style === 'bars' ? 'primary' : undefined}\n >\n Bars\n </Button>\n </Buttons>\n <Carousel ariaLabel=\"Indicator styles\" indicatorStyle={style}>\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 </Block>\n );\n}"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Indicators Over the Slides",
|
|
34
|
-
"code": "<Carousel indicatorInside>\n <CarouselItem>\n <Hero color=\"dark\" 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=\"link\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 2</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
34
|
+
"code": "<Carousel ariaLabel=\"Indicators over the slides\" indicatorInside>\n <CarouselItem>\n <Hero color=\"dark\" 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=\"link\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 2</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "Plain Indicators Over the Slides",
|
|
38
|
-
"code": "<Carousel indicatorInside overlayControls={false}>\n {['Garden Room', 'Harbor Suite', 'Loft', 'Courtyard Twin'].map(room => (\n <CarouselItem key={room}>\n <Card m=\"2\">\n <Card.Content px=\"6\" py=\"6\" textAlign=\"centered\">\n <Title as=\"p\" size=\"5\" mt=\"5\">\n {room}\n </Title>\n <SubTitle as=\"p\" size=\"6\" mb=\"5\">\n Sleeps two\n </SubTitle>\n </Card.Content>\n </Card>\n </CarouselItem>\n ))}\n</Carousel>"
|
|
38
|
+
"code": "<Carousel ariaLabel=\"Featured rooms\" indicatorInside overlayControls={false}>\n {['Garden Room', 'Harbor Suite', 'Loft', 'Courtyard Twin'].map(room => (\n <CarouselItem key={room}>\n <Card m=\"2\">\n <Card.Content px=\"6\" py=\"6\" textAlign=\"centered\">\n <Title as=\"p\" size=\"5\" mt=\"5\">\n {room}\n </Title>\n <SubTitle as=\"p\" size=\"6\" mb=\"5\">\n Sleeps two\n </SubTitle>\n </Card.Content>\n </Card>\n </CarouselItem>\n ))}\n</Carousel>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "Overlay Arrows",
|
|
42
|
-
"code": "<Carousel overlayControls>\n <CarouselItem>\n <Hero color=\"dark\" 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=\"link\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 2</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
42
|
+
"code": "<Carousel ariaLabel=\"Overlay arrows\" overlayControls>\n <CarouselItem>\n <Hero color=\"dark\" 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=\"link\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 2</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"title": "Without Arrows",
|
|
46
|
-
"code": "<Carousel arrow={false}>\n <CarouselItem>\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Swipe or Click Dots</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"link\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Navigation Only</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
46
|
+
"code": "<Carousel ariaLabel=\"Navigation without arrows\" arrow={false}>\n <CarouselItem>\n <Hero color=\"primary\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Swipe or Click Dots</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"link\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Navigation Only</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"title": "Arrows on Hover",
|
|
50
|
-
"code": "<Carousel arrowHover>\n <CarouselItem>\n <Hero color=\"dark\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Hover to see arrows</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"primary\" 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=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Slide 3</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
50
|
+
"code": "<Carousel ariaLabel=\"Arrows on hover\" arrowHover>\n <CarouselItem>\n <Hero color=\"dark\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Hover to see arrows</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"primary\" 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=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Slide 3</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"title": "Transparent Arrow Buttons",
|
|
54
|
-
"code": "<Carousel arrowBackground={false}>\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 <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
54
|
+
"code": "<Carousel ariaLabel=\"Transparent arrows\" arrowBackground={false}>\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 <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"title": "Custom Arrow Icons",
|
|
58
|
-
"code": "<Carousel\n iconPrev=\"chevron-left\"\n iconNext=\"chevron-right\"\n iconLibrary=\"fa\"\n iconVariant=\"solid\"\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 <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
58
|
+
"code": "<Carousel\n ariaLabel=\"Font Awesome arrows\"\n iconPrev=\"chevron-left\"\n iconNext=\"chevron-right\"\n iconLibrary=\"fa\"\n iconVariant=\"solid\"\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 <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Title as=\"p\">Slide 3</Title>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"title": "With Material Design Icons",
|
|
62
|
-
"code": "<Carousel iconPrev=\"arrow-left\"
|
|
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
64
|
{
|
|
65
65
|
"title": "Controlled Carousel",
|
|
66
|
-
"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 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}"
|
|
66
|
+
"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}"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"title": "Non-repeating Carousel",
|
|
70
|
-
"code": "<Carousel 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>"
|
|
70
|
+
"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
71
|
}
|
|
72
72
|
],
|
|
73
|
-
"accessibility": "- Uses `role=\"region\"` with `aria-roledescription=\"carousel\"`\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.",
|
|
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.",
|
|
74
74
|
"related": ["Modal", "Tabs"],
|
|
75
75
|
"storybook": "https://bestax.io/storybook/?path=/story/components-carousel",
|
|
76
76
|
"summary": "The `Carousel` component provides an image/content slider with navigation arrows and indicators.",
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
"name": "ariaLabel",
|
|
340
340
|
"type": "string",
|
|
341
341
|
"default": "'Image carousel'",
|
|
342
|
-
"description": "
|
|
342
|
+
"description": "The carousel region's name. Name it for what it shows, such as \"Featured products\", and leave out the word \"carousel\", which the region's role description already says. Under a visible heading, `aria-labelledby` with the heading's id names it instead, ahead of the `aria-label` the default still sets. The default is a placeholder that says \"carousel\" twice with the role description, and is the same on every carousel left with it. Default: 'Image carousel'.",
|
|
343
343
|
"required": false,
|
|
344
344
|
"inherited": false,
|
|
345
345
|
"deprecated": false
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"code": "<LocaleProvider locale=\"ar\" dir=\"rtl\">\n <Cascader\n label=\"المدينة\"\n defaultValue=\"berlin\"\n clearable\n data={[\n {\n value: 'germany',\n label: 'ألمانيا',\n children: [{ value: 'berlin', label: 'برلين' }],\n },\n { value: 'oceania', label: 'أوقيانوسيا' },\n ]}\n />\n</LocaleProvider>"
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
|
-
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' and TreeSelect's are:\n `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the\n panel is open, named by its `label`. It's read-only, and its value is the picked node's path.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked node, its path open, or with nothing picked onto the first\n column's item on an open path, or its first enabled item, so a `defaultExpanded` path stays\n open. It holds\n focus while it's open, as the date pickers' panel does: Tab and Shift+Tab move between the\n search box and the columns, and wrap. Escape and Alt+Up close it and put focus back on the\n field, and so does a pick. A press outside closes it and leaves focus where the press put it.\n- **Each column** is a `listbox` with one tab stop and real focus on its `option`s. The first is\n named as the panel is, and each one after it by the label of the item that opened it. Up, Down,\n Home, End and type-ahead move within a column, and type-ahead starts over in each column it\n comes into and after Up, Down, Home or End. Space joins a search under way when an item starts with what's been typed and a\n space, so \"new y\" reaches \"New York\", and otherwise picks or opens. Right opens the next column\n and moves into it, Left goes back, and the two swap on a right-to-left page. Disabled items are\n reachable and `aria-disabled`, and Right moves into a column at its item on the open path even\n when that one is disabled.\n- **The picked node's path is `aria-selected`,** and drawn filled, its items `is-checked` as\n Combobox's picked items are. The path you've opened, which follows focus, is drawn with a lighter\n tint, its items `is-active` as Combobox's highlighted item is, and isn't announced as selected, so moving around never says an item is picked when it isn't. A disabled\n node on the picked path is selected but not filled, so it stays readable. In forced colors the\n picked path takes the system's highlight and the open path an outline. Right opens the focused\n item and nothing else.\n- **An item that opens a column** is described by \"Opens a column\", or `labels.opens`, since an\n option has no way of its own to say it has items under it. Its chevron is hidden.\n- **A column that's loading** ends in a row that says so, and a failed load's row is named by its\n message and its Retry, which Enter, Space or a click run. The live region says when a column\n starts loading and when it's loaded, as TreeView's does.\n- **The search box** is named \"Search\", or `labels.search`, and its results are a listbox of the\n paths that match. Enter picks the highlighted path unless it's disabled, and with none\n highlighted it does nothing, so it never submits the form around the field. When nothing matches, `empty` is said once\n through a polite status region, not again on every key.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the columns keep their edges in system colors, the\n path through the columns keeps the system's highlight, and the chevrons are borders, so they\n stay.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the field through `aria-describedby`, after any ids you pass there, so a screen reader reads it when the field takes focus.",
|
|
45
|
+
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' and TreeSelect's are:\n `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the\n panel is open, named by its `label`. It's read-only, and its value is the picked node's path.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked node, its path open, or with nothing picked onto the first\n column's item on an open path, or its first enabled item, so a `defaultExpanded` path stays\n open. It holds\n focus while it's open, as the date pickers' panel does: Tab and Shift+Tab move between the\n search box and the columns, and wrap. Escape and Alt+Up close it and put focus back on the\n field, and so does a pick. A press outside closes it and leaves focus where the press put it.\n- **Each column** is a `listbox` with one tab stop and real focus on its `option`s. The first is\n named as the panel is, and each one after it by the label of the item that opened it. Up, Down,\n Home, End and type-ahead move within a column, and type-ahead starts over in each column it\n comes into and after Up, Down, Home or End. Space joins a search under way when an item starts with what's been typed and a\n space, so \"new y\" reaches \"New York\", and otherwise picks or opens. Right opens the next column\n and moves into it, Left goes back, and the two swap on a right-to-left page. Disabled items are\n reachable and `aria-disabled`, and Right moves into a column at its item on the open path even\n when that one is disabled.\n- **The picked node's path is `aria-selected`,** and drawn filled, its items `is-checked` as\n Combobox's picked items are. The path you've opened, which follows focus, is drawn with a lighter\n tint, its items `is-active` as Combobox's highlighted item is, and isn't announced as selected, so moving around never says an item is picked when it isn't. A disabled\n node on the picked path is selected but not filled, so it stays readable. In forced colors the\n picked path takes the system's highlight and the open path an outline. Right opens the focused\n item and nothing else.\n- **An item that opens a column** is described by \"Opens a column\", or `labels.opens`, since an\n option has no way of its own to say it has items under it. Its chevron is hidden.\n- **A column that's loading** ends in a row that says so, and a failed load's row is named by its\n message and its Retry, which Enter, Space or a click run. The live region says when a column\n starts loading and when it's loaded, as TreeView's does.\n- **The search box** is named \"Search\", or `labels.search`, and its results are a listbox of the\n paths that match. Enter picks the highlighted path unless it's disabled, and with none\n highlighted it does nothing, so it never submits the form around the field. When nothing matches, `empty` is said once\n through a polite status region, not again on every key.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the columns keep their edges in system colors, the\n path through the columns keeps the system's highlight, and the chevrons are borders, so they\n stay.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the field through `aria-describedby`, after any ids you pass there, so a screen reader reads it when the field takes focus.\n- `aria-invalid` and `aria-errormessage` go on the field, while the other attributes you pass go on the wrapper, so a screen reader hears the field is invalid when it takes focus.",
|
|
46
46
|
"related": [
|
|
47
47
|
"Combobox",
|
|
48
48
|
"Select",
|
|
@@ -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.\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
|