bestax-mcp 1.18.72 → 1.18.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/catalog.json +7 -7
- package/data/components/Autocomplete.json +1 -1
- package/data/components/Carousel.json +18 -18
- package/data/components/Cascader.json +1 -1
- package/data/components/Combobox.json +1 -1
- package/data/components/DateInput.json +1 -1
- package/data/components/DateTimeInput.json +1 -1
- package/data/components/Dialog.json +11 -2
- package/data/components/LocaleProvider.json +1 -1
- package/data/components/Modal.json +2 -2
- package/data/components/Navbar.json +2 -2
- package/data/components/Notification.json +10 -1
- package/data/components/Numberinput.json +14 -1
- package/data/components/Rate.json +15 -2
- package/data/components/Slider.json +6 -6
- package/data/components/Taginput.json +1 -1
- package/data/components/TimeInput.json +1 -1
- package/data/components/Toast.json +10 -1
- package/data/components/TreeSelect.json +1 -1
- package/data/skills/bestax-form/SKILL.md +5 -4
- package/data/skills/bestax-form/references/api.md +4 -3
- package/data/skills/bestax-migrate/references/bulma-classes/unmappables.md +3 -1
- package/data/skills/bestax-optimize/references/modular-build.md +2 -2
- package/package.json +2 -2
package/data/catalog.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"generatedFrom": {
|
|
4
4
|
"package": "@allxsmith/bestax-bulma",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.75.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
|
{
|
|
@@ -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,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 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",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"code": "function example() {\n const drinks: Record<\n string,\n { value: string; label: string; disabled?: boolean }[]\n > = {\n Hot: [\n { value: 'coffee', label: 'Coffee' },\n { value: 'tea', label: 'Tea' },\n ],\n Cold: [\n { value: 'lemonade', label: 'Lemonade' },\n { value: 'iced-tea', label: 'Iced tea' },\n { value: 'smoothie', label: 'Smoothie (sold out)', disabled: true },\n ],\n };\n const [query, setQuery] = useState('');\n const [value, setValue] = useState('tea');\n const picked = Object.values(drinks)\n .flat()\n .find(i => i.value === value);\n const term = query.trim().toLowerCase();\n const groups = Object.entries(drinks)\n .map(([label, items]) => ({\n label,\n items: items.filter(i => i.label.toLowerCase().includes(term)),\n }))\n .filter(g => g.items.length > 0);\n\n return (\n <form onSubmit={e => e.preventDefault()}>\n <Combobox\n label=\"Drink\"\n message={`Your drink: ${picked?.label}`}\n onSelect={next => {\n setValue(next);\n setQuery('');\n }}\n >\n <Combobox.Input\n iconLeftName=\"mug-hot\"\n placeholder=\"Type to filter\"\n value={query}\n onChange={e => setQuery(e.target.value)}\n />\n <Combobox.Menu>\n {groups.length > 0 ? (\n <Combobox.List>\n {groups.map(g => (\n <Combobox.Group key={g.label} label={g.label}>\n {g.items.map(i => (\n <Combobox.Item\n key={i.value}\n value={i.value}\n checked={i.value === value}\n disabled={i.disabled}\n >\n {i.label}\n </Combobox.Item>\n ))}\n </Combobox.Group>\n ))}\n </Combobox.List>\n ) : (\n <Combobox.Empty>No drinks match</Combobox.Empty>\n )}\n </Combobox.Menu>\n </Combobox>\n <Select label=\"Size\">\n <option>Small</option>\n <option>Medium</option>\n <option>Large</option>\n </Select>\n <Input label=\"Name for the cup\" />\n <Button type=\"submit\" color=\"primary\">\n Order\n </Button>\n </form>\n );\n}"
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
"accessibility": "- **The roles:** the field is `role=\"combobox\"` with `aria-autocomplete=\"list\"` and\n `aria-haspopup=\"listbox\"`. The list is a `listbox` of `option`s, and a group is a `group` named by\n its heading. This is the ARIA 1.2 combobox the ARIA Authoring Practices describe.\n- **Focus stays in the field:** the highlighted item is the field's `aria-activedescendant`.\n When a key or the list opening moves the highlight, the item is scrolled into view, since a\n browser only scrolls to what has focus. The pointer moves it without scrolling, since the pointer\n is already on that item. A click on an item keeps focus in the field too.\n- **`aria-expanded`** is `true` while a list with an item in it is on screen, and\n `aria-controls` points at the list then. While the menu shows just the empty message, the\n field says it's collapsed, and so does the server markup for a list rendered with\n `appendToBody`, which shows only once the page has hydrated.\n- **The list's name** comes from the label that names the field: the Combobox's `label`, or an\n outer `Field`'s. An `aria-label` or `aria-labelledby` you put on `Combobox.List` wins, and\n with none of these the list is named \"Suggestions\". Given `data`, an `aria-label` or\n `aria-labelledby` on the Combobox names the field and the list, so it needs no `label`.\n- **`aria-selected`, with one value,** is on the highlighted item and nothing else, the way the\n Authoring Practices' combobox examples do it. The value shows as a check mark, which doesn't rely\n on color, and the list opens with the highlight on it. Several libraries put `aria-selected` on\n the chosen item instead.\n- **With `multiple`,** the list is `aria-multiselectable`, and each item's `aria-selected` is its\n `checked`.\n- **Disabled items** are `aria-disabled` and stay reachable with the arrows, the Authoring\n Practices' advice for listbox options, so a screen reader user finds them. They're never picked\n or `aria-selected`, and the opening highlight and `keepFirst` pass over them.\n- **The empty message** sits beside the list, not in it, so it isn't counted as an item. When\n your typing brings it on screen, its text is announced through a polite status region that's in\n the page from the start, once each time the matches run out. Opening the list with it already\n there, or emptying the field, announces nothing. While `isLoading` is on, or a loading `Control`\n is around the Combobox, the announcement waits and is made once loading ends. In a menu,\n keep it to text: Tab closes the list before a keyboard user can reach a link or a button in it.\n An `inline` list stays on screen, so a link or a button beside it is in the Tab order.\n- **Tags,** with `multiple` and `data`: the field's `aria-describedby` points at the tags' labels,\n since its own text is the search, so focusing it reads the picks. Each tag's button is named\n \"Remove\" and the item's label, or `ariaCloseLabel` with the label as its description, and\n taking a tag off puts focus back in the field, which then reads the picks that are left.\n- **No counts are announced,** for the reasons in [A Result Count](https://bestax.io/docs/api/form/combobox#a-result-count).\n- **Enter and Escape:** Enter submits the form when nothing is highlighted, and Escape only stops\n at the Combobox when it closed a panel that was on screen.\n- **Forced colors:** in Windows high contrast mode the highlight is drawn as an outline in the\n system's highlight color, a disabled item takes the system's color for disabled text, and the\n check mark and the panel's edge stay visible.\n- A menu that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the field through `aria-describedby`, after any ids you pass to `Combobox.Input` and, with `data` and `multiple`, after the picked tags.",
|
|
65
|
+
"accessibility": "- **The roles:** the field is `role=\"combobox\"` with `aria-autocomplete=\"list\"` and\n `aria-haspopup=\"listbox\"`. The list is a `listbox` of `option`s, and a group is a `group` named by\n its heading. This is the ARIA 1.2 combobox the ARIA Authoring Practices describe.\n- **Focus stays in the field:** the highlighted item is the field's `aria-activedescendant`.\n When a key or the list opening moves the highlight, the item is scrolled into view, since a\n browser only scrolls to what has focus. The pointer moves it without scrolling, since the pointer\n is already on that item. A click on an item keeps focus in the field too.\n- **`aria-expanded`** is `true` while a list with an item in it is on screen, and\n `aria-controls` points at the list then. While the menu shows just the empty message, the\n field says it's collapsed, and so does the server markup for a list rendered with\n `appendToBody`, which shows only once the page has hydrated.\n- **The list's name** comes from the label that names the field: the Combobox's `label`, or an\n outer `Field`'s. An `aria-label` or `aria-labelledby` you put on `Combobox.List` wins, and\n with none of these the list is named \"Suggestions\". Given `data`, an `aria-label` or\n `aria-labelledby` on the Combobox names the field and the list, so it needs no `label`.\n- **`aria-selected`, with one value,** is on the highlighted item and nothing else, the way the\n Authoring Practices' combobox examples do it. The value shows as a check mark, which doesn't rely\n on color, and the list opens with the highlight on it. Several libraries put `aria-selected` on\n the chosen item instead.\n- **With `multiple`,** the list is `aria-multiselectable`, and each item's `aria-selected` is its\n `checked`.\n- **Disabled items** are `aria-disabled` and stay reachable with the arrows, the Authoring\n Practices' advice for listbox options, so a screen reader user finds them. They're never picked\n or `aria-selected`, and the opening highlight and `keepFirst` pass over them.\n- **The empty message** sits beside the list, not in it, so it isn't counted as an item. When\n your typing brings it on screen, its text is announced through a polite status region that's in\n the page from the start, once each time the matches run out. Opening the list with it already\n there, or emptying the field, announces nothing. While `isLoading` is on, or a loading `Control`\n is around the Combobox, the announcement waits and is made once loading ends. In a menu,\n keep it to text: Tab closes the list before a keyboard user can reach a link or a button in it.\n An `inline` list stays on screen, so a link or a button beside it is in the Tab order.\n- **Tags,** with `multiple` and `data`: the field's `aria-describedby` points at the tags' labels,\n since its own text is the search, so focusing it reads the picks. Each tag's button is named\n \"Remove\" and the item's label, or `ariaCloseLabel` with the label as its description, and\n taking a tag off puts focus back in the field, which then reads the picks that are left.\n- **No counts are announced,** for the reasons in [A Result Count](https://bestax.io/docs/api/form/combobox#a-result-count).\n- **Enter and Escape:** Enter submits the form when nothing is highlighted, and Escape only stops\n at the Combobox when it closed a panel that was on screen.\n- **Forced colors:** in Windows high contrast mode the highlight is drawn as an outline in the\n system's highlight color, a disabled item takes the system's color for disabled text, and the\n check mark and the panel's edge stay visible.\n- A menu that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the field through `aria-describedby`, after any ids you pass to `Combobox.Input` and, with `data` and `multiple`, after the picked tags.\n- With `data`, `aria-invalid` and `aria-errormessage` go on the field, while the Combobox's other attributes go on the wrapper, so a screen reader hears the field is invalid when it takes focus. Built from parts, pass them to `Combobox.Input`.",
|
|
66
66
|
"related": [
|
|
67
67
|
"Autocomplete",
|
|
68
68
|
"Cascader",
|
|
@@ -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 nothing.",
|
|
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 nothing.\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.",
|
|
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.",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"code": "<DateTimeInput label=\"Input only\" popover={false} defaultValue={new Date()} />"
|
|
171
171
|
}
|
|
172
172
|
],
|
|
173
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today gets it once the page hydrates, so the reader's clock decides which day.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes nothing.",
|
|
173
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- Cells expose `aria-selected`, `aria-disabled`, and `aria-current=\"date\"` for today. On a server-rendered page, today gets it once the page hydrates, so the reader's clock decides which day.\n- In forced colors (Windows' contrast themes), the fill that marks the selected day, and the year the header's year list is on, is replaced, so bestax's styles draw it in the system's highlight colors there, or in the system's color for a disabled control when it's disabled.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes nothing.\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.",
|
|
174
174
|
"related": ["DateInput", "Input", "TimeInput"],
|
|
175
175
|
"storybook": "https://bestax.io/storybook/?path=/story/form-datetimeinput",
|
|
176
176
|
"summary": "The `DateTimeInput` combines a calendar and a time **wheel spinner** in a single popover — an iOS-style layout.",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"code": "function example() {\n const [showDialog, setShowDialog] = useState(false);\n return (\n <Block>\n <Button onClick={() => setShowDialog(true)}>Show Portaled Dialog</Button>\n <Dialog\n isOpen={showDialog}\n title=\"Portaled Dialog\"\n message=\"This dialog is portaled, so it escapes any ancestor with overflow: hidden.\"\n onConfirm={() => setShowDialog(false)}\n showCancel={false}\n portal\n />\n </Block>\n );\n}"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
|
-
"accessibility": "- Uses `role=\"alertdialog\"` for proper screen reader announcement\n- Has `aria-modal=\"true\"` to indicate modal behavior — note this does not make background content inert; no `inert` attribute is applied, so background content stays reachable by pointer\n- `title`, when there is one, is wired up as `aria-labelledby` and `message` as `aria-describedby`, through ids the dialog makes for itself, so a second dialog open at the same time, or an element of your own with the same id, doesn't take its name or its description. An `aria-labelledby` or `aria-describedby` you pass replaces them\n- The built-in icon of a `success`, `danger`, `warning` or `info` dialog is `aria-hidden`, and the type's color isn't announced either, so say in the title or the message what kind of dialog it is when that matters, as for a destructive action. An `icon` you pass is rendered as you pass it\n- Focus moves to the confirm (or cancel, with `focusCancel`) button when opened\n- Escape key closes the dialog (when `canCancel` is true). The underlying [`Modal`](https://bestax.io/docs/api/components/modal#accessibility) handles it, so one Escape closes the topmost overlay only: a dialog opened over a Modal or a [Sidebar](https://bestax.io/docs/api/components/sidebar) closes first, and the one under it on the next Escape\n- Tab and Shift+Tab cycle within the dialog while it is the topmost modal overlay, also from the underlying [`Modal`](https://bestax.io/docs/api/components/modal)\n- A popup in the message, such as a `Popover` or `HoverCard` with `appendToBody`, is portaled into the `alertdialog`, the element with `aria-modal`, so a screen reader that honors it reaches the popup. A `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config#where-portaled-content-goes) sets still takes it\n- The page doesn't scroll while the dialog is open, through the [`Modal`](https://bestax.io/docs/api/components/modal#accessibility)'s ref-counted lock, shared with `Sidebar` and `Loading`\n- Confirm/cancel buttons are keyboard accessible\n- In forced colors (Windows' contrast themes), which drop the dialog's shadow and repaint its background and the backdrop's, the dialog keeps a one pixel edge in the system's text color",
|
|
33
|
+
"accessibility": "- Uses `role=\"alertdialog\"` for proper screen reader announcement\n- Has `aria-modal=\"true\"` to indicate modal behavior — note this does not make background content inert; no `inert` attribute is applied, so background content stays reachable by pointer\n- **Give every dialog a name.** A dialog with no `title` has none unless you give it an `aria-label`, which `dialog.alert` and `dialog.confirm` take in their options too, or an `aria-labelledby` pointing at text of your own. A development build warns about an open dialog with none of them\n- `title`, when there is one, is wired up as `aria-labelledby` and `message` as `aria-describedby`, through ids the dialog makes for itself, so a second dialog open at the same time, or an element of your own with the same id, doesn't take its name or its description. An `aria-labelledby` or `aria-describedby` you pass replaces them\n- The built-in icon of a `success`, `danger`, `warning` or `info` dialog is `aria-hidden`, and the type's color isn't announced either, so say in the title or the message what kind of dialog it is when that matters, as for a destructive action. An `icon` you pass is rendered as you pass it\n- Focus moves to the confirm (or cancel, with `focusCancel`) button when opened\n- Escape key closes the dialog (when `canCancel` is true). The underlying [`Modal`](https://bestax.io/docs/api/components/modal#accessibility) handles it, so one Escape closes the topmost overlay only: a dialog opened over a Modal or a [Sidebar](https://bestax.io/docs/api/components/sidebar) closes first, and the one under it on the next Escape\n- Tab and Shift+Tab cycle within the dialog while it is the topmost modal overlay, also from the underlying [`Modal`](https://bestax.io/docs/api/components/modal)\n- A popup in the message, such as a `Popover` or `HoverCard` with `appendToBody`, is portaled into the `alertdialog`, the element with `aria-modal`, so a screen reader that honors it reaches the popup. A `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config#where-portaled-content-goes) sets still takes it\n- The page doesn't scroll while the dialog is open, through the [`Modal`](https://bestax.io/docs/api/components/modal#accessibility)'s ref-counted lock, shared with `Sidebar` and `Loading`\n- Confirm/cancel buttons are keyboard accessible\n- In forced colors (Windows' contrast themes), which drop the dialog's shadow and repaint its background and the backdrop's, the dialog keeps a one pixel edge in the system's text color",
|
|
34
34
|
"related": ["Modal", "Toast"],
|
|
35
35
|
"storybook": "https://bestax.io/storybook/?path=/story/components-dialog",
|
|
36
36
|
"summary": "The `Dialog` component provides ready-made confirm and alert dialogs, so a destructive action stays one `await dialog.confirm()` call away.",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"name": "title",
|
|
57
57
|
"type": "string",
|
|
58
58
|
"default": null,
|
|
59
|
-
"description": "Dialog title, which names the dialog through `aria-labelledby` unless you pass an `aria-labelledby` of your own.",
|
|
59
|
+
"description": "Dialog title, which names the dialog through `aria-labelledby` unless you pass an `aria-labelledby` of your own. A dialog with no title has no name unless you give it an `aria-label`, or an `aria-labelledby` pointing at text of yours, and a development build warns about one with none.",
|
|
60
60
|
"required": false,
|
|
61
61
|
"inherited": false,
|
|
62
62
|
"deprecated": false
|
|
@@ -179,6 +179,15 @@
|
|
|
179
179
|
"required": false,
|
|
180
180
|
"inherited": false,
|
|
181
181
|
"deprecated": false
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "aria-label",
|
|
185
|
+
"type": "string",
|
|
186
|
+
"default": null,
|
|
187
|
+
"description": "The dialog's accessible name, for a dialog with no `title`. A development build warns about an open dialog with no title, `aria-label` or `aria-labelledby`.",
|
|
188
|
+
"required": false,
|
|
189
|
+
"inherited": false,
|
|
190
|
+
"deprecated": false
|
|
182
191
|
}
|
|
183
192
|
],
|
|
184
193
|
"catchAll": "All standard <div> attributes and Bulma helper props",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
}
|
|
114
114
|
],
|
|
115
115
|
"cssVars": [],
|
|
116
|
-
"doc": "# LocaleProvider\n\n## Overview\n\n`LocaleProvider` sets the language and writing direction for the part of the app inside it, on a wrapper `<div>` and on what the library portals out of it.\n\nIt takes a `locale` and a `dir`, and each works alone. A `locale` such as `\"ar-EG\"` becomes the wrapper's `lang`, and its script decides the direction, so `dir=\"rtl\"` comes with it. A `dir` sets the direction whatever the locale, for a right-to-left layout with no particular language, or a locale whose script reads one way on a page laid out the other. A nested provider keeps whatever it leaves unset.\n\nThe direction lives on the wrapper as a `dir` attribute, so CSS follows it, and so do the components that read the direction they're laid out in, as they follow `<html dir>`. A page whose `<html>` already has `dir=\"rtl\"` needs no provider for that. What the provider adds is the rest:\n\n- a section of the page in another language or direction than the page around it;\n- the content the library portals to the end of `document.body`, such as a `Popover` panel, a `Modal` with `portal`, a `Toast` or a `Portal`'s children, which leaves the section it came from and gets the provider's `dir` and `lang` back;\n- the date and time pickers inside, which take its `locale` and start the week on that locale's first day;\n- the numbers the library writes, such as page numbers, badge counts and a slider's output, and the filtering in `Combobox`, `Autocomplete`, `Taginput` and `Command`, which follow the `locale` too.\n\nWithout a provider none of this changes: a picker uses the runtime's own locale and starts the week on Sunday, numbers are written as they always have been, and filtering ignores case only.\n\n---\n\n## Import\n\n```tsx\nimport { LocaleProvider, useLocale } from '@allxsmith/bestax-bulma';\n```\n\n---\n\n## Hooks\n\n### useLocale\n\nReturns the `locale` and `dir` the nearest provider sets, both `undefined` outside one. The locale is in its canonical form, so `\"en-us\"` comes back as `\"en-US\"`. Use it for your own `Intl` calls, so they match the components around them, or for `dir` and `lang` on content you portal yourself.\n\n```tsx\nfunction Price({ amount }: { amount: number }) {\n const { locale } = useLocale();\n return (\n <span>\n {new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: 'EUR',\n }).format(amount)}\n </span>\n );\n}\n```\n\nFor numbers, [`NumberFormatter`](https://bestax.io/docs/api/elements/numberformatter) and its `useNumberFormat` hook do this for you, and build one formatter for each set of options rather than one on every render.\n\nIt isn't the direction of the page: with no provider, or one that sets no direction, `<html dir>` still decides. To act on the direction an element is laid out in, read `getComputedStyle(element).direction`.\n\n---\n\n## Usage\n\n### A Right-to-Left Section\n\nA `locale` alone sets the direction of its script. Arabic reads right to left, so the wrapper gets `dir=\"rtl\"` and `lang=\"ar-EG\"`, and the steps lay out from the right. The words a screen reader hears for each step's state come from `completedLabel` and `upcomingLabel`, so they're in Arabic too.\n\n```tsx live\n<LocaleProvider locale=\"ar-EG\">\n <Steps\n value={1}\n items={[{ label: 'السلة' }, { label: 'الشحن' }, { label: 'الدفع' }]}\n completedLabel=\"مكتملة\"\n upcomingLabel=\"قادمة\"\n />\n</LocaleProvider>\n```\n\nThe wrapper is a plain `<div>` with no class of its own. It takes the helper props and any other attributes, and forwards its `ref`.\n\n### Direction Only\n\n`dir` sets the direction and leaves the language alone. It also wins over a `locale`'s own direction.\n\n```tsx live\n<LocaleProvider dir=\"rtl\">\n <Buttons>\n <Button color=\"primary\">First</Button>\n <Button>Second</Button>\n </Buttons>\n</LocaleProvider>\n```\n\n### Nested Providers\n\nAn inner provider keeps whatever it leaves unset. One that sets only a `locale` takes that locale's direction, so a French quote inside a Hebrew section reads left to right, and one that sets only a `dir` keeps the outer locale.\n\n```tsx live\n<LocaleProvider locale=\"he\">\n <Content>\n <p>הציטוט האהוב עליי:</p>\n <LocaleProvider locale=\"fr\">\n <blockquote>La simplicité est la sophistication suprême.</blockquote>\n </LocaleProvider>\n </Content>\n</LocaleProvider>\n```\n\n### Date Pickers\n\nThe date and time pickers take the provider's `locale` unless they have their own, for their day and month names, the digits their calendar and time wheels write numbers in, the time wheels' words for AM and PM, and any `Intl` format. Inside a provider, the week starts on the first day of the locale the picker uses: Monday for `\"de\"`, Saturday for `\"ar-EG\"`, Sunday for `\"en-US\"`. A picker's own `firstDayOfWeek` still wins, and a picker with its own `dayNames` keeps Sunday unless it sets `firstDayOfWeek` too, since it shows those names exactly as given.\n\n```tsx live\n<LocaleProvider locale=\"de\">\n <DateInput inline label=\"Liefertermin\" />\n</LocaleProvider>\n```\n\nOutside a provider a picker keeps Sunday, even with a `locale` of its own, so pages that never asked for a different first day don't get one. The first day comes from a copy of [CLDR](https://cldr.unicode.org/)'s week data that the library carries, rather than from each browser's, because browsers disagree about a few regions, China among them, and a calendar rendered on the server has to come out the same in the browser. A `-u-fw-` extension in the tag, such as `\"en-US-u-fw-mon\"`, picks the day outright.\n\n### Numbers and Matching\n\nWith a `locale`, the numbers the library writes itself are written the way that locale writes them, with its digits and separators: `Pagination`'s page numbers, `Steps` markers, a `Badge` count, the `Avatars` surplus, a `RingProgress` in sections, `Rate`'s score, the `Slider` output, `Taginput`'s counter and the count of files `File` shows. Where an accessible name repeats a number on screen, as a page link's does, it's written the same way, so the name still holds the text. A label function you pass, such as `getPageLabel` or `formatOutput`, takes over as before.\n\n```tsx live\n<LocaleProvider locale=\"ar-EG\">\n <Pagination total={12} current={5} />\n</LocaleProvider>\n```\n\nNumbers of your own follow it through [`NumberFormatter`](https://bestax.io/docs/api/elements/numberformatter), and through its `useNumberFormat` hook for text outside JSX, such as an `aria-label`. Outside a provider, those write in the runtime's locale, while the library's own numbers stay as they always were.\n\nTyping in `Combobox`, `Autocomplete`, `Taginput` and `Command` filters the list the way the language compares letters: case and accents are ignored where it treats them as the same letter, so \"cafe\" finds \"Café\", while in Swedish \"a\" doesn't find \"å\", a letter of its own there. Vowel marks the language leaves out of comparisons, such as Arabic harakat and Hebrew niqqud, don't count on either side, so a name typed without them finds one written with them, and the other way round.\n\n```tsx live\n<LocaleProvider locale=\"fr\">\n <Combobox\n label=\"Boisson\"\n data={['Café', 'Thé', 'Chocolat chaud']}\n placeholder=\"Tapez « the »\"\n />\n</LocaleProvider>\n```\n\nThe pickers' digits stay as they are: their typed text is a token format of ASCII digits, and a calendar in another set of digits would sit under it. Numbers inside the library's English labels that aren't on screen, such as a carousel slide's \"1 of 3\", stay as they are too, since they get translated together with their words.\n\n### Portaled Content\n\nWhat the library portals renders at the end of `document.body`, in the `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config) sets, or, for a popup, in the overlay it was opened in, any of which can be outside the provider's wrapper. Inside a provider, that content keeps the provider's `dir` and `lang`. That covers a `Portal`'s children, a `Popover`, `HoverCard` or `ContextMenu` panel, a `Combobox` menu or picker popover with `appendToBody`, a `Modal` or `Dialog` with `portal`, a `Sidebar`, and toasts and notifications.\n\nA container inside the provider's own wrapper takes the content as it is, and the content follows the provider through the page. Any other, `document.body` included, gets it inside one `<div>` carrying the values, with `display: contents`, so it adds no box and changes no layout. It is still an element, though, so content that must be its container's direct child, such as a `<tr>` portaled into a `<tbody>`, belongs in a container inside the provider. Which of the two is settled when the content mounts: switching the locale while a dialog or a toast is open updates that `<div>` in place, so what's open keeps its typed text, focus and timers.\n\n```tsx live\n<LocaleProvider locale=\"fa\">\n <Popover trigger={<Button>جزئیات</Button>} appendToBody ariaLabel=\"جزئیات\">\n <Popover.Body>\n این پنل بیرون از بخش رندر میشود و همچنان راستبهچپ است.\n </Popover.Body>\n </Popover>\n</LocaleProvider>\n```\n\nA date or time picker with a `locale` of its own is read the way a nested provider is: its popover, portaled or not, and an inline calendar take its `lang`, and the direction of its locale unless it has a `dir` of its own. So a French picker in an Arabic section shows a French calendar laid out left to right. The `Control` the picker renders takes that direction too, so its icon stays at the start of the field and the launcher at the end. In a `Control` of your own, give the `Control` the picker's `dir`.\n\nFor content you portal yourself without `Portal`, put the values from `useLocale()` on it.\n\n### Server Rendering\n\nThe wrapper's `dir` and `lang` come from its props, so the server and the browser write the same ones, and portaled content only renders after hydration.\n\nSet a `locale` when an `inline` picker renders on the server. With none, `Intl` names its days in the runtime's own language, which is the server's on the server and the reader's in the browser, and the two renders don't match when those differ. With a locale they match, as long as the server's `Intl` data and the browser's spell the names alike. They don't always: Node and Safari write the short name for Saturday differently in Arabic. Where that matters, pass the picker its own `dayNames`, and with them the `firstDayOfWeek` they start on. The calendar and the time wheels take their digits from the same data, and a `-u-nu-` extension in the locale, such as `\"ar-u-nu-arab\"`, names the digits outright. The calendar shows `dayNames` exactly as given, from the first column, so a picker that brings its own keeps the week on Sunday, as it did before the provider, unless `firstDayOfWeek` says otherwise.\n\n```tsx live\n<LocaleProvider locale=\"ar-EG\">\n <DateInput\n inline\n label=\"تاريخ التسليم\"\n firstDayOfWeek={6}\n dayNames={[\n 'السبت',\n 'الأحد',\n 'الاثنين',\n 'الثلاثاء',\n 'الأربعاء',\n 'الخميس',\n 'الجمعة',\n ]}\n />\n</LocaleProvider>\n```\n\nFor an app that's in one language throughout, also set `lang` and `dir` on `<html>` in your page shell. That reaches what sits outside any provider, and the provider still carries them onto portaled content.\n\nIn the Next.js App Router, render it straight from the root layout, which stays a Server Component. `LocaleProvider` holds React context, so it's a client component, and bestax-bulma marks it one, so the layout can render it without a `'use client'` wrapper of its own. The `locale` and `children` here are values a Server Component can pass. It also takes the wrapper `<div>`'s attributes, and an event handler among them can't cross from a Server Component, so set one from a client component:\n\n```tsx title=\"app/layout.tsx\"\nimport type { ReactNode } from 'react';\nimport { LocaleProvider } from '@allxsmith/bestax-bulma';\n\nexport default function RootLayout({ children }: { children: ReactNode }) {\n return (\n <html lang=\"ar-EG\" dir=\"rtl\">\n <body>\n <LocaleProvider locale=\"ar-EG\">{children}</LocaleProvider>\n </body>\n </html>\n );\n}\n```\n\n### A Locale Intl Doesn't Accept\n\nA tag `Intl` refuses, such as `\"en_US\"` with an underscore, is ignored: the provider writes no `lang`, keeps an outer provider's locale, and warns once in development. A `NumberFormatter`'s or `useNumberFormat`'s own `locale` is checked the same way: a tag `Intl` refuses is ignored with a warning, and the number is written in the provider's locale. A picker's own `locale` isn't checked this way, and `Intl` throws on such a tag when the picker formats with it, as it always has.\n\n---\n\n## Accessibility\n\n- `lang` tells a screen reader which voice and pronunciation to use, and a translation tool what it's reading. The provider puts it on its wrapper and on portaled content, so a dialog or a notification announced from the end of the page comes in the same language.\n- `dir` decides the reading order of the content inside, and which side text starts on. Set the one the content is written in: a left-to-right quote in a right-to-left page needs its own provider or `dir`.\n- The provider changes no focus order and adds no role. The element it wraps portaled content in has `display: contents`, so it adds no box and no landmark.\n\n---\n\n## Related Components\n\n- [`ConfigProvider`](https://bestax.io/docs/api/helpers/config): The class prefix, icon library and portal container. A nested one replaces the outer one's settings, which is why the locale lives here instead.\n- [`Portal`](https://bestax.io/docs/api/helpers/portal): Inside a `LocaleProvider`, its children keep the provider's `dir` and `lang`.\n- [`DateInput`](https://bestax.io/docs/api/form/datetime/dateinput): Takes the provider's locale and first day of the week.\n- [`NumberFormatter`](https://bestax.io/docs/api/elements/numberformatter): Writes a number in the provider's locale, and `useNumberFormat` does the same for text outside JSX.\n- [`Theme`](https://bestax.io/docs/api/helpers/theme): Its scoped wrapper is the same idea for CSS variables.\n\n---\n\n## Additional Resources\n\n- [Storybook: LocaleProvider Stories](https://bestax.io/storybook/?path=/story/helpers-localeprovider--default)\n- [W3C: Structural markup and right-to-left text in HTML](https://www.w3.org/International/questions/qa-html-dir)\n- [MDN: the `lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)\n- [MDN: `Intl.Locale.prototype.getWeekInfo()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo)\n\n---\n\n## Props\n\n| Prop | Type | Default | Description |\n| ---------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `locale` | `string` | — | A BCP 47 language tag, such as `\"de\"` or `\"ar-EG\"`: the wrapper's `lang`, the pickers' default `locale`, and, with no `dir`, the direction of its script. Unset, a nested provider keeps the outer one's. A tag `Intl` refuses is ignored. |\n| `dir` | `'ltr'` \\| `'rtl'` | — | The direction, whatever the locale. Unset, it follows this provider's `locale`, else an outer provider's direction, else the page's. |\n| `children` | `ReactNode` | — | The part of the app it covers. |\n\nThe helper props, the other attributes of a `<div>` and the `ref` land on the wrapper."
|
|
116
|
+
"doc": "# LocaleProvider\n\n## Overview\n\n`LocaleProvider` sets the language and writing direction for the part of the app inside it, on a wrapper `<div>` and on what the library portals out of it.\n\nIt takes a `locale` and a `dir`, and each works alone. A `locale` such as `\"ar-EG\"` becomes the wrapper's `lang`, and its script decides the direction, so `dir=\"rtl\"` comes with it. A `dir` sets the direction whatever the locale, for a right-to-left layout with no particular language, or a locale whose script reads one way on a page laid out the other. A nested provider keeps whatever it leaves unset.\n\nThe direction lives on the wrapper as a `dir` attribute, so CSS follows it, and so do the components that read the direction they're laid out in, as they follow `<html dir>`. A page whose `<html>` already has `dir=\"rtl\"` needs no provider for that. What the provider adds is the rest:\n\n- a section of the page in another language or direction than the page around it;\n- the content the library portals to the end of `document.body`, such as a `Popover` panel, a `Modal` with `portal`, a `Toast` or a `Portal`'s children, which leaves the section it came from and gets the provider's `dir` and `lang` back;\n- the date and time pickers inside, which take its `locale` and start the week on that locale's first day;\n- the numbers the library writes, such as page numbers, badge counts and a slider's output, and the filtering in `Combobox`, `Autocomplete`, `Taginput` and `Command`, which follow the `locale` too.\n\nWithout a provider none of this changes: a picker uses the runtime's own locale and starts the week on Sunday, numbers are written as they always have been, and filtering ignores case only.\n\n---\n\n## Import\n\n```tsx\nimport { LocaleProvider, useLocale } from '@allxsmith/bestax-bulma';\n```\n\n---\n\n## Hooks\n\n### useLocale\n\nReturns the `locale` and `dir` the nearest provider sets, both `undefined` outside one. The locale is in its canonical form, so `\"en-us\"` comes back as `\"en-US\"`. Use it for your own `Intl` calls, so they match the components around them, or for `dir` and `lang` on content you portal yourself.\n\n```tsx\nfunction Price({ amount }: { amount: number }) {\n const { locale } = useLocale();\n return (\n <span>\n {new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: 'EUR',\n }).format(amount)}\n </span>\n );\n}\n```\n\nFor numbers, [`NumberFormatter`](https://bestax.io/docs/api/elements/numberformatter) and its `useNumberFormat` hook do this for you, and build one formatter for each set of options rather than one on every render.\n\nIt isn't the direction of the page: with no provider, or one that sets no direction, `<html dir>` still decides. To act on the direction an element is laid out in, read `getComputedStyle(element).direction`.\n\n---\n\n## Usage\n\n### A Right-to-Left Section\n\nA `locale` alone sets the direction of its script. Arabic reads right to left, so the wrapper gets `dir=\"rtl\"` and `lang=\"ar-EG\"`, and the steps lay out from the right. The words a screen reader hears for each step's state come from `completedLabel` and `upcomingLabel`, so they're in Arabic too.\n\n```tsx live\n<LocaleProvider locale=\"ar-EG\">\n <Steps\n value={1}\n items={[{ label: 'السلة' }, { label: 'الشحن' }, { label: 'الدفع' }]}\n completedLabel=\"مكتملة\"\n upcomingLabel=\"قادمة\"\n />\n</LocaleProvider>\n```\n\nThe wrapper is a plain `<div>` with no class of its own. It takes the helper props and any other attributes, and forwards its `ref`.\n\n### Direction Only\n\n`dir` sets the direction and leaves the language alone. It also wins over a `locale`'s own direction.\n\n```tsx live\n<LocaleProvider dir=\"rtl\">\n <Buttons>\n <Button color=\"primary\">First</Button>\n <Button>Second</Button>\n </Buttons>\n</LocaleProvider>\n```\n\n### Nested Providers\n\nAn inner provider keeps whatever it leaves unset. One that sets only a `locale` takes that locale's direction, so a French quote inside a Hebrew section reads left to right, and one that sets only a `dir` keeps the outer locale.\n\n```tsx live\n<LocaleProvider locale=\"he\">\n <Content>\n <p>הציטוט האהוב עליי:</p>\n <LocaleProvider locale=\"fr\">\n <blockquote>La simplicité est la sophistication suprême.</blockquote>\n </LocaleProvider>\n </Content>\n</LocaleProvider>\n```\n\n### Date Pickers\n\nThe date and time pickers take the provider's `locale` unless they have their own, for their day and month names, the digits their calendar and time wheels write numbers in, the time wheels' words for AM and PM, and any `Intl` format. Inside a provider, the week starts on the first day of the locale the picker uses: Monday for `\"de\"`, Saturday for `\"ar-EG\"`, Sunday for `\"en-US\"`. A picker's own `firstDayOfWeek` still wins, and a picker with its own `dayNames` keeps Sunday unless it sets `firstDayOfWeek` too, since it shows those names exactly as given.\n\n```tsx live\n<LocaleProvider locale=\"de\">\n <DateInput inline label=\"Liefertermin\" />\n</LocaleProvider>\n```\n\nOutside a provider a picker keeps Sunday, even with a `locale` of its own, so pages that never asked for a different first day don't get one. The first day comes from a copy of [CLDR](https://cldr.unicode.org/)'s week data that the library carries, rather than from each browser's, because browsers disagree about a few regions, China among them, and a calendar rendered on the server has to come out the same in the browser. A `-u-fw-` extension in the tag, such as `\"en-US-u-fw-mon\"`, picks the day outright.\n\n### Numbers and Matching\n\nWith a `locale`, the numbers the library writes itself are written the way that locale writes them, with its digits and separators: `Pagination`'s page numbers, `Steps` markers, a `Badge` count, the `Avatars` surplus, a `RingProgress` in sections, `Rate`'s score, the `Slider` output, `Taginput`'s counter and the count of files `File` shows. Where an accessible name repeats a number on screen, as a page link's does, it's written the same way, so the name still holds the text. A label function you pass, such as `getPageLabel` or `formatOutput`, takes over as before. `Rate`'s star names keep their numbers as they were: write them in its `labels.star`, with `useNumberFormat`.\n\n```tsx live\n<LocaleProvider locale=\"ar-EG\">\n <Pagination total={12} current={5} />\n</LocaleProvider>\n```\n\nNumbers of your own follow it through [`NumberFormatter`](https://bestax.io/docs/api/elements/numberformatter), and through its `useNumberFormat` hook for text outside JSX, such as an `aria-label`. Outside a provider, those write in the runtime's locale, while the library's own numbers stay as they always were.\n\nTyping in `Combobox`, `Autocomplete`, `Taginput` and `Command` filters the list the way the language compares letters: case and accents are ignored where it treats them as the same letter, so \"cafe\" finds \"Café\", while in Swedish \"a\" doesn't find \"å\", a letter of its own there. Vowel marks the language leaves out of comparisons, such as Arabic harakat and Hebrew niqqud, don't count on either side, so a name typed without them finds one written with them, and the other way round.\n\n```tsx live\n<LocaleProvider locale=\"fr\">\n <Combobox\n label=\"Boisson\"\n data={['Café', 'Thé', 'Chocolat chaud']}\n placeholder=\"Tapez « the »\"\n />\n</LocaleProvider>\n```\n\nThe pickers' digits stay as they are: their typed text is a token format of ASCII digits, and a calendar in another set of digits would sit under it. Numbers inside the library's English labels that aren't on screen, such as a carousel slide's \"1 of 3\", stay as they are too, since they get translated together with their words.\n\n### Portaled Content\n\nWhat the library portals renders at the end of `document.body`, in the `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config) sets, or, for a popup, in the overlay it was opened in, any of which can be outside the provider's wrapper. Inside a provider, that content keeps the provider's `dir` and `lang`. That covers a `Portal`'s children, a `Popover`, `HoverCard` or `ContextMenu` panel, a `Combobox` menu or picker popover with `appendToBody`, a `Modal` or `Dialog` with `portal`, a `Sidebar`, and toasts and notifications.\n\nA container inside the provider's own wrapper takes the content as it is, and the content follows the provider through the page. Any other, `document.body` included, gets it inside one `<div>` carrying the values, with `display: contents`, so it adds no box and changes no layout. It is still an element, though, so content that must be its container's direct child, such as a `<tr>` portaled into a `<tbody>`, belongs in a container inside the provider. Which of the two is settled when the content mounts: switching the locale while a dialog or a toast is open updates that `<div>` in place, so what's open keeps its typed text, focus and timers.\n\n```tsx live\n<LocaleProvider locale=\"fa\">\n <Popover trigger={<Button>جزئیات</Button>} appendToBody ariaLabel=\"جزئیات\">\n <Popover.Body>\n این پنل بیرون از بخش رندر میشود و همچنان راستبهچپ است.\n </Popover.Body>\n </Popover>\n</LocaleProvider>\n```\n\nA date or time picker with a `locale` of its own is read the way a nested provider is: its popover, portaled or not, and an inline calendar take its `lang`, and the direction of its locale unless it has a `dir` of its own. So a French picker in an Arabic section shows a French calendar laid out left to right. The `Control` the picker renders takes that direction too, so its icon stays at the start of the field and the launcher at the end. In a `Control` of your own, give the `Control` the picker's `dir`.\n\nFor content you portal yourself without `Portal`, put the values from `useLocale()` on it.\n\n### Server Rendering\n\nThe wrapper's `dir` and `lang` come from its props, so the server and the browser write the same ones, and portaled content only renders after hydration.\n\nSet a `locale` when an `inline` picker renders on the server. With none, `Intl` names its days in the runtime's own language, which is the server's on the server and the reader's in the browser, and the two renders don't match when those differ. With a locale they match, as long as the server's `Intl` data and the browser's spell the names alike. They don't always: Node and Safari write the short name for Saturday differently in Arabic. Where that matters, pass the picker its own `dayNames`, and with them the `firstDayOfWeek` they start on. The calendar and the time wheels take their digits from the same data, and a `-u-nu-` extension in the locale, such as `\"ar-u-nu-arab\"`, names the digits outright. The calendar shows `dayNames` exactly as given, from the first column, so a picker that brings its own keeps the week on Sunday, as it did before the provider, unless `firstDayOfWeek` says otherwise.\n\n```tsx live\n<LocaleProvider locale=\"ar-EG\">\n <DateInput\n inline\n label=\"تاريخ التسليم\"\n firstDayOfWeek={6}\n dayNames={[\n 'السبت',\n 'الأحد',\n 'الاثنين',\n 'الثلاثاء',\n 'الأربعاء',\n 'الخميس',\n 'الجمعة',\n ]}\n />\n</LocaleProvider>\n```\n\nFor an app that's in one language throughout, also set `lang` and `dir` on `<html>` in your page shell. That reaches what sits outside any provider, and the provider still carries them onto portaled content.\n\nIn the Next.js App Router, render it straight from the root layout, which stays a Server Component. `LocaleProvider` holds React context, so it's a client component, and bestax-bulma marks it one, so the layout can render it without a `'use client'` wrapper of its own. The `locale` and `children` here are values a Server Component can pass. It also takes the wrapper `<div>`'s attributes, and an event handler among them can't cross from a Server Component, so set one from a client component:\n\n```tsx title=\"app/layout.tsx\"\nimport type { ReactNode } from 'react';\nimport { LocaleProvider } from '@allxsmith/bestax-bulma';\n\nexport default function RootLayout({ children }: { children: ReactNode }) {\n return (\n <html lang=\"ar-EG\" dir=\"rtl\">\n <body>\n <LocaleProvider locale=\"ar-EG\">{children}</LocaleProvider>\n </body>\n </html>\n );\n}\n```\n\n### A Locale Intl Doesn't Accept\n\nA tag `Intl` refuses, such as `\"en_US\"` with an underscore, is ignored: the provider writes no `lang`, keeps an outer provider's locale, and warns once in development. A `NumberFormatter`'s or `useNumberFormat`'s own `locale` is checked the same way: a tag `Intl` refuses is ignored with a warning, and the number is written in the provider's locale. A picker's own `locale` isn't checked this way, and `Intl` throws on such a tag when the picker formats with it, as it always has.\n\n---\n\n## Accessibility\n\n- `lang` tells a screen reader which voice and pronunciation to use, and a translation tool what it's reading. The provider puts it on its wrapper and on portaled content, so a dialog or a notification announced from the end of the page comes in the same language.\n- `dir` decides the reading order of the content inside, and which side text starts on. Set the one the content is written in: a left-to-right quote in a right-to-left page needs its own provider or `dir`.\n- The provider changes no focus order and adds no role. The element it wraps portaled content in has `display: contents`, so it adds no box and no landmark.\n\n---\n\n## Related Components\n\n- [`ConfigProvider`](https://bestax.io/docs/api/helpers/config): The class prefix, icon library and portal container. A nested one replaces the outer one's settings, which is why the locale lives here instead.\n- [`Portal`](https://bestax.io/docs/api/helpers/portal): Inside a `LocaleProvider`, its children keep the provider's `dir` and `lang`.\n- [`DateInput`](https://bestax.io/docs/api/form/datetime/dateinput): Takes the provider's locale and first day of the week.\n- [`NumberFormatter`](https://bestax.io/docs/api/elements/numberformatter): Writes a number in the provider's locale, and `useNumberFormat` does the same for text outside JSX.\n- [`Theme`](https://bestax.io/docs/api/helpers/theme): Its scoped wrapper is the same idea for CSS variables.\n\n---\n\n## Additional Resources\n\n- [Storybook: LocaleProvider Stories](https://bestax.io/storybook/?path=/story/helpers-localeprovider--default)\n- [W3C: Structural markup and right-to-left text in HTML](https://www.w3.org/International/questions/qa-html-dir)\n- [MDN: the `lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)\n- [MDN: `Intl.Locale.prototype.getWeekInfo()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo)\n\n---\n\n## Props\n\n| Prop | Type | Default | Description |\n| ---------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `locale` | `string` | — | A BCP 47 language tag, such as `\"de\"` or `\"ar-EG\"`: the wrapper's `lang`, the pickers' default `locale`, and, with no `dir`, the direction of its script. Unset, a nested provider keeps the outer one's. A tag `Intl` refuses is ignored. |\n| `dir` | `'ltr'` \\| `'rtl'` | — | The direction, whatever the locale. Unset, it follows this provider's `locale`, else an outer provider's direction, else the page's. |\n| `children` | `ReactNode` | — | The part of the app it covers. |\n\nThe helper props, the other attributes of a `<div>` and the `ref` land on the wrapper."
|
|
117
117
|
}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"code": "function example() {\n const [open, setOpen] = useState(false);\n const closeModal = () => setOpen(false);\n\n return (\n <>\n <Button color=\"success\" onClick={() => setOpen(true)}>\n Show Modal\n </Button>\n <Modal\n isActive={open}\n onClose={closeModal}\n aria-labelledby=\"custom-content-title\"\n >\n <Modal.Background onClick={closeModal} />\n <Modal.Content>\n <Box>\n <Title size=\"4\" id=\"custom-content-title\">\n Custom Content\n </Title>\n <Paragraph>Using compound components for full control!</Paragraph>\n </Box>\n </Modal.Content>\n <Modal.Close variant=\"floating\" />\n </Modal>\n </>\n );\n}"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
|
-
"accessibility": "- The modal root gets `role=\"dialog\"` and `aria-modal=\"true\"` while active — pass an explicit `role` to override (e.g. `Dialog` passes `role=\"presentation\"` on the `Modal` it wraps so its own `role=\"alertdialog\"` is the only one announced).\n- **Give the dialog an accessible name.** With the legacy API, `modalCardTitle` is wired up as `aria-labelledby` for you
|
|
49
|
+
"accessibility": "- The modal root gets `role=\"dialog\"` and `aria-modal=\"true\"` while active — pass an explicit `role` to override (e.g. `Dialog` passes `role=\"presentation\"` on the `Modal` it wraps so its own `role=\"alertdialog\"` is the only one announced).\n- **Give the dialog an accessible name.** With the legacy API, `modalCardTitle` is wired up as `aria-labelledby` for you, and with `type=\"content\"`, which shows no card head, a title that's a string names the dialog as its `aria-label`. Without one, and with the compound API, pass your own `aria-label` or `aria-labelledby` on `<Modal>` — a `role=\"dialog\"` with no name is announced as just \"dialog\". An explicit `aria-labelledby` always wins over the generated one.\n- Escape closes the modal (calls `onClose`) by default; opt out with `closeOnEscape={false}`. One Escape closes the topmost overlay only, whichever open Modal, [Dialog](https://bestax.io/docs/api/components/dialog), [Sidebar](https://bestax.io/docs/api/components/sidebar) or full-page [Loading](https://bestax.io/docs/api/components/loading) opened last, and the next Escape closes the one under it. A modal on top with `closeOnEscape={false}` still keeps Escape from the layers under it. A [Toast](https://bestax.io/docs/api/components/toast) waits until no overlay is open.\n- The modal calls `preventDefault()` on the Escape it closes on, so a listener of your own that runs after it can tell the key was used.\n- A popup inside the modal takes its own Escape first. With an Autocomplete list, a Dropdown menu, a Popover or a date picker's calendar open, the first Escape closes that and the next one closes the modal.\n- A popup of your own inside a modal should call `preventDefault()` on the Escape it closes on. The modal leaves an Escape that was prevented alone, whether your popup hears it in a React `onKeyDown` or in a listener on `document`. Call it only when the popup is open and the key was pressed in it, so an Escape with nothing to close still closes the modal, and so does one pressed in a modal opened over your popup.\n- The page doesn't scroll under the modal while it's active; opt out with `lockScroll={false}`. The lock is ref-counted and shared with `Dialog`, `Sidebar` and `Loading`, so whichever overlay closes first doesn't unlock the page underneath one that is still open.\n- Focus moves to the first tab stop (or the modal itself) on open, and is restored to the previously focused element on close — unless another modal is still open on top, in which case that one keeps focus.\n- A popup opened inside the modal, such as a `Popover`, `HoverCard` or `ContextMenu` panel, or a `Combobox` menu or picker popover with `appendToBody`, is portaled into the modal's root rather than to the end of `<body>`, so a screen reader that honors `aria-modal` reaches it, and it's inside the Tab cycle below. A `portalContainer` a [`ConfigProvider`](https://bestax.io/docs/api/helpers/config#where-portaled-content-goes) sets still takes it. A [Lightbox](https://bestax.io/docs/api/components/lightbox) is a Modal, so the same goes for it.\n- Tab and Shift+Tab cycle within the modal while it is the topmost modal overlay, so the keyboard order agrees with what `aria-modal=\"true\"` tells assistive technology. They wrap at the same tab stops [`useFocusTrap`](https://bestax.io/docs/api/helpers/usefocustrap) does, so disabled, hidden and `tabIndex={-1}` elements are skipped, and so is inert content, such as a closed [Sidebar](https://bestax.io/docs/api/components/sidebar) inside the modal, and the content of a closed `<details>`. A radio group counts once. A Tab from outside the modal brings focus back in, and so does a Tab the browser takes out anyway, as Safari does past links when its settings say to. With another Modal or Dialog, a [Sidebar](https://bestax.io/docs/api/components/sidebar) with an overlay or a full-page Loading opened over it, the modal leaves Tab alone until that one closes. A Sidebar without an overlay isn't modal: opened over the modal, it takes Escape first, but the modal keeps holding Tab and keeps focus, so the sidebar doesn't take focus when it opens, and a Tab from its controls comes back into the modal. A focus trap of your own inside it, such as a portaled panel's, keeps a Tab it calls `preventDefault()` on, and the modal leaves focus where your trap put it. Note that `aria-modal` does not by itself make background content inert, and no `inert` attribute is applied, so background content remains reachable by pointer and by browser UI such as find-in-page.\n- In the props form, the background closes the modal on click, and a close button is provided for both modal-card and modal-content variants (both call `onClose`, so pass it). The close button is named \"close\" unless `ariaCloseLabel` names it. It's drawn as an icon, so its name is all a screen reader says about it: in an app in another language, give it one in the page's language. An `aria-label` on `Modal` names the dialog, not the button, and a `Modal.Close` in the compound form takes an `aria-label` of its own.\n- In the compound form, `Modal.Close` calls the modal's `onClose` unless you give it an `onClick` of your own, and `Modal.Background` closes the modal only when you pass it `onClick={onClose}`.\n- In forced colors (Windows' contrast themes), which repaint the card's backgrounds and the backdrop's, a modal card keeps a one pixel edge in the system's text color, from bestax's `components/modal` partial, which `bestax.css` includes.\n\n:::note\nAlways provide an `onClose` handler for accessibility and to allow users to dismiss the modal.\n:::",
|
|
50
50
|
"related": [
|
|
51
51
|
"Button",
|
|
52
52
|
"Dialog",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"name": "modalCardTitle",
|
|
136
136
|
"type": "React.ReactNode",
|
|
137
137
|
"default": null,
|
|
138
|
-
"description": "Title/header for modal-card variant, which names the dialog through `aria-labelledby`. Without one, give the modal an `aria-label`, or an `aria-labelledby` pointing at a heading inside it. (Legacy API only)",
|
|
138
|
+
"description": "Title/header for modal-card variant, which names the dialog through `aria-labelledby`. With `type=\"content\"` it isn't shown, and a title that's a string still names the dialog, as its `aria-label`. Without one, give the modal an `aria-label`, or an `aria-labelledby` pointing at a heading inside it. (Legacy API only)",
|
|
139
139
|
"required": false,
|
|
140
140
|
"inherited": false,
|
|
141
141
|
"deprecated": false
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"code": "<Navbar>\n <Navbar.Brand>\n <Navbar.Item href=\"#\">\n <img src=\"/img/logo.svg\" alt=\"Logo\" width=\"28\" height=\"28\" />\n </Navbar.Item>\n <Navbar.Burger aria-label=\"menu\" />\n </Navbar.Brand>\n <Navbar.Menu active>\n <Navbar.Start>\n <Navbar.Item href=\"#\">Home</Navbar.Item>\n <Navbar.Item href=\"#\">Docs</Navbar.Item>\n </Navbar.Start>\n <Navbar.End>\n <Navbar.Item href=\"#\">Log in</Navbar.Item>\n </Navbar.End>\n </Navbar.Menu>\n</Navbar>"
|
|
83
83
|
}
|
|
84
84
|
],
|
|
85
|
-
"accessibility": "- The root `Navbar` renders as `<nav role=\"navigation\" aria-label=\"main navigation\">`.\n The default accessible name is `main navigation`. A screen reader announces it with\n the role, and since the name holds the role word, \"navigation\" is heard twice.\n Pass a name without the role word (`aria-label=\"Site\"`), and a different name\n on each Navbar when a page has more than one. A passed `aria-label` replaces\n the default.\n- `Navbar.Item active` sets `aria-current=\"page\"` on the element `as` renders, the link by\n default, so the current item isn't only a color. An `aria-current` you pass wins: a navbar of\n sections on one page can say `\"location\"`, and `aria-current={false}` turns it off.\n- Bulma fills an active link item with its selected color, the link color in a navbar with no\n `color`, and bestax's styles give its text the color Bulma picks to read on that fill,\n `--bulma-navbar-item-selected-color-l`. Bulma's own stylesheet leaves the text in the navbar's\n normal text color, dark gray on blue on the light scheme, so the rule ships in `bestax.css` and\n `extras.css`. A `--bulma-navbar-item-color` you set on the item itself still wins, and an item\n with a `bgColor` keeps the navbar's text color. A rule of your own that takes the fill off\n restates `color` too.\n- Use semantic links (`<a>`) and buttons, and provide clear `aria-label` and `aria-expanded` for the burger toggle.\n- `Navbar.Link` inside a `Navbar.Dropdown` automatically gets `aria-haspopup=\"true\"` and\n `aria-expanded` synced to the dropdown's open state — no manual wiring required.\n <kbd>Enter</kbd>/<kbd>Space</kbd> toggle the dropdown open/closed, and <kbd>Escape</kbd>\n closes it and keeps focus on the link. When the trigger isn't interactive on its own — no\n `href`, not `as=\"button\"`, and not a custom component — it also gets `role=\"button\"` and\n `tabIndex={0}` so it's reachable and operable by keyboard, and a mouse/touch click on it\n toggles the dropdown too (a caller-supplied `onClick` still runs, and can\n `preventDefault()` to opt out).\n- A custom component passed to `as` keeps its own semantics, because a router link takes `to`\n rather than `href` and so can't be recognised from the props it's given. If yours renders\n something non-interactive instead, pass `role=\"button\"` and it takes the fallback above —\n `tabIndex` and click included. The keyboard path is wired either way.\n- `hoverable` dropdowns keep working with a mouse (hover-to-open); the keyboard path above\n opens and closes them independently of hover.\n- **Forced colors:** Bulma draws the burger's bars as a background color, which forced colors\n (Windows' contrast themes) replaces, so the burger would vanish there while it still works and\n takes focus. bestax's styles keep its bars visible in the system's button text color. That rule\n ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet, and an\n [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s burger gets it too. Bulma marks an active or selected\n link item, `Navbar.Link` and dropdown row with a fill and a text color alone, which forced\n colors replaces, so bestax's styles draw a bar in the system's highlight color inside it there:\n along its bottom in a row, and down its start edge where the items stack, in a dropdown and in\n the menu the burger opens. The item and everything in it stay in the contrast theme's colors,\n and an active tab gets the bar above Bulma's thicker underline. This ships in the same\n stylesheets.\n- **`Navbar.Divider` in forced colors:** Bulma draws it as a background color too, which forced\n colors paints in the dropdown's own color, so the line would vanish. bestax's styles draw it in\n the system's text color there, from the same stylesheets.\n- **In a colored [`Hero`](https://bestax.io/docs/api/layout/hero):** Bulma's hero sets the colors its navbar's items\n take on hover and when active, but Bulma's navbar doesn't read them, so a focused or hovered\n item took the scheme's fill under the hero's text, and the active item and the burger took the\n link color. For a `Navbar` with no `color` of its own, bestax's styles draw a focused, hovered or\n active item in the hero's text color with the hero's background color as its text, the burger\n and a tab in the hero's text color, and the dropdown arrow in its link's text color. The menu the\n burger opens, and the dropdown's rows in it, take the hero's background and text, except an\n active row, which keeps Bulma's selected fill and the text that reads on it, and on a phone a bold hero's menu takes the hero's\n own gradient. Where `Navbar.DropdownMenu` is a box of its own, on a desktop, its links keep\n Bulma's colors. That rule ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet.\n\n:::note\nThere's no arrow-key roving between navbar items and no outside-click handling for\n`Navbar.Dropdown` — Bulma navbar dropdowns are hover/click surfaces, so this is intentionally\nkept simple.\n:::",
|
|
85
|
+
"accessibility": "- The root `Navbar` renders as `<nav role=\"navigation\" aria-label=\"main navigation\">`.\n The default accessible name is `main navigation`. A screen reader announces it with\n the role, and since the name holds the role word, \"navigation\" is heard twice.\n Pass a name without the role word (`aria-label=\"Site\"`), and a different name\n on each Navbar when a page has more than one. A passed `aria-label` replaces\n the default.\n- `Navbar.Item active` sets `aria-current=\"page\"` on the element `as` renders, the link by\n default, so the current item isn't only a color. An `aria-current` you pass wins: a navbar of\n sections on one page can say `\"location\"`, and `aria-current={false}` turns it off.\n- Bulma fills an active link item with its selected color, the link color in a navbar with no\n `color`, and bestax's styles give its text the color Bulma picks to read on that fill,\n `--bulma-navbar-item-selected-color-l`. Bulma's own stylesheet leaves the text in the navbar's\n normal text color, dark gray on blue on the light scheme, so the rule ships in `bestax.css` and\n `extras.css`. A `--bulma-navbar-item-color` you set on the item itself still wins, and an item\n with a `bgColor` keeps the navbar's text color. A rule of your own that takes the fill off\n restates `color` too.\n- Use semantic links (`<a>`) and buttons, and provide clear `aria-label` and `aria-expanded` for the burger toggle.\n- `Navbar.Link` inside a `Navbar.Dropdown` automatically gets `aria-haspopup=\"true\"` and\n `aria-expanded` synced to the dropdown's open state — no manual wiring required.\n <kbd>Enter</kbd>/<kbd>Space</kbd> toggle the dropdown open/closed, and <kbd>Escape</kbd>\n closes it and keeps focus on the link. <kbd>Escape</kbd> anywhere else in the open dropdown, its\n menu included, puts focus back on the link and closes it too, unless a control there marks the\n key used, the key comes from a dialog or from content opened from the menu into a portal, or\n focus can't go back to the link. A `hoverable` dropdown's menu still shows while the pointer is\n on the dropdown or focus is in it, the link included. When the trigger isn't interactive on its own — no\n `href`, not `as=\"button\"`, and not a custom component — it also gets `role=\"button\"` and\n `tabIndex={0}` so it's reachable and operable by keyboard, and a mouse/touch click on it\n toggles the dropdown too (a caller-supplied `onClick` still runs, and can\n `preventDefault()` to opt out).\n- A custom component passed to `as` keeps its own semantics, because a router link takes `to`\n rather than `href` and so can't be recognised from the props it's given. If yours renders\n something non-interactive instead, pass `role=\"button\"` and it takes the fallback above —\n `tabIndex` and click included. The keyboard path is wired either way.\n- `hoverable` dropdowns keep working with a mouse (hover-to-open); the keyboard path above\n opens and closes them independently of hover.\n- **Forced colors:** Bulma draws the burger's bars as a background color, which forced colors\n (Windows' contrast themes) replaces, so the burger would vanish there while it still works and\n takes focus. bestax's styles keep its bars visible in the system's button text color. That rule\n ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet, and an\n [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s burger gets it too. Bulma marks an active or selected\n link item, `Navbar.Link` and dropdown row with a fill and a text color alone, which forced\n colors replaces, so bestax's styles draw a bar in the system's highlight color inside it there:\n along its bottom in a row, and down its start edge where the items stack, in a dropdown and in\n the menu the burger opens. The item and everything in it stay in the contrast theme's colors,\n and an active tab gets the bar above Bulma's thicker underline. This ships in the same\n stylesheets.\n- **`Navbar.Divider` in forced colors:** Bulma draws it as a background color too, which forced\n colors paints in the dropdown's own color, so the line would vanish. bestax's styles draw it in\n the system's text color there, from the same stylesheets.\n- **In a colored [`Hero`](https://bestax.io/docs/api/layout/hero):** Bulma's hero sets the colors its navbar's items\n take on hover and when active, but Bulma's navbar doesn't read them, so a focused or hovered\n item took the scheme's fill under the hero's text, and the active item and the burger took the\n link color. For a `Navbar` with no `color` of its own, bestax's styles draw a focused, hovered or\n active item in the hero's text color with the hero's background color as its text, the burger\n and a tab in the hero's text color, and the dropdown arrow in its link's text color. The menu the\n burger opens, and the dropdown's rows in it, take the hero's background and text, except an\n active row, which keeps Bulma's selected fill and the text that reads on it, and on a phone a bold hero's menu takes the hero's\n own gradient. Where `Navbar.DropdownMenu` is a box of its own, on a desktop, its links keep\n Bulma's colors. That rule ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet.\n\n:::note\nThere's no arrow-key roving between navbar items and no outside-click handling for\n`Navbar.Dropdown` — Bulma navbar dropdowns are hover/click surfaces, so this is intentionally\nkept simple.\n:::",
|
|
86
86
|
"related": ["Button", "Icon", "useBulmaClasses"],
|
|
87
87
|
"storybook": "https://bestax.io/storybook/?path=/story/components-navbar--default",
|
|
88
88
|
"summary": "The `Navbar` component implements Bulma's powerful, responsive navigation bar for your Bulma React UI.",
|
|
@@ -698,7 +698,7 @@
|
|
|
698
698
|
"name": "active",
|
|
699
699
|
"type": "boolean",
|
|
700
700
|
"default": "false",
|
|
701
|
-
"description": "Dropdown is open.",
|
|
701
|
+
"description": "Dropdown is open, whether you control it or not. Escape on its `Navbar.Link`, or anywhere else in the open dropdown, closes it and puts focus on the link, unless a control there marks the key used, the key comes from a dialog or from content opened from the menu into a portal, or focus can't go back to the link. A `hoverable` dropdown's menu still shows while the pointer is on the dropdown or focus is in it, the link included.",
|
|
702
702
|
"required": false,
|
|
703
703
|
"inherited": false,
|
|
704
704
|
"deprecated": false
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"code": "<Notification color=\"warning\">\n <Strong>Warning!</Strong> This notification contains{' '}\n <Link href=\"#\">custom content</Link>.\n</Notification>"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"accessibility": "- **Delete button:**
|
|
37
|
+
"accessibility": "- **Delete button:** Named \"Close notification\" for screen readers. Pass `ariaCloseLabel`, on `Notification` or to `notification.show()`, to name it in your app's language.\n- **Keyboard:** The delete button is focusable and can be activated by keyboard.\n- **Content:** Use semantic HTML within the notification for best accessibility.\n- **Contrast:** A dark or light notification's text reads against its background the way a dark or light `Button`'s does, in both color schemes, and a white or black one with `isLight` gets the light color's text on its light gray background. That comes from bestax's stylesheets, as the `color` and `isLight` props' descriptions say.\n- **Announcements:** A notification shown through `notification` announces its message. `danger` and `warning` announce themselves: the message carries `role=\"alert\"` with `aria-live=\"assertive\"`, which screen readers reliably announce even though it arrives with its text. The rest are announced politely through a visually hidden `role=\"status\"` region that `NotificationContainer` keeps in the page from the moment it mounts, even with nothing showing, because a polite region that arrives already holding its text often isn't announced. A moment after one of those notifications appears, its message is written into the region, then cleared again shortly after.\n- **Timing:** A notification shown through `notification` doesn't close on its timer while focus is inside it, on its close button or on a link in its message, whatever `pauseOnHover` says, so a keyboard user who reaches it can use it. Focus from a click counts too, in browsers that focus a clicked link or button, so after a click on one the notification stays up until focus moves elsewhere. Once focus leaves, it gets its whole `duration` again, the way it does after the pointer leaves with `pauseOnHover`.\n- **Testing:** A polite notification's message doesn't carry `role=\"status\"`, so `getByRole('status')` finds the container's region rather than the notification. Query the message text or `.notification` instead. A count or text [`Badge`](https://bestax.io/docs/api/components/badge) is a `role=\"status\"` node too, so with both on the page `getByRole('status')` matches more than one: find the badge by its accessible name, or use `getAllByRole`. While a message is in the region, the page also holds a second copy of its text, so a test that advances the clock past the announcement and then looks the message up by text can find both, and can still find the region's copy for a moment after the notification closes. Scope that query to the notification, for example with `within`.\n\n:::tip\nAlways provide clear, actionable text inside notifications.\n:::",
|
|
38
38
|
"related": ["Delete", "useBulmaClasses"],
|
|
39
39
|
"storybook": "https://bestax.io/storybook/?path=/story/elements-notification--default",
|
|
40
40
|
"summary": "The `Notification` component is a Bulma-styled alert/message area for providing feedback, warnings, or information to users.",
|
|
@@ -103,6 +103,15 @@
|
|
|
103
103
|
"inherited": false,
|
|
104
104
|
"deprecated": false
|
|
105
105
|
},
|
|
106
|
+
{
|
|
107
|
+
"name": "ariaCloseLabel",
|
|
108
|
+
"type": "string",
|
|
109
|
+
"default": null,
|
|
110
|
+
"description": "Names the close button `hasDelete` shows, in place of \"Close notification\", for an app in another language. An empty one keeps that name.",
|
|
111
|
+
"required": false,
|
|
112
|
+
"inherited": false,
|
|
113
|
+
"deprecated": false
|
|
114
|
+
},
|
|
106
115
|
{
|
|
107
116
|
"name": "children",
|
|
108
117
|
"type": "React.ReactNode",
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"title": "Read-only Input",
|
|
38
38
|
"code": "<Numberinput defaultValue={5} editable={false} color=\"primary\" />"
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
"title": "Buttons in Another Language",
|
|
42
|
+
"code": "<Block lang=\"fr\">\n <Numberinput\n label=\"Quantité\"\n defaultValue={2}\n min={1}\n labels={{ increase: 'Augmenter', decrease: 'Diminuer' }}\n />\n</Block>"
|
|
43
|
+
},
|
|
40
44
|
{
|
|
41
45
|
"title": "Disabled State",
|
|
42
46
|
"code": "<Numberinput defaultValue={5} disabled />"
|
|
@@ -54,7 +58,7 @@
|
|
|
54
58
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Quantity\"\n labelProps={{ htmlFor: 'quantity-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control>\n <Numberinput\n id=\"quantity-field-control\"\n defaultValue={1}\n min={1}\n max={10}\n color=\"primary\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
55
59
|
}
|
|
56
60
|
],
|
|
57
|
-
"accessibility": "- Uses native number input element\n- The `label` prop, or the label of a `Field` the Numberinput sits in, names its input. A `Field` with `hasAddons` or `grouped` holds several controls and names none, so wire that one with `labelProps={{ htmlFor }}` and a matching `id`.\n- Has `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes\n-
|
|
61
|
+
"accessibility": "- Uses native number input element\n- The `label` prop, or the label of a `Field` the Numberinput sits in, names its input. A `Field` with `hasAddons` or `grouped` holds several controls and names none, so wire that one with `labelProps={{ htmlFor }}` and a matching `id`.\n- Has `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes\n- The increase and decrease buttons are named \"Increase value\" and \"Decrease value\", in both variants, and `labels` names them in the page's language\n- Arrow keys increment/decrement the value\n- The +/- buttons stay out of the Tab order, and a press on one leaves focus where it was, in the input when it had it, so the arrow keys keep working after a click and a button that disables at `min` or `max` doesn't take focus with it. A press on a button that's already disabled reaches nothing, as a press on any text does, so focus leaves the input then\n- Buttons are disabled at min/max boundaries\n- The `message` describes the number input through `aria-describedby`, after any ids you pass there, so a screen reader reads it when the input takes focus.",
|
|
58
62
|
"related": ["Input", "Slider"],
|
|
59
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-numberinput",
|
|
60
64
|
"summary": "The `Numberinput` component provides a number input with increment/decrement buttons.",
|
|
@@ -202,6 +206,15 @@
|
|
|
202
206
|
"inherited": false,
|
|
203
207
|
"deprecated": false
|
|
204
208
|
},
|
|
209
|
+
{
|
|
210
|
+
"name": "labels",
|
|
211
|
+
"type": "{ increase?: string; decrease?: string }",
|
|
212
|
+
"default": null,
|
|
213
|
+
"description": "The buttons' names, in your app's language, in both variants.",
|
|
214
|
+
"required": false,
|
|
215
|
+
"inherited": false,
|
|
216
|
+
"deprecated": false
|
|
217
|
+
},
|
|
205
218
|
{
|
|
206
219
|
"name": "disabled",
|
|
207
220
|
"type": "boolean",
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"title": "Custom Icons",
|
|
39
39
|
"code": "function example() {\n const [rating, setRating] = useState(3);\n\n const HeartIcon = ({ isActive }: { isActive: boolean }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill={isActive ? 'currentColor' : 'none'}\n stroke=\"currentColor\"\n strokeWidth={isActive ? 0 : 2}\n style={{ color: '#f14668' }}\n >\n <path d=\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\" />\n </svg>\n );\n\n return (\n <Rate\n value={rating}\n onChange={setRating}\n customIcon={({ isActive }) => <HeartIcon isActive={isActive} />}\n showScore\n />\n );\n}"
|
|
40
40
|
},
|
|
41
|
+
{
|
|
42
|
+
"title": "Translated Names",
|
|
43
|
+
"code": "function example() {\n const number = useNumberFormat('fr');\n\n return (\n <Rate\n defaultValue={3.5}\n precision={0.5}\n labels={{\n group: 'Note',\n star: value => `${number(value)} étoile${value >= 2 ? 's' : ''}`,\n }}\n />\n );\n}"
|
|
44
|
+
},
|
|
41
45
|
{
|
|
42
46
|
"title": "Context-Aware Rendering › Default (with label)",
|
|
43
47
|
"code": "<Rate label=\"Rating\" defaultValue={3} />"
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Rating\"\n labelProps={{ id: 'rating-label-control', htmlFor: undefined }}\n >\n <Field.Body>\n <Field>\n <Control>\n <Rate aria-labelledby=\"rating-label-control\" defaultValue={3} />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
52
56
|
}
|
|
53
57
|
],
|
|
54
|
-
"accessibility": "- Uses `role=\"radiogroup\"` for the container\n- The `label` prop names the group via `aria-labelledby` (the rendered `<label>` gets an id — yours via `labelProps.id`, or a generated one); without a label the container falls back to `aria-label
|
|
58
|
+
"accessibility": "- Uses `role=\"radiogroup\"` for the container\n- The `label` prop names the group via `aria-labelledby` (the rendered `<label>` gets an id — yours via `labelProps.id`, or a generated one); without a label the container falls back to an `aria-label` of `labels.group`, \"Rating\" by default. Inside a labeled `Field`, that `Field`'s label names the group the same way and replaces the fallback. An `aria-label` or `aria-labelledby` you set on the Rate yourself wins over either label\n- Each star has `role=\"radio\"` with `aria-checked`, and the star the value falls in is the checked one, so the value travels with it. A fractional value names that star by the value itself (\"3.5 stars\")\n- The names are English unless you set `labels`: `labels.star` names each star from the value it stands for, in your language, and a `LocaleProvider` doesn't change them\n- Focus stays on the group, which points `aria-activedescendant` at the checked star, so a screen reader announces it as the arrow keys change the value\n- Full keyboard navigation with arrow keys\n- Home/End keys jump to 0/max values\n- `disabled` sets `aria-disabled` on the group and on every star, so a screen reader announces them as unavailable, and takes the group out of the tab order\n- In forced colors (Windows' contrast themes) the built-in star or an `iconName` icon a value only partly fills draws its filled part in the system's highlight color, as a filled star is drawn. A `customIcon` draws its own partial fill, so its forced colors are its own\n- On a right-to-left page, or inside a wrapper with `dir=\"rtl\"`, the stars run right to left, the built-in star or an `iconName` icon fills a half star from its right, and the pointer reads a star's fraction from its right edge. The `rtl` prop doesn't change any of that. It only reverses the order a screen reader meets the stars in, so set `dir` instead\n- The `message` describes the group through `aria-describedby`, after any ids you pass there, so a screen reader reads it when the group takes focus",
|
|
55
59
|
"related": ["Input", "Slider"],
|
|
56
60
|
"storybook": "https://bestax.io/storybook/?path=/story/form-rate",
|
|
57
61
|
"summary": "The `Rate` component provides a star/icon-based rating system.",
|
|
@@ -68,7 +72,7 @@
|
|
|
68
72
|
"name": "label",
|
|
69
73
|
"type": "React.ReactNode",
|
|
70
74
|
"default": null,
|
|
71
|
-
"description": "Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role=\"radiogroup\"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the
|
|
75
|
+
"description": "Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role=\"radiogroup\"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the fallback `aria-label` (`labels.group`, \"Rating\" by default). Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), and replaces that fallback too. An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own, and leaves the fallback.",
|
|
72
76
|
"required": false,
|
|
73
77
|
"inherited": false,
|
|
74
78
|
"deprecated": false
|
|
@@ -271,6 +275,15 @@
|
|
|
271
275
|
"inherited": false,
|
|
272
276
|
"deprecated": false
|
|
273
277
|
},
|
|
278
|
+
{
|
|
279
|
+
"name": "labels",
|
|
280
|
+
"type": "{ group?: string; star?: (value: number) => string }",
|
|
281
|
+
"default": null,
|
|
282
|
+
"description": "The names a screen reader hears, for another language: the group's fallback name and each star's. Unset, they're English, \"Rating\" and \"3 stars\". A `LocaleProvider` doesn't change them.",
|
|
283
|
+
"required": false,
|
|
284
|
+
"inherited": false,
|
|
285
|
+
"deprecated": false
|
|
286
|
+
},
|
|
274
287
|
{
|
|
275
288
|
"name": "labelSize",
|
|
276
289
|
"type": "'small' | 'normal' | 'medium' | 'large'",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Volume\"\n labelProps={{ htmlFor: 'volume-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"volume-up\">\n <Slider\n id=\"volume-field-control\"\n defaultValue={50}\n color=\"primary\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"accessibility": "- Uses native `<input type=\"range\">` element\n- The `label` prop, or the label of a `Field` the slider sits in, names its input.\n- In range mode the label starts each thumb's name, so `<Slider range label=\"Price range\" />` announces \"Price range Minimum value\" and \"Price range Maximum value\". Each thumb points `aria-labelledby` at the label and at a hidden span holding its own text, because an `aria-label` would outrank the label. The label's `for` still lands on the low thumb, so clicking the label focuses it.\n- `ariaLabel` wins over the label. In range mode each entry is that thumb's whole name, with no label in front, and an empty entry counts as unset.\n- An `aria-label` or `aria-labelledby` you pass straight to a range Slider names the whole Slider, so it takes the label's place at the start of both thumbs' names: `<Slider range aria-label=\"Budget\" />` announces \"Budget Minimum value\" and \"Budget Maximum value\". An `ariaLabel` entry still wins for its own thumb. To keep a label out of the thumbs' names altogether, pass `aria-labelledby={undefined}`, and they stay \"Minimum value\" and \"Maximum value\".\n- A `Field` label you wire by hand with `labelProps={{ htmlFor }}`, as in a horizontal form, gets no generated id, so give it one of your own there as well, as in `labelProps={{ htmlFor: 'price', id: 'price-label' }}`, and it starts both thumbs' names the same way. Without that `id` it reaches a range Slider only through its `for`, which the thumbs' default `aria-label` outranks, so they stay \"Minimum value\" and \"Maximum value\".\n- In forced colors (Windows' contrast themes) the track and its fill would disappear, since they're painted as a gradient. bestax's styles paint the fill in the system's highlight color and the rest of the track in its text color there, so the track shows how far it's filled. The mark labels draw in its text color too, and the tick lines in its button text color. A disabled slider draws its track, thumbs, ticks and labels in its color for disabled text instead. All of them draw at full strength there.\n- Has `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes\n- Fully keyboard accessible with arrow keys\n- Home and End move a thumb to the slider's ends. On a range Slider a thumb stops at the other thumb, or `minDistance` short of it.\n- Focus states clearly visible\n- On a right-to-left page the native range mirrors, and the fill, the tick marks and the value bubble follow it, so a value of 25 fills from the right. A vertical slider still fills from the bottom.\n- In forced colors (Windows' contrast themes) the value bubble takes the page's own background, and every side of its arrow would be painted, drawing it as a square. bestax's styles outline the bubble in the system's text color there, and keep the arrow a triangle in that color, pointing at the thumb whichever side the bubble sits on.\n- The `message` describes the slider through `aria-describedby`, both thumbs in range mode. Ids you pass in `aria-describedby` go first, on the only thumb or the low one, where the other attributes go.",
|
|
61
|
+
"accessibility": "- Uses native `<input type=\"range\">` element\n- The `label` prop, or the label of a `Field` the slider sits in, names its input.\n- In range mode the label starts each thumb's name, so `<Slider range label=\"Price range\" />` announces \"Price range Minimum value\" and \"Price range Maximum value\". Each thumb points `aria-labelledby` at the label and at a hidden span holding its own text, because an `aria-label` would outrank the label. The label's `for` still lands on the low thumb, so clicking the label focuses it.\n- `ariaLabel` wins over the label. In range mode each entry is that thumb's whole name, with no label in front, and an empty entry counts as unset.\n- An `aria-label` or `aria-labelledby` you pass straight to a range Slider names the whole Slider, so it takes the label's place at the start of both thumbs' names: `<Slider range aria-label=\"Budget\" />` announces \"Budget Minimum value\" and \"Budget Maximum value\". An `ariaLabel` entry still wins for its own thumb. To keep a label out of the thumbs' names altogether, pass `aria-labelledby={undefined}`, and they stay \"Minimum value\" and \"Maximum value\".\n- A `Field` label you wire by hand with `labelProps={{ htmlFor }}`, as in a horizontal form, gets no generated id, so give it one of your own there as well, as in `labelProps={{ htmlFor: 'price', id: 'price-label' }}`, and it starts both thumbs' names the same way. Without that `id` it reaches a range Slider only through its `for`, which the thumbs' default `aria-label` outranks, so they stay \"Minimum value\" and \"Maximum value\".\n- In forced colors (Windows' contrast themes) the track and its fill would disappear, since they're painted as a gradient. bestax's styles paint the fill in the system's highlight color and the rest of the track in its text color there, so the track shows how far it's filled. The mark labels draw in its text color too, and the tick lines in its button text color. A disabled slider draws its track, thumbs, ticks and labels in its color for disabled text instead. All of them draw at full strength there.\n- Has `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes\n- The thumb's `aria-valuetext` is what `getAriaValueText` returns, or else the value bubble's text when `formatOutput` or `scale` is set, whether or not the bubble shows, so ``formatOutput={v => `$${v}`}`` announces \"$41\" rather than \"41\".\n- The value bubble is an `<output>`, which a browser treats as a live region. It's set not to announce: a thumb announces its value as it's moved.\n- Fully keyboard accessible with arrow keys\n- Home and End move a thumb to the slider's ends. On a range Slider a thumb stops at the other thumb, or `minDistance` short of it.\n- Focus states clearly visible\n- On a right-to-left page the native range mirrors, and the fill, the tick marks and the value bubble follow it, so a value of 25 fills from the right. A vertical slider still fills from the bottom.\n- In forced colors (Windows' contrast themes) the value bubble takes the page's own background, and every side of its arrow would be painted, drawing it as a square. bestax's styles outline the bubble in the system's text color there, and keep the arrow a triangle in that color, pointing at the thumb whichever side the bubble sits on.\n- The `message` describes the slider through `aria-describedby`, both thumbs in range mode. Ids you pass in `aria-describedby` go first, on the only thumb or the low one, where the other attributes go.",
|
|
62
62
|
"related": ["Numberinput", "Progress"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-slider",
|
|
64
64
|
"summary": "The `Slider` component provides a range slider input for selecting values within a range.",
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"name": "showOutput",
|
|
229
229
|
"type": "boolean",
|
|
230
230
|
"default": "false",
|
|
231
|
-
"description": "Show current value tooltip.",
|
|
231
|
+
"description": "Show current value tooltip. The tooltip doesn't announce its changes: a thumb announces its value as it's moved.",
|
|
232
232
|
"required": false,
|
|
233
233
|
"inherited": true,
|
|
234
234
|
"deprecated": false
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"name": "tooltip",
|
|
238
238
|
"type": "'auto' | 'always' | 'hidden'",
|
|
239
239
|
"default": null,
|
|
240
|
-
"description": "Controls tooltip visibility on the thumb.",
|
|
240
|
+
"description": "Controls tooltip visibility on the thumb. The tooltip doesn't announce its changes: a thumb announces its value as it's moved.",
|
|
241
241
|
"required": false,
|
|
242
242
|
"inherited": true,
|
|
243
243
|
"deprecated": false
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
"name": "scale",
|
|
274
274
|
"type": "(value: number) => number",
|
|
275
275
|
"default": null,
|
|
276
|
-
"description": "Function to scale the displayed value. With it, and no `getAriaValueText`, the
|
|
276
|
+
"description": "Function to scale the displayed value. With it, and no `getAriaValueText`, the output's text is also the thumb's `aria-valuetext`, whether or not the output shows.",
|
|
277
277
|
"required": false,
|
|
278
278
|
"inherited": true,
|
|
279
279
|
"deprecated": false
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
"name": "getAriaValueText",
|
|
283
283
|
"type": "(value: number) => string",
|
|
284
284
|
"default": null,
|
|
285
|
-
"description": "Function to generate the `aria-valuetext` attribute.",
|
|
285
|
+
"description": "Function to generate the `aria-valuetext` attribute. It wins over the text `formatOutput` and `scale` give the thumb, and it gets the value before `scale`.",
|
|
286
286
|
"required": false,
|
|
287
287
|
"inherited": true,
|
|
288
288
|
"deprecated": false
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
"name": "formatOutput",
|
|
292
292
|
"type": "(value: number) => string",
|
|
293
293
|
"default": null,
|
|
294
|
-
"description": "Format function for output display. Without it, the output shows the value as it is, or inside a `LocaleProvider` with a `locale`, written the way that locale writes numbers, to at most three decimals.",
|
|
294
|
+
"description": "Format function for output display. Without it, the output shows the value as it is, or inside a `LocaleProvider` with a `locale`, written the way that locale writes numbers, to at most three decimals. With it, and no `getAriaValueText`, its text is also the thumb's `aria-valuetext`, whether or not the output shows.",
|
|
295
295
|
"required": false,
|
|
296
296
|
"inherited": true,
|
|
297
297
|
"deprecated": false
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Tags\"\n labelProps={{ htmlFor: 'tags-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control>\n <Taginput\n id=\"tags-field-control\"\n icon=\"tags\"\n defaultValue={['React', 'TypeScript']}\n placeholder=\"Add a tag...\"\n tagColor=\"primary\"\n />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
59
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). While the label is wired it also names the input; without one, the input falls back to `aria-label=\"Add tag\"`. Inside a labeled `Field`, that `Field`'s label names the input the same way and replaces the fallback.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- When `maxTags` is reached the text input turns read-only rather than going away, so keyboard focus stays where it was and the label keeps naming the input. The suggestion list stays closed.\n- While the counter shows, it describes the input through `aria-describedby`, so a screen reader hears the count, like \"3 / 3\" at the limit.\n- Tags are keyboard navigable\n- Delete buttons have proper `aria-label`\n- With `data`, the input is a `role=\"combobox\"` with `aria-autocomplete=\"list\"` and `aria-haspopup=\"listbox\"`. Its `aria-expanded` is true only while the suggestion list is on screen, and while it is, `aria-controls` points at the list. While no suggestion matches there's no list, so it stays false. Without `data` there's never a list, so the input stays a plain text field\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted suggestion as the arrow keys or the mouse move it\n- Focus moving from the input to another element closes the suggestion list, as `Tab` to the next field or to a tag's remove button does, so the list doesn't stay open over what has focus. A press on a suggestion keeps focus in the input, so the list stays open for the click, and the list takes no `Tab` stop of its own\n- The list is a `role=\"listbox\"` named through `aria-labelledby` by the label that names the input, when that label has an id: the `label` prop's label always has one, and so does a `Field`'s label that the `Field` wires itself. A `Field` label you wire by hand with `labelProps.htmlFor`, which is how the horizontal examples above name the Taginput, needs an `id` in its `labelProps` as well. Otherwise the list falls back to `aria-label=\"Suggestions\"`\n- The list holds only the suggestions, each a `role=\"option\"` with an id of its own, and the highlighted one has `aria-selected=\"true\"`\n- In forced colors (Windows' contrast themes), which take away the list's shadow and the highlighted suggestion's fill, the open list is drawn with an edge and the highlighted suggestion with an outline in the system's highlight color\n- The `message` describes the input through `aria-describedby`, after the counter while it shows, so a screen reader reads both when the input takes focus.",
|
|
61
|
+
"accessibility": "- The `label` prop is automatically associated with the inner text input (`htmlFor` plus a generated `id`, or your own `id` if you pass one). While the label is wired it also names the input; without one, the input falls back to `aria-label=\"Add tag\"`. Inside a labeled `Field`, that `Field`'s label names the input the same way and replaces the fallback.\n- A user-supplied `id` is applied to the inner input (the labellable control), not the wrapper div.\n- When `maxTags` is reached the text input turns read-only rather than going away, so keyboard focus stays where it was and the label keeps naming the input. The suggestion list stays closed.\n- While the counter shows, it describes the input through `aria-describedby`, so a screen reader hears the count, like \"3 / 3\" at the limit.\n- Tags are keyboard navigable\n- Delete buttons have proper `aria-label`\n- With `data`, the input is a `role=\"combobox\"` with `aria-autocomplete=\"list\"` and `aria-haspopup=\"listbox\"`. Its `aria-expanded` is true only while the suggestion list is on screen, and while it is, `aria-controls` points at the list. While no suggestion matches there's no list, so it stays false. Without `data` there's never a list, so the input stays a plain text field\n- Focus stays in the input, which points `aria-activedescendant` at the highlighted suggestion as the arrow keys or the mouse move it\n- Focus moving from the input to another element closes the suggestion list, as `Tab` to the next field or to a tag's remove button does, so the list doesn't stay open over what has focus. A press on a suggestion keeps focus in the input, so the list stays open for the click, and the list takes no `Tab` stop of its own\n- The list is a `role=\"listbox\"` named through `aria-labelledby` by the label that names the input, when that label has an id: the `label` prop's label always has one, and so does a `Field`'s label that the `Field` wires itself. A `Field` label you wire by hand with `labelProps.htmlFor`, which is how the horizontal examples above name the Taginput, needs an `id` in its `labelProps` as well. Otherwise the list falls back to `aria-label=\"Suggestions\"`\n- The list holds only the suggestions, each a `role=\"option\"` with an id of its own, and the highlighted one has `aria-selected=\"true\"`\n- In forced colors (Windows' contrast themes), which take away the list's shadow and the highlighted suggestion's fill, the open list is drawn with an edge and the highlighted suggestion with an outline in the system's highlight color\n- The `message` describes the input through `aria-describedby`, after the counter while it shows, so a screen reader reads both when the input takes focus.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the wrapper, so a screen reader hears the input is invalid when it takes focus.",
|
|
62
62
|
"related": ["Autocomplete", "Input", "Tag"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-taginput",
|
|
64
64
|
"summary": "The `Taginput` component provides a tag/chip input field for managing multiple tags.",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Time\"\n labelProps={{ htmlFor: 'time-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"clock\">\n <TimeInput id=\"time-field-control\" placeholder=\"HH:MM\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
179
179
|
}
|
|
180
180
|
],
|
|
181
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name.\n- Each spinner column has `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the column shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those spinbutton columns rather than a toggle button. Its `aria-valuetext` is `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word; `↑`, `PageUp` and `End` move it to PM, and `↓`, `PageDown` and `Home` move it to AM. It stops at either end instead of wrapping around. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- A `readOnly` inline picker puts `aria-readonly=\"true\"` on each spinbutton and keeps them in the tab order.\n- A `disabled` inline picker puts `aria-disabled=\"true\"` on each spinbutton and takes them out of the tab order.\n- Honors `prefers-reduced-motion`.\n- On a right-to-left page the launcher sits at the end of the line and the clock icon at the start. The wheels keep `dir=\"ltr\"`, so hours stay to the left of minutes.\n- A panel at a corner that would run past the left or right edge of the screen keeps its\n corner and moves sideways just far enough to fit, or, wider than the screen, to the edge its\n text starts from. On a narrow screen the panel in place is a sheet across the screen\n instead, which fits as it is.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes nothing.",
|
|
181
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name.\n- Each spinner column has `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the column shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those spinbutton columns rather than a toggle button. Its `aria-valuetext` is `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word; `↑`, `PageUp` and `End` move it to PM, and `↓`, `PageDown` and `Home` move it to AM. It stops at either end instead of wrapping around. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- A `readOnly` inline picker puts `aria-readonly=\"true\"` on each spinbutton and keeps them in the tab order.\n- A `disabled` inline picker puts `aria-disabled=\"true\"` on each spinbutton and takes them out of the tab order.\n- Honors `prefers-reduced-motion`.\n- On a right-to-left page the launcher sits at the end of the line and the clock icon at the start. The wheels keep `dir=\"ltr\"`, so hours stay to the left of minutes.\n- A panel at a corner that would run past the left or right edge of the screen keeps its\n corner and moves sideways just far enough to fit, or, wider than the screen, to the edge its\n text starts from. On a narrow screen the panel in place is a sheet across the screen\n instead, which fits as it is.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes nothing.\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.",
|
|
182
182
|
"related": ["DateInput", "DateTimeInput", "Input"],
|
|
183
183
|
"storybook": "https://bestax.io/storybook/?path=/story/form-timeinput",
|
|
184
184
|
"summary": "The `TimeInput` component is a form input that opens a popover spinner for time-of-day selection.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button onClick={() => setShowToast(true)}>Show Indefinite Toast</Button>\n {showToast && (\n <Toast\n inline\n message=\"This won't auto-dismiss\"\n indefinite\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"accessibility": "- Uses `role=\"alert\"` for screen reader announcement.\n- Has `aria-live=\"polite\"` for non-intrusive notifications.\n- The closable button
|
|
37
|
+
"accessibility": "- Uses `role=\"alert\"` for screen reader announcement.\n- Has `aria-live=\"polite\"` for non-intrusive notifications.\n- The closable button is named \"Close\". Pass `ariaCloseLabel` to name it in your app's language.\n- `pauseOnHover` lets users keep the toast visible while reading.\n- A toast doesn't close on its timer while focus is inside it, on its action, cancel or close button, whatever `pauseOnHover` says, so a keyboard user who reaches it can use it. Once focus leaves, it gets its whole `duration` again.\n- `cancelable` (default `true`) supports Escape-key dismiss. An Escape that closed a popup on the page, such as a Dropdown menu or a date picker's calendar, leaves the toast up.\n- A toast is a notification rather than a layer, so while a [Modal](https://bestax.io/docs/api/components/modal), [Dialog](https://bestax.io/docs/api/components/dialog), [Sidebar](https://bestax.io/docs/api/components/sidebar) or full-page [Loading](https://bestax.io/docs/api/components/loading) is open, Escape goes to that and the toast stays up. Once none is open, Escape dismisses the toast.\n- In forced colors (Windows' contrast themes), which drop the toast's shadow and paint its fill in the page's own color, the toast gets a one pixel edge in the system's text color, and the cancel button's text shows at full strength. A toast given a `tabIndex` shows the browser's focus ring in place of that edge while it has keyboard focus.",
|
|
38
38
|
"related": ["Dialog"],
|
|
39
39
|
"storybook": "https://bestax.io/storybook/?path=/story/components-toast",
|
|
40
40
|
"summary": "The `Toast` component provides brief notification messages with optional action and cancel buttons.",
|
|
@@ -119,6 +119,15 @@
|
|
|
119
119
|
"inherited": false,
|
|
120
120
|
"deprecated": false
|
|
121
121
|
},
|
|
122
|
+
{
|
|
123
|
+
"name": "ariaCloseLabel",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"default": null,
|
|
126
|
+
"description": "Names the close button `closable` shows, in place of \"Close\", for an app in another language. An empty one keeps that name.",
|
|
127
|
+
"required": false,
|
|
128
|
+
"inherited": false,
|
|
129
|
+
"deprecated": false
|
|
130
|
+
},
|
|
122
131
|
{
|
|
123
132
|
"name": "rounded",
|
|
124
133
|
"type": "boolean",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"code": "<LocaleProvider locale=\"ar\" dir=\"rtl\">\n <TreeSelect\n label=\"المجلد\"\n defaultValue=\"invoices\"\n clearable\n data={[\n {\n value: 'docs',\n label: 'المستندات',\n children: [{ value: 'invoices', label: 'الفواتير' }],\n },\n { value: 'photos', label: 'الصور' },\n ]}\n />\n</LocaleProvider>"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' is: `role=\"combobox\"`\n with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the panel is open,\n named by its `label`. It's read-only, and in `'single'` its value is the picked item's label.\n In the checkbox modes it's described by the tags.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked item, its branch open, or onto the search box when\n `searchable`, or else onto the first item. It holds focus while it's open, as the date\n pickers' panel does: Tab and Shift+Tab move between the search box and the tree, and wrap.\n Escape and Alt+Up close it and put focus back on the field, and so does a pick in `'single'`.\n A press outside closes it and leaves focus where the press put it.\n- **The tree** is TreeView's, with the same name as the panel: real focus with one tab stop, the\n arrow keys, Home, End, `*` and type-ahead, Right and Left swapped on a right-to-left page,\n `aria-level`, `aria-posinset` and `aria-setsize` on every item, `aria-selected` in `'single'`,\n `aria-checked` in the checkbox modes (`\"mixed\"` only in `'checkbox'`), and disabled items\n reachable and `aria-disabled`. Space joins a type-ahead search under way when an item starts\n with what's been typed and a space, so \"new y\" reaches \"New York\", and otherwise picks or\n checks. See [`TreeView`](https://bestax.io/docs/api/components/treeview#accessibility).\n- **The search box** is named \"Search\", or `labels.search`. When nothing matches, `empty` is said\n once through a polite status region, not again on every key.\n- **Each tag's button** is a `Delete` named \"Remove\" and the item's label, or `ariaCloseLabel`\n described by the tag's label.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the tree keep their edges in system colors, and the\n chevron is text.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the field through `aria-describedby`, after any ids you pass there and, with checkboxes, after the picked tags.",
|
|
61
|
+
"accessibility": "- **The field is a combobox that opens a dialog,** as the date pickers' is: `role=\"combobox\"`\n with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` while the panel is open,\n named by its `label`. It's read-only, and in `'single'` its value is the picked item's label.\n In the checkbox modes it's described by the tags.\n- **Keys on the field:** a click, Enter, Space, Down or Alt+Down opens the panel, and with\n `searchable` a printable key opens it with that key in the search box.\n- **The panel** is a non-modal `dialog`, named by the label or `labels.choose`. Focus moves into\n it as it opens: onto the picked item, its branch open, or onto the search box when\n `searchable`, or else onto the first item. It holds focus while it's open, as the date\n pickers' panel does: Tab and Shift+Tab move between the search box and the tree, and wrap.\n Escape and Alt+Up close it and put focus back on the field, and so does a pick in `'single'`.\n A press outside closes it and leaves focus where the press put it.\n- **The tree** is TreeView's, with the same name as the panel: real focus with one tab stop, the\n arrow keys, Home, End, `*` and type-ahead, Right and Left swapped on a right-to-left page,\n `aria-level`, `aria-posinset` and `aria-setsize` on every item, `aria-selected` in `'single'`,\n `aria-checked` in the checkbox modes (`\"mixed\"` only in `'checkbox'`), and disabled items\n reachable and `aria-disabled`. Space joins a type-ahead search under way when an item starts\n with what's been typed and a space, so \"new y\" reaches \"New York\", and otherwise picks or\n checks. See [`TreeView`](https://bestax.io/docs/api/components/treeview#accessibility).\n- **The search box** is named \"Search\", or `labels.search`. When nothing matches, `empty` is said\n once through a polite status region, not again on every key.\n- **Each tag's button** is a `Delete` named \"Remove\" and the item's label, or `ariaCloseLabel`\n described by the tag's label.\n- **`required`** makes the field `aria-required`. A read-only field is left out of the browser's\n own check, so a hidden field over it carries `required`. When the browser stops a submit, it\n focuses that one and shows its message, which every browser takes down as it loses focus. So\n focus stays there, reading as the field and drawn on it, with no on-screen keyboard. A press\n goes where it lands, and the next key, other than a modifier on its own, goes to the field and\n does what it would there.\n- **Forced colors:** the field, the panel and the tree keep their edges in system colors, and the\n chevron is text.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the field through `aria-describedby`, after any ids you pass there and, with checkboxes, after the picked tags.\n- `aria-invalid` and `aria-errormessage` go on the field, while the other attributes you pass go on the wrapper, so a screen reader hears the field is invalid when it takes focus.",
|
|
62
62
|
"related": ["Combobox", "DateInput", "Select", "TreeView", "useBulmaClasses"],
|
|
63
63
|
"storybook": "https://bestax.io/storybook/?path=/story/form-treeselect--default",
|
|
64
64
|
"summary": "The `TreeSelect` component is a form field whose options are a tree, such as categories, places or teams: it opens a panel holding a real `TreeView`, picks one item or checks a branch at a time, and searches labels. The field is a read-only `role=\"combobox\"` that opens a dialog, wired as DateInput's is, so focus moves into the tree for real and the tree keeps TreeView's keys, type-ahead and spoken output. The tree is given as `data`, so the field and the tags can name what's picked while the panel is shut, and on the server. `selectionMode` picks the kind. `'single'` picks one item and closes. With `'checkbox'`, a check reaches every enabled item under it, closed or hidden by a search, and `checkedStrategy` decides what the value holds: the leaves, the topmost checked items or every one. With `'checkbox-independent'`, each box is its own item's, so a parent means itself alone (Mantine's and Ant Design's `checkStrictly`). The value shows as tags under the field. A value no node has is kept and shown as it is, with a warning in development, so a value under a branch that hasn't loaded survives until it does.",
|
|
@@ -314,10 +314,11 @@ Rules of thumb:
|
|
|
314
314
|
`aria-describedby`, so the error is read when the field takes focus. Use `'success'` to signal a
|
|
315
315
|
valid field.
|
|
316
316
|
- `aria-invalid` reaches the input on `Input`, `TextArea`, `Select`, `PasswordInput`,
|
|
317
|
-
`Numberinput`, `PinInput`, `File`, `ColorInput` and `Combobox.Input`.
|
|
318
|
-
`Autocomplete`, `Taginput`, `TreeSelect`, `Cascader` and a
|
|
319
|
-
|
|
320
|
-
|
|
317
|
+
`Numberinput`, `PinInput`, `File`, `ColorInput` and `Combobox.Input`. `DateInput`,
|
|
318
|
+
`TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `TreeSelect`, `Cascader` and a
|
|
319
|
+
`Combobox` with `data` put their other attributes on a wrapper, and `aria-invalid` and
|
|
320
|
+
`aria-errormessage` on the input. On `DateRangeInput` and `ColorPicker.Input` it doesn't reach
|
|
321
|
+
the input yet; the `message` still carries the error.
|
|
321
322
|
- A field that asks for the user's own details takes its `autoComplete` token (`name`,
|
|
322
323
|
`given-name`, `family-name`, `email`, `tel`, `address-line1`, `address-level2`, `postal-code`,
|
|
323
324
|
`country`, `new-password`, …; the full list is HTML's autofill field names), so the browser can
|
|
@@ -180,9 +180,9 @@ them with no wiring.
|
|
|
180
180
|
| `TreeSelect` | `data` (nodes: `value`, `label`, `disabled`, `icon`, `children`, `hasChildren`, `isLoading`, `loadError`, `onRetry`), `selectionMode` (`'single'`, `'checkbox'`, `'checkbox-independent'`), `value`/`defaultValue`/`onChange` (`string \| null`, or `string[]` in the checkbox modes, shown as tags), `checkedStrategy` (`'child'` leaves, `'parent'` topmost, `'all'`), `parentsSelectable`, `closeOnSelect`, `searchable` with `query`/`defaultQuery`/`onQueryChange`, `filter(query, item, path)` and `empty`, `expanded`/`defaultExpanded`/`onExpandedChange` (fetch lazy branches here), `open`/`defaultOpen`/`onOpenChange`, `clearable`, `itemTemplate`, `labels` (`choose`, `search`, `clear`, `loading`, `retry`, `loadingAnnouncement`, `loadedAnnouncement`), `name`, `form`, `required`, `disabled`, `color`, `size`, `isRounded`, `position`, `appendToBody` and the Field props. The field is a read-only combobox that opens a dialog; the `ref` is the field's. |
|
|
181
181
|
| `Cascader` | `data` (TreeSelect's nodes), `value`/`defaultValue`/`onChange` (the picked node's `value`, `string \| null`; the field shows its path from `data`, joined with `labels.separator`, `" / "` by default), `parentsSelectable` (leaves only without it), `closeOnSelect` (default `true`), `searchable` with `query`/`defaultQuery`/`onQueryChange`, `filter(query, item, path)` and `empty` (a flat list of matching paths replaces the columns), `expanded`/`defaultExpanded`/`onExpandedChange` (the open path; fetch lazy columns here), `open`/`defaultOpen`/`onOpenChange`, `clearable`, `itemTemplate`, `labels` (`choose`, `search`, `clear`, `separator`, `opens`, `loading`, `retry`, `loadingAnnouncement`, `loadedAnnouncement`), `name`, `form`, `required`, `disabled`, `color`, `size`, `isRounded`, `position`, `appendToBody` and the Field props. The field is a read-only combobox that opens a dialog of one listbox per level; a column opens on a click or Right, never on hover; the `ref` is the field's. |
|
|
182
182
|
| `Slider` | `min`, `max`, `step`, single or dual thumb (`value` number or `[number, number]`), `tooltip` (`'auto' \| 'always' \| 'hidden'`), vertical orientation, `color`, `size`. |
|
|
183
|
-
| `Numberinput` | `value`/`onChange`, `min`, `max`, `step`, increment/decrement buttons, stepper variant, `color`, `size`, `isLoading` (set it here, not on a `Control` around it, whose spinner covers the right-hand button).
|
|
183
|
+
| `Numberinput` | `value`/`onChange`, `min`, `max`, `step`, increment/decrement buttons, stepper variant, `labels` (the buttons' names, `increase` and `decrease`, in the page's language), `color`, `size`, `isLoading` (set it here, not on a `Control` around it, whose spinner covers the right-hand button). |
|
|
184
184
|
| `PinInput` | `length` (6), `value`/`defaultValue`/`onChange` (the code as a string), `onComplete(code)` once a change fills the last box, `type` (`'number'` or `'alphanumeric'`), `isMasked`, `name`, `color`, `size`, `isRounded`, `disabled` and the Field props. One input holds the code (`autoComplete="one-time-code"`); a paste replaces it. |
|
|
185
|
-
| `Rate` | `value`/`onChange`, `max`, `precision` (1 / 0.5 / 0.25), `customIcon` or `iconName`, `showScore`/`showText`/`texts`, `disabled
|
|
185
|
+
| `Rate` | `value`/`onChange`, `max`, `precision` (1 / 0.5 / 0.25), `customIcon` or `iconName`, `showScore`/`showText`/`texts`, `disabled`, `labels` (`group`, `star(value)`) for the names a screen reader hears, in your language. |
|
|
186
186
|
| `Taginput` | `value` (array)/`onChange`, autocomplete suggestions, configurable confirm keys, closable tags, `color`, `size`. |
|
|
187
187
|
|
|
188
188
|
## Date / time inputs
|
|
@@ -240,7 +240,8 @@ months.
|
|
|
240
240
|
The same provider makes `Combobox` (with `data`), `Autocomplete` and `Taginput` filter the way its
|
|
241
241
|
language compares letters, ignoring accents where it treats them alike ("cafe" finds "Café"), and
|
|
242
242
|
writes the numbers `Slider`'s output, `Rate`'s score, `Taginput`'s counter and `File`'s count show
|
|
243
|
-
in its digits. Don't fold accents by hand in `data` for those.
|
|
243
|
+
in its digits. Don't fold accents by hand in `data` for those. `Rate`'s star names don't follow
|
|
244
|
+
it: translate them with its `labels`.
|
|
244
245
|
|
|
245
246
|
For a value that is a month or a year (card expiry, billing period, graduation year), use
|
|
246
247
|
`DateInput` with `granularity="month"` or `granularity="year"` rather than building a select or a
|
|
@@ -765,7 +765,9 @@ read for the burger, a carousel and a theme toggle too, and its TODO names the f
|
|
|
765
765
|
`ariaCloseLabel` to keep a name the page gave its `.delete`; render the element only while
|
|
766
766
|
it's in state.
|
|
767
767
|
- **`html-script:carousel`** drives a carousel. `Carousel` takes its slides as `CarouselItem`
|
|
768
|
-
children and renders its own arrows and indicators (`autoplay` for a timed one).
|
|
768
|
+
children and renders its own arrows and indicators (`autoplay` for a timed one). Name it for
|
|
769
|
+
what it shows with `ariaLabel`, without the word "carousel", which its role description
|
|
770
|
+
already says. For several
|
|
769
771
|
slides in view, set `itemsToShow`, with a variant per viewport (`itemsToShowMobile`,
|
|
770
772
|
`itemsToShowTablet`, …), and `itemsToScroll`: bulma-carousel calls them `slidesToShow` and
|
|
771
773
|
`slidesToScroll`. bulma-carousel's `breakpoints` replace both at and below pixel widths of its
|
|
@@ -75,8 +75,8 @@ Stock Bulma examples:
|
|
|
75
75
|
|
|
76
76
|
## Authoritative bestax extras inventory
|
|
77
77
|
|
|
78
|
-
Every extras partial that exists
|
|
79
|
-
|
|
78
|
+
Every extras partial that exists, from the library's `src/scss/**/_index.scss`. The Modular
|
|
79
|
+
guide's Option C shows a short example and links here for the full list:
|
|
80
80
|
|
|
81
81
|
**Components** (`@allxsmith/bestax-bulma/scss/components/<name>`):
|
|
82
82
|
`loading`, `collapse`, `tooltip`, `popover`, `hovercard`, `contextmenu`, `dropdown`, `steps`, `sidebar`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-mcp",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.73",
|
|
4
4
|
"mcpName": "io.github.allxsmith/bestax-mcp",
|
|
5
5
|
"description": "MCP server for @allxsmith/bestax-bulma — component props, examples, CSS variables and agent skills, served offline from a version-pinned index",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
44
44
|
"zod": "^4.6.7",
|
|
45
|
-
"@allxsmith/bestax-bulma": "^5.
|
|
45
|
+
"@allxsmith/bestax-bulma": "^5.75.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^26.6.6",
|