bestax-mcp 1.18.94 → 1.18.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/bulma-classes.json +5 -1
- package/data/catalog.json +1 -1
- package/data/components/Avatar.json +3 -3
- package/data/components/Avatars.json +1 -1
- package/data/components/Calendar.json +2 -2
- package/data/components/Carousel.json +1 -1
- package/data/components/DateInput.json +3 -3
- package/data/components/DateRangeInput.json +3 -3
- package/data/components/DateTimeInput.json +3 -3
- package/data/components/HoverCard.json +1 -1
- package/data/components/Navbar.json +2 -2
- package/data/components/TimeInput.json +2 -2
- package/data/components/Valid value constants.json +1 -1
- package/data/components/useBulmaClasses.json +4 -4
- package/data/skills/bestax-custom-component/SKILL.md +2 -2
- package/data/skills/bestax-layout-scaffold/SKILL.md +7 -2
- package/data/skills/bestax-layout-scaffold/references/layout-components.md +8 -6
- package/data/skills/bestax-migrate/references/bulma-classes/prop-map.md +1 -1
- package/data/skills/bestax-migrate/references/bulma-classes/unmappables.md +3 -1
- package/data/skills/bestax-theming/references/css-variables.md +2 -2
- package/dist/helper-props.d.ts.map +1 -1
- package/dist/helper-props.js +11 -1
- package/package.json +2 -2
package/data/bulma-classes.json
CHANGED
|
@@ -8768,6 +8768,10 @@
|
|
|
8768
8768
|
"group": "typography",
|
|
8769
8769
|
"write": { "prop": "textTransform", "value": "italic" }
|
|
8770
8770
|
},
|
|
8771
|
+
"is-underlined": {
|
|
8772
|
+
"group": "typography",
|
|
8773
|
+
"write": { "prop": "textTransform", "value": "underlined" }
|
|
8774
|
+
},
|
|
8771
8775
|
"has-text-weight-light": {
|
|
8772
8776
|
"group": "typography",
|
|
8773
8777
|
"write": { "prop": "textWeight", "value": "light" }
|
|
@@ -9763,7 +9767,7 @@
|
|
|
9763
9767
|
},
|
|
9764
9768
|
{
|
|
9765
9769
|
"why": "a modifier of markup this source leaves alone, or one bestax has no prop for",
|
|
9766
|
-
"match": "^(?:has-addons-.+|has-dropdown(?:-up)?|has-fixed-size|has-icons-(?:left|right)|has-name|has-(?:spaced-)?navbar-fixed-(?:top|bottom)(?:-desktop)?|has-shadow|is-arrowless|is-boxed|is-center|is-current|is-delete|is-disabled|is-empty|is-expanded|is-fixed-(?:top|bottom)(?:-desktop)?|is-flexible|is-grouped(?:-.+)?|is-halfheight|is-horizontal|is-left|is-(?:lower|upper)-(?:alpha|roman)|is-responsive|is-selected|is-tab|is-toggle(?:-rounded)?|is-transparent|is-
|
|
9770
|
+
"match": "^(?:has-addons-.+|has-dropdown(?:-up)?|has-fixed-size|has-icons-(?:left|right)|has-name|has-(?:spaced-)?navbar-fixed-(?:top|bottom)(?:-desktop)?|has-shadow|is-arrowless|is-boxed|is-center|is-current|is-delete|is-disabled|is-empty|is-expanded|is-fixed-(?:top|bottom)(?:-desktop)?|is-flexible|is-grouped(?:-.+)?|is-halfheight|is-horizontal|is-left|is-(?:lower|upper)-(?:alpha|roman)|is-responsive|is-selected|is-tab|is-toggle(?:-rounded)?|is-transparent|is-up|is-wrapped)$"
|
|
9767
9771
|
}
|
|
9768
9772
|
],
|
|
9769
9773
|
"vocabulary": [
|
package/data/catalog.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Clickable Avatar",
|
|
30
|
-
"code": "<Avatar
|
|
30
|
+
"code": "<Avatar\n name=\"Ada Lovelace\"\n initials=\"AL\"\n alt=\"AL, Ada Lovelace\"\n href=\"https://bestax.io\"\n/>"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Forwarding Props to the Image",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"code": "function example() {\n const avatarRef = React.useRef<HTMLElement>(null);\n const [tag, setTag] = React.useState<string>();\n\n return (\n <>\n <Avatar ref={avatarRef} name=\"Ada Lovelace\" size=\"64x64\" />\n <Button mt=\"3\" onClick={() => setTag(avatarRef.current?.tagName)}>\n Read the tag from its ref\n </Button>\n <p>Rendered element: {tag ?? '—'}</p>\n </>\n );\n}"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"accessibility": "- Image avatars use `alt` (falling back to `name`) for their accessible name.\n- Initials/icon avatars expose `role=\"img\"` and `aria-label` (from `alt`/`name`) — unless\n rendered as a link or button, where the native link/button role and `aria-label` are used\n instead. A custom component passed to `as` counts as interactive, since a router link takes\n `to` rather than this component's `href`. If yours renders something that really is just a\n picture, say so with `role=\"img\"` and it's treated as one — `alt=\"\"` included. A truthy\n `aria-hidden` says it too, and so do `role=\"presentation\"` and `role=\"none\"`, though ARIA's\n own conflict resolution drops those two whenever the avatar still carries a name — prefer\n `role=\"img\"`. A role claiming the opposite, such as `\"button\"`, doesn't, and neither does an\n `href`.\n- **Decorative avatars:** pass an explicit `alt=\"\"` when the avatar repeats information\n already visible next to it (e.g. beside the author's name in a comment row). The image\n stays decorative and an initials/icon avatar is skipped entirely (`aria-hidden`), avoiding\n double-speak. The opt-out never applies to a link/button avatar — an interactive element\n always keeps an accessible name (from `name`, or a generic `\"Avatar\"` fallback) — and a\n custom component passed to `as` counts as one until it says otherwise, so `alt=\"\"` on a\n custom wrapper needs that signal next to it.\n- A link/button avatar with no `alt`/`name` (e.g. an API that returns only a photo URL) still\n gets an `aria-label` fallback rather than rendering a nameless control.\n- `as=\"button\"` defaults to `type=\"button\"`, so a clickable avatar inside a form doesn't\n submit it.\n- The default fallback icon is `aria-hidden`.",
|
|
41
|
+
"accessibility": "- Image avatars use `alt` (falling back to `name`) for their accessible name.\n- Initials/icon avatars expose `role=\"img\"` and `aria-label` (from `alt`/`name`) — unless\n rendered as a link or button, where the native link/button role and `aria-label` are used\n instead. A custom component passed to `as` counts as interactive, since a router link takes\n `to` rather than this component's `href`. If yours renders something that really is just a\n picture, say so with `role=\"img\"` and it's treated as one — `alt=\"\"` included. A truthy\n `aria-hidden` says it too, and so do `role=\"presentation\"` and `role=\"none\"`, though ARIA's\n own conflict resolution drops those two whenever the avatar still carries a name — prefer\n `role=\"img\"`. A role claiming the opposite, such as `\"button\"`, doesn't, and neither does an\n `href`.\n- **Decorative avatars:** pass an explicit `alt=\"\"` when the avatar repeats information\n already visible next to it (e.g. beside the author's name in a comment row). The image\n stays decorative and an initials/icon avatar is skipped entirely (`aria-hidden`), avoiding\n double-speak. The opt-out never applies to a link/button avatar — an interactive element\n always keeps an accessible name (from `name`, or a generic `\"Avatar\"` fallback) — and a\n custom component passed to `as` counts as one until it says otherwise, so `alt=\"\"` on a\n custom wrapper needs that signal next to it.\n- A link/button avatar with no `alt`/`name` (e.g. an API that returns only a photo URL) still\n gets an `aria-label` fallback rather than rendering a nameless control.\n- A link/button avatar that shows initials, with no `src` or one that failed to load, is named\n by an `aria-label` you pass, else `alt`, else `name`, so by default its name leaves out the\n initials it shows. Start the name with them, and pass the same `initials` so the two match,\n such as `initials=\"AL\" alt=\"AL, Ada Lovelace\"`, so someone using speech input can say what\n they see ([WCAG 2.5.3](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)).\n- `as=\"button\"` defaults to `type=\"button\"`, so a clickable avatar inside a form doesn't\n submit it.\n- The default fallback icon is `aria-hidden`.",
|
|
42
42
|
"related": ["Avatars", "Badge", "Image", "useBulmaClasses"],
|
|
43
43
|
"storybook": "https://bestax.io/storybook/?path=/story/components-avatar--photo",
|
|
44
44
|
"summary": "The `Avatar` component represents a person or entity as a compact image.",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"name": "alt",
|
|
83
83
|
"type": "string",
|
|
84
84
|
"default": null,
|
|
85
|
-
"description": "Alternate text for the image (used for the accessible name in every render mode). An explicit `alt=\"\"` marks a non-interactive avatar as decorative. A link or button avatar is never decorative — it keeps an accessible name — and a custom component passed to `as` counts as one unless it states otherwise, so `alt=\"\"` on a custom wrapper needs that signal alongside it. `as` documents which props carry it.",
|
|
85
|
+
"description": "Alternate text for the image (used for the accessible name in every render mode). An explicit `alt=\"\"` marks a non-interactive avatar as decorative. A link or button avatar is never decorative — it keeps an accessible name — and a custom component passed to `as` counts as one unless it states otherwise, so `alt=\"\"` on a custom wrapper needs that signal alongside it. `as` documents which props carry it. A link or button avatar that shows initials, with no `src` or one that failed to load, is named by an `aria-label` you pass, else `alt`, else `name`, so by default its name leaves out the initials it shows. Start the name with them, and pass the same `initials` so the two match: `initials=\"AL\" alt=\"AL, Ada Lovelace\"`. Someone using speech input can then say what they see.",
|
|
86
86
|
"required": false,
|
|
87
87
|
"inherited": false,
|
|
88
88
|
"deprecated": false
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"name": "alt",
|
|
165
165
|
"type": "string",
|
|
166
166
|
"default": null,
|
|
167
|
-
"description": "Alternate text for the image (used for the accessible name in every render mode). An explicit `alt=\"\"` marks a non-interactive avatar as decorative. A link or button avatar is never decorative — it keeps an accessible name — and a custom component passed to `as` counts as one unless it states otherwise, so `alt=\"\"` on a custom wrapper needs that signal alongside it. `as` documents which props carry it.",
|
|
167
|
+
"description": "Alternate text for the image (used for the accessible name in every render mode). An explicit `alt=\"\"` marks a non-interactive avatar as decorative. A link or button avatar is never decorative — it keeps an accessible name — and a custom component passed to `as` counts as one unless it states otherwise, so `alt=\"\"` on a custom wrapper needs that signal alongside it. `as` documents which props carry it. A link or button avatar that shows initials, with no `src` or one that failed to load, is named by an `aria-label` you pass, else `alt`, else `name`, so by default its name leaves out the initials it shows. Start the name with them, and pass the same `initials` so the two match: `initials=\"AL\" alt=\"AL, Ada Lovelace\"`. Someone using speech input can then say what they see.",
|
|
168
168
|
"required": false,
|
|
169
169
|
"inherited": false,
|
|
170
170
|
"deprecated": false
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"code": "<Calendar\n aria-label=\"Choisir un jour\"\n locale=\"fr-FR\"\n firstDayOfWeek={1}\n labels={{ prevMonth: 'Mois précédent', nextMonth: 'Mois suivant' }}\n/>"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
|
-
"accessibility": "- The root is a `<div>`. An `aria-label` or `aria-labelledby` on it names the Calendar and makes it a `role=\"group\"`, and so does a labeled `Field` around it, whose label names it when you give it no name of your own.\n- Each month is a `role=\"grid\"` named by its month and year, its weeks `role=\"row\"`s and
|
|
57
|
+
"accessibility": "- The root is a `<div>`. An `aria-label` or `aria-labelledby` on it names the Calendar and makes it a `role=\"group\"`, and so does a labeled `Field` around it, whose label names it when you give it no name of your own.\n- Each month is a `role=\"grid\"` named by its month and year, its weeks `role=\"row\"`s and the days on show `button`s with `role=\"gridcell\"`. Picked days are `aria-selected`, and today has `aria-current=\"date\"`.\n- A day the grid leaves blank, a nearby month's day with `nearbyMonthDays` off or one whose month is on show beside it, draws nothing. A week left with no day on show keeps its place, so the grid keeps its height and months side by side line up, and is hidden from assistive technology rather than read as an empty row. A blank day is still a cell of its week, an empty one with no name, so the days after it keep their weekday's column.\n- In forced colors (Windows' contrast themes), the fill that marks a picked day, month or year, a range's band, and the year the header's year list is on, is replaced, so bestax's styles draw each of those cells, and every day of a picked range, in the system's highlight colors there, or in the system's color for a disabled control when it's disabled. What `dayTemplate` draws in them takes the same colors, unless it sets its own. While a range's end is still being picked, only its start is filled, and the day it would end on keeps its dashed edge.\n- In forced colors, a disabled day, month or year, and a disabled month or arrow button in the header, draws in the system's color for a disabled control, at full strength rather than faded.\n- Each day is named by its full date in the Calendar's locale, such as \"Friday, November 20, 2026\", which `getDayLabel` gets as its `label`. The weekday row is hidden from assistive technology, since every day's name carries its weekday, so moving down a week reads the whole date rather than \"27\". On a server-rendered page the full names arrive once the page hydrates, and until then a day is named by its number and what `dayTemplate` draws.\n- What `dayTemplate` draws isn't read, since a day's name is its date: pair it with `getDayLabel`. On a day it draws text for, start the name with the day's number and that text, in the words the day shows.\n- A range's ends are described as \"Start date\" and \"End date\", the day a pending range would end on as \"Choose as end date\", and a polite live region states the range in words as it's picked, as on `DateRangeInput`.\n- `readOnly` puts `aria-readonly=\"true\"` on the grids and keeps the tab stop and the keys. `disabled` puts `aria-disabled=\"true\"` on them and disables every button.\n- `loading` puts `aria-busy=\"true\"` on the grids and keeps the grid and its focus where they were.\n- A roving `tabindex` keeps one day focusable in the whole Calendar, whatever `monthsToShow` is. When the focused day is disabled, the tab stop moves to the nearest enabled day of the months on show.\n- Closing the year list, with a pick or `Escape`, puts focus back on the grid's tab stop.\n- On a right-to-left page the previous-month chevron points right.",
|
|
58
58
|
"related": ["DateInput", "DateRangeInput", "Fieldset"],
|
|
59
59
|
"storybook": "https://bestax.io/storybook/?path=/story/form-calendar",
|
|
60
60
|
"summary": "The `Calendar` component shows months on the page, not behind an input, where a click picks a day or a range and each day can show what's on it. It's the grid the date pickers draw, with no `Field`, label or hidden input: a form that posts a date uses `DateInput inline` instead.",
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
"name": "locale",
|
|
243
243
|
"type": "string",
|
|
244
244
|
"default": null,
|
|
245
|
-
"description": "BCP-47 locale for the day and month names, the digits the days and years are written in, and the days' accessible names. Unset, it's a `LocaleProvider`'s, and with neither, the runtime's, while the days and years keep plain digits. On a server render that is the server's, so the server and the browser can name the month and the weekdays in different languages: give a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
245
|
+
"description": "BCP-47 locale for the day and month names, the digits the days and years are written in, and the days' accessible names. Unset, it's a `LocaleProvider`'s, and with neither, the runtime's, while the days and years keep plain digits. On a server render that is the server's, so the server and the browser can name the month and the weekdays in different languages: give a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
246
246
|
"required": false,
|
|
247
247
|
"inherited": true,
|
|
248
248
|
"deprecated": false
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"code": "<Carousel ariaLabel=\"Slides without repeat\" repeat={false}>\n <CarouselItem>\n <Hero color=\"danger\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">First (no previous)</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"warning\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph>Middle slide</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n <CarouselItem>\n <Hero color=\"success\" size=\"medium\">\n <Hero.Body textAlign=\"centered\">\n <Paragraph textColor=\"white\">Last (no next)</Paragraph>\n </Hero.Body>\n </Hero>\n </CarouselItem>\n</Carousel>"
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
|
-
"accessibility": "- Uses `role=\"region\"` with `aria-roledescription=\"carousel\"`\n- Name each carousel for what it shows with `ariaLabel`, such as \"Featured products\", and leave the word \"carousel\" out of it, since the role description already says it. Under a visible heading, pass `aria-labelledby` with the heading's id instead, which names it ahead of the `aria-label` the default still sets. The default, \"Image carousel\", is a placeholder: with the role description it says \"carousel\" twice, and every carousel left with it has the same name\n- Each item is a `group` with `aria-roledescription=\"slide\"`, named for its place, such as \"2 of 6\". An item's own `aria-label` or `aria-labelledby` takes the place of that name\n- Items out of view are `aria-hidden` and `inert`, so screen readers skip them and nothing in them takes focus. With several in view, every item in view is exposed. The copies a loop adds at each end of the track follow the same rule, so where the view runs past the last item, the copies on screen are the ones exposed\n- The track is a polite live region, so what comes into view is announced, except while autoplay is moving it (`aria-live=\"off\"`)\n- Autoplay waits while the pointer is over the carousel (with `pauseOnHover`) and while focus is anywhere inside it, on an item, an arrow or an indicator, so nothing moves while someone reads or works it. A browser that leaves focus on an arrow or an indicator a click pressed keeps it waiting until focus moves on. It's a pause, not a stop: once the pointer and focus leave, autoplay goes on\n- When the system asks for reduced motion, each step changes the view at once, with no slide, and a step past either end with `repeat` goes straight to the other end. The arrows and indicators change without a transition too. A drag still follows the pointer, since that's the user's own movement\n- When something else takes the item holding focus out of view (a swipe, a change of width that changes the count, a new controlled `value`, or the item's removal), focus moves to the first item in view rather than dropping to the page\n- Navigation arrows have `aria-label` for screen readers\n- The arrows', the indicators' and the items' names are English unless `labels` gives the words in the page's language, and the role descriptions take `aria-roledescription` on the `Carousel` and on each `CarouselItem`\n- With `arrowBackground={false}`, an arrow with keyboard focus shows Bulma's focus outline, as a ghost `Button` does, in the overlay look too. With `arrowHover`, an arrow shows while keyboard focus is on it\n- Indicators use `role=\"tablist\"` and `role=\"tab\"` semantics, one for each position a step can land on\n- The indicators take Bulma's look: a resting dot, line or bar is filled in the border color and the current one in the primary color, and a circle is a ring in the border color, filled when current. A resting one falls short of the 3:1 against the page that WCAG asks of a graphic. For that, set `--bulma-carousel-indicator-border-color` to a color such as `var(--bulma-text-weak)` on a class you pass through `className`, with the carousel's class in the selector (`.carousel.my-carousel`, `.bestax-carousel.my-carousel` under the prefixed flavor) so it wins whatever order the stylesheets load in. It draws a ring at each resting indicator's edge, circles included, and leaves the current one, and the dots, lines and bars in the overlay look, as they are. Forced colors (Windows' contrast themes) replaces the fills, so there each indicator shows its ring in the buttons' text color and the current one is filled in it.\n- The Left and Right arrow keys move the carousel while focus is on its arrows or indicators, unless Alt, Ctrl or Meta is held, which leaves them to the browser. Inside an item they're left to the item's content, such as a field or a slider. On an indicator they move focus to the indicator beside it and bring its slide into view, as a click on it does\n- Previous/Next buttons are disabled at the ends when not repeating. When the one holding focus is disabled, focus moves to the current indicator, or to the other arrow when there are no indicators. When a focused arrow or indicator goes away, as an indicator does when a change of width leaves fewer positions, focus moves to the current indicator, an arrow that works, or the first item in view, rather than dropping to the page\n- In forced colors (Windows' contrast themes), a disabled arrow draws in the system's color for a disabled control, at full strength rather than faded,
|
|
77
|
+
"accessibility": "- Uses `role=\"region\"` with `aria-roledescription=\"carousel\"`\n- Name each carousel for what it shows with `ariaLabel`, such as \"Featured products\", and leave the word \"carousel\" out of it, since the role description already says it. Under a visible heading, pass `aria-labelledby` with the heading's id instead, which names it ahead of the `aria-label` the default still sets. The default, \"Image carousel\", is a placeholder: with the role description it says \"carousel\" twice, and every carousel left with it has the same name\n- Each item is a `group` with `aria-roledescription=\"slide\"`, named for its place, such as \"2 of 6\". An item's own `aria-label` or `aria-labelledby` takes the place of that name\n- Items out of view are `aria-hidden` and `inert`, so screen readers skip them and nothing in them takes focus. With several in view, every item in view is exposed. The copies a loop adds at each end of the track follow the same rule, so where the view runs past the last item, the copies on screen are the ones exposed\n- The track is a polite live region, so what comes into view is announced, except while autoplay is moving it (`aria-live=\"off\"`)\n- Autoplay waits while the pointer is over the carousel (with `pauseOnHover`) and while focus is anywhere inside it, on an item, an arrow or an indicator, so nothing moves while someone reads or works it. A browser that leaves focus on an arrow or an indicator a click pressed keeps it waiting until focus moves on. It's a pause, not a stop: once the pointer and focus leave, autoplay goes on\n- When the system asks for reduced motion, each step changes the view at once, with no slide, and a step past either end with `repeat` goes straight to the other end. The arrows and indicators change without a transition too. A drag still follows the pointer, since that's the user's own movement\n- When something else takes the item holding focus out of view (a swipe, a change of width that changes the count, a new controlled `value`, or the item's removal), focus moves to the first item in view rather than dropping to the page\n- Navigation arrows have `aria-label` for screen readers\n- The arrows', the indicators' and the items' names are English unless `labels` gives the words in the page's language, and the role descriptions take `aria-roledescription` on the `Carousel` and on each `CarouselItem`\n- With `arrowBackground={false}`, an arrow with keyboard focus shows Bulma's focus outline, as a ghost `Button` does, in the overlay look too. With `arrowHover`, an arrow shows while keyboard focus is on it\n- Indicators use `role=\"tablist\"` and `role=\"tab\"` semantics, one for each position a step can land on\n- The indicators take Bulma's look: a resting dot, line or bar is filled in the border color and the current one in the primary color, and a circle is a ring in the border color, filled when current. A resting one falls short of the 3:1 against the page that WCAG asks of a graphic. For that, set `--bulma-carousel-indicator-border-color` to a color such as `var(--bulma-text-weak)` on a class you pass through `className`, with the carousel's class in the selector (`.carousel.my-carousel`, `.bestax-carousel.my-carousel` under the prefixed flavor) so it wins whatever order the stylesheets load in. It draws a ring at each resting indicator's edge, circles included, and leaves the current one, and the dots, lines and bars in the overlay look, as they are. Forced colors (Windows' contrast themes) replaces the fills, so there each indicator shows its ring in the buttons' text color and the current one is filled in it.\n- The Left and Right arrow keys move the carousel while focus is on its arrows or indicators, unless Alt, Ctrl or Meta is held, which leaves them to the browser. Inside an item they're left to the item's content, such as a field or a slider. On an indicator they move focus to the indicator beside it and bring its slide into view, as a click on it does\n- Previous/Next buttons are disabled at the ends when not repeating. When the one holding focus is disabled, focus moves to the current indicator, or to the other arrow when there are no indicators. When a focused arrow or indicator goes away, as an indicator does when a change of width leaves fewer positions, focus moves to the current indicator, an arrow that works, or the first item in view, rather than dropping to the page\n- With `arrowHover`, a disabled arrow hides at rest with the others and shows faded with them under the pointer. It can't take keyboard focus, so focus never shows it\n- In forced colors (Windows' contrast themes), a disabled arrow draws in the system's color for a disabled control, at full strength rather than faded, and with `arrowHover` it does so under the pointer\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.",
|
|
78
78
|
"related": ["Modal", "Tabs"],
|
|
79
79
|
"storybook": "https://bestax.io/storybook/?path=/story/components-carousel",
|
|
80
80
|
"summary": "The `Carousel` component provides an image/content slider with navigation arrows and indicators.",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"code": "function example() {\n return (\n <Field\n horizontal\n label=\"Date\"\n labelProps={{ htmlFor: 'date-field-control' }}\n >\n <Field.Body>\n <Field>\n <Control iconLeftName=\"calendar-alt\">\n <DateInput id=\"date-field-control\" placeholder=\"YYYY-MM-DD\" />\n </Control>\n </Field>\n </Field.Body>\n </Field>\n );\n}"
|
|
179
179
|
}
|
|
180
180
|
],
|
|
181
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date, month or year.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid or year list inside keep their own names.\n- Closing the popover with `Escape` or a pick returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Dismissing without a pick commits nothing: an empty field stays empty, and leaving afterwards commits only what you typed.\n- Calendar uses `role=\"grid\"` with cells as `role=\"gridcell\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- With `nearbyMonthDays` off, the calendar leaves a nearby month's days blank, and a week with no day on show keeps its place, so the grid keeps its height, and is hidden from assistive technology rather than read as an empty row. The device's own picker, which `mobileNative` opens on a touch device, draws its own grid.\n-
|
|
181
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date, month or year.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid or year list inside keep their own names.\n- Closing the popover with `Escape` or a pick returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Dismissing without a pick commits nothing: an empty field stays empty, and leaving afterwards commits only what you typed.\n- Calendar uses `role=\"grid\"` with cells as `role=\"gridcell\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- With `nearbyMonthDays` off, the calendar leaves a nearby month's days blank, and a week with no day on show keeps its place, so the grid keeps its height, and is hidden from assistive technology rather than read as an empty row. A blank day is still a cell of its week, an empty one with no name, so the days after it keep their weekday's column. The device's own picker, which `mobileNative` opens on a touch device, draws its own grid.\n- Days 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- In forced colors, a disabled day, month or year, a disabled month or arrow button in the header, and a disabled launcher draw in the system's color for a disabled control, at full strength rather than faded.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid or year list and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` on the grid or year list it picks from, and keeps its tab stop and keys.\n- Roving `tabindex` keeps a single grid cell focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- The month grid is a `role=\"grid\"` of `role=\"row\"`s, labelled by the year in its header. Each month cell carries the full month name as its accessible name, `aria-current=\"date\"` for this month and `aria-disabled` for a month with no selectable day.\n- The year list is a `role=\"listbox\"`, named by the `chooseYear` label where it is the selection surface and by the heading that opens it otherwise. As the selection surface its options take `aria-selected` from the value's year rather than from focus, which roves through the list. When the focused year is disabled, the nearest enabled year takes the tab stop, so `Tab` still reaches the list.\n- The launcher and popover are named \"Choose month\" or \"Choose year\" to match the granularity; override them, and the month grid's \"Previous year\" / \"Next year\" buttons, through `labels` (`chooseMonth`, `chooseYear`, `prevYear`, `nextYear`).\n- Honors `prefers-reduced-motion` (skip popover fade-in).\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right. The month names follow the page.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.\n- A date of birth takes `autoComplete=\"bday\"`, which goes on the field, so the browser and assistive technology know what it asks for (WCAG 1.3.5). Without a token the text field turns autocomplete off, since the browser's own suggestions would cover the calendar. A date that autofill writes commits when it reads in the token `format` (the default one when `format` is `Intl` options) or through your `parse`. One it can't read, or that `min`, `max` or a blocked day rules out, isn't committed, as with typing: the field shows it as written, and submits it under a `name`, until focus next leaves the field.",
|
|
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.",
|
|
@@ -483,7 +483,7 @@
|
|
|
483
483
|
"name": "locale",
|
|
484
484
|
"type": "string",
|
|
485
485
|
"default": null,
|
|
486
|
-
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
486
|
+
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
487
487
|
"required": false,
|
|
488
488
|
"inherited": true,
|
|
489
489
|
"deprecated": false
|
|
@@ -855,7 +855,7 @@
|
|
|
855
855
|
"name": "locale",
|
|
856
856
|
"type": "string",
|
|
857
857
|
"default": null,
|
|
858
|
-
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
858
|
+
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
859
859
|
"required": false,
|
|
860
860
|
"inherited": false,
|
|
861
861
|
"deprecated": false
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"code": "<Field label=\"Leave\">\n <Control iconLeftName=\"calendar-alt\">\n <DateRangeInput />\n </Control>\n</Field>"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"accessibility": "- The root is a `role=\"group\"` named by `label` through `aria-labelledby`, since the label names two inputs rather than one. Inside a labeled `Field`, that `Field`'s label names the group the same way, whether the `Field` holds `DateRangeInput` or a `DateRangeInputBase` you composed in a `Control` yourself, `inline` or not. An `aria-label` or `aria-labelledby` you give the group wins over either label.\n- Each input is a `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded` and `aria-controls`, and its own name: \"Start date\" or \"End date\", from the `labels` keys `rangeStart` and `rangeEnd`. The separator between them is hidden from assistive technology.\n- `aria-invalid` and `aria-errormessage` go on both inputs, marking the range as a whole, while the other attributes you pass go on the group, so a screen reader hears an input is invalid when it takes focus. An `inline` picker has no input, and they stay on its group.\n- The popover is a `role=\"dialog\"` named \"Choose date range\" (`labels.chooseDateRange`). Opening it puts focus on the calendar's focused day, and closing it returns focus to the input you were last in, or to the start input.\n- With `monthsToShow`, each month is a grid of its own, named by its month and year, and the calendar keeps one tab stop across them.\n- A day the grid leaves blank, a nearby month's day with `nearbyMonthDays` off or one whose month is on show beside it, draws nothing. A week left with no day on show keeps its place, so the grid keeps its height and months side by side line up, and is hidden from assistive technology rather than read as an empty row.\n- The day grid is `aria-multiselectable`, and its days sit in a `role=\"row\"` per week. Every day of the range is `aria-selected`, both ends included. While the end is still being picked, only the start is: the preview is not a selection.\n- In forced colors (Windows' contrast themes), the fill and the band that mark the range are replaced, so bestax's styles draw every day of a picked range, both ends included, and the year the header's year list is on, in the system's highlight colors there, or in the system's color for a disabled control when it's disabled. While the end is still being picked, only the start is filled, and the day the range would end on keeps its dashed edge.\n- In forced colors, a disabled day, month or year, a disabled month or arrow button in the header, and a disabled launcher draw in the system's color for a disabled control, at full strength rather than faded.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, keeps its tab stop and keys, and picks nothing.\n- The start and end days are described as \"Start date\" and \"End date\", so moving onto either says which it is. While the end is still being picked, the day the range would end on is described as \"Choose as end date\" (`labels.rangePreviewEnd`).\n- A polite live region in the calendar states the range in words, such as \"Start date: June 10, 2024, End date: June 13, 2024\", and announces each pick. The grid points at it too, so moving into the grid reads the current range.\n- Everything else is the calendar `DateInput` uses: a roving `tabindex`, weekday column headers named in full (or by your `dayNames`), `aria-disabled` on disabled days, `aria-current=\"date\"` on today, and focus back on the grid as the year list closes.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the group through `aria-describedby`, after any ids you pass there, as the label names it.",
|
|
53
|
+
"accessibility": "- The root is a `role=\"group\"` named by `label` through `aria-labelledby`, since the label names two inputs rather than one. Inside a labeled `Field`, that `Field`'s label names the group the same way, whether the `Field` holds `DateRangeInput` or a `DateRangeInputBase` you composed in a `Control` yourself, `inline` or not. An `aria-label` or `aria-labelledby` you give the group wins over either label.\n- Each input is a `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded` and `aria-controls`, and its own name: \"Start date\" or \"End date\", from the `labels` keys `rangeStart` and `rangeEnd`. The separator between them is hidden from assistive technology.\n- `aria-invalid` and `aria-errormessage` go on both inputs, marking the range as a whole, while the other attributes you pass go on the group, so a screen reader hears an input is invalid when it takes focus. An `inline` picker has no input, and they stay on its group.\n- The popover is a `role=\"dialog\"` named \"Choose date range\" (`labels.chooseDateRange`). Opening it puts focus on the calendar's focused day, and closing it returns focus to the input you were last in, or to the start input.\n- With `monthsToShow`, each month is a grid of its own, named by its month and year, and the calendar keeps one tab stop across them.\n- A day the grid leaves blank, a nearby month's day with `nearbyMonthDays` off or one whose month is on show beside it, draws nothing. A week left with no day on show keeps its place, so the grid keeps its height and months side by side line up, and is hidden from assistive technology rather than read as an empty row. A blank day is still a cell of its week, an empty one with no name, so the days after it keep their weekday's column.\n- The day grid is `aria-multiselectable`, and its days sit in a `role=\"row\"` per week. Every day of the range is `aria-selected`, both ends included. While the end is still being picked, only the start is: the preview is not a selection.\n- In forced colors (Windows' contrast themes), the fill and the band that mark the range are replaced, so bestax's styles draw every day of a picked range, both ends included, and the year the header's year list is on, in the system's highlight colors there, or in the system's color for a disabled control when it's disabled. While the end is still being picked, only the start is filled, and the day the range would end on keeps its dashed edge.\n- In forced colors, a disabled day, month or year, a disabled month or arrow button in the header, and a disabled launcher draw in the system's color for a disabled control, at full strength rather than faded.\n- A `disabled` inline calendar puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, keeps its tab stop and keys, and picks nothing.\n- The start and end days are described as \"Start date\" and \"End date\", so moving onto either says which it is. While the end is still being picked, the day the range would end on is described as \"Choose as end date\" (`labels.rangePreviewEnd`).\n- A polite live region in the calendar states the range in words, such as \"Start date: June 10, 2024, End date: June 13, 2024\", and announces each pick. The grid points at it too, so moving into the grid reads the current range.\n- Everything else is the calendar `DateInput` uses: a roving `tabindex`, weekday column headers named in full (or by your `dayNames`), `aria-disabled` on disabled days, `aria-current=\"date\"` on today, and focus back on the grid as the year list closes.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start, and the previous-month chevron points right.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the group through `aria-describedby`, after any ids you pass there, as the label names it.",
|
|
54
54
|
"related": ["DateInput", "DateTimeInput", "Field"],
|
|
55
55
|
"storybook": "https://bestax.io/storybook/?path=/story/form-daterangeinput",
|
|
56
56
|
"summary": "The `DateRangeInput` component is a form input for a start and end date, picked from one popover calendar or typed into two segmented inputs.",
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
"name": "locale",
|
|
347
347
|
"type": "string",
|
|
348
348
|
"default": null,
|
|
349
|
-
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
349
|
+
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
350
350
|
"required": false,
|
|
351
351
|
"inherited": true,
|
|
352
352
|
"deprecated": false
|
|
@@ -745,7 +745,7 @@
|
|
|
745
745
|
"name": "locale",
|
|
746
746
|
"type": "string",
|
|
747
747
|
"default": null,
|
|
748
|
-
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
748
|
+
"description": "BCP-47 locale tag for day/month names, the digits the calendar numbers its days and years in, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar numbers its days and years in plain digits. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
749
749
|
"required": false,
|
|
750
750
|
"inherited": false,
|
|
751
751
|
"deprecated": false
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"code": "<DateTimeInput label=\"Input only\" popover={false} defaultValue={new Date()} />"
|
|
171
171
|
}
|
|
172
172
|
],
|
|
173
|
-
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid and its wheels inside keep their own names.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- With `nearbyMonthDays` off, the calendar leaves a nearby month's days blank, and a week with no day on show keeps its place, so the grid keeps its height, and is hidden from assistive technology rather than read as an empty row. The device's own picker, which `mobileNative` opens on a touch device, draws its own grid.\n-
|
|
173
|
+
"accessibility": "- Trigger uses `role=\"combobox\"` with `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls`.\n- Popover panel has `role=\"dialog\"` with an accessible name. Opening it puts focus on the focused date.\n- An `inline` picker has no input for its `label` to name, so its root is a `role=\"group\"` the `label` names through `aria-labelledby` and its `message` describes. A labeled `Field` around it names it the same way, unless the `Field` is `grouped` or `hasAddons`, or a label is wired by hand with `labelProps.htmlFor`. An `aria-label` or `aria-labelledby` you give it names it instead. With no name it stays a plain `div`, and its grid and its wheels inside keep their own names.\n- Closing the popover with `Escape`, the ✓ button or `Enter` on a time wheel returns focus to the input, whether the input or the launcher opened it. Under `openOnFocus` that returning focus leaves the popover closed; focusing or clicking the input again opens it. Closing it commits nothing by itself: an empty field stays empty, and leaving afterwards commits only what you typed, so seconds the display leaves out are kept.\n- Calendar uses `role=\"grid\"`. Its first row holds the weekday names as `role=\"columnheader\"`s, each named by the full weekday in the picker's locale, so a screen reader can name the weekday as focus moves to another column. A server-rendered calendar adds those full names once the page hydrates, and with `dayNames` the columns are named by the names you give instead. Each day keeps its number as its name.\n- With `nearbyMonthDays` off, the calendar leaves a nearby month's days blank, and a week with no day on show keeps its place, so the grid keeps its height, and is hidden from assistive technology rather than read as an empty row. A blank day is still a cell of its week, an empty one with no name, so the days after it keep their weekday's column. The device's own picker, which `mobileNative` opens on a touch device, draws its own grid.\n- Days 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- In forced colors, a disabled day, month or year, a disabled month or arrow button in the header, a disabled Time, Reset or ✓ button in the footer, and a disabled launcher draw in the system's color for a disabled control, at full strength rather than faded.\n- Roving `tabindex` keeps a single day focusable at a time, and focus moves with it, inline as in the popover. When the focused date is disabled, that cell is the nearest enabled day of the month.\n- Closing the year list opened from the header, with a pick or `Escape`, puts focus back on the grid's tab stop, inline as in the popover.\n- A `disabled` inline panel puts `aria-disabled=\"true\"` on its grid and disables every button in it. A `readOnly` one puts `aria-readonly=\"true\"` there instead, and keeps its tab stop and keys.\n- Each time wheel uses `role=\"spinbutton\"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, and `aria-valuetext`, whose text is the number as the wheel shows it, in the picker's locale's digits when it has a locale. The values drawn above and below are click targets hidden from assistive technology, which reads the value from the spinbutton.\n- In a 12-hour picker, AM/PM is one of those wheels, reading `AM` or `PM`, or the picker's locale's words for them when it has a locale, and it widens to fit a longer word. Its accessible name is `AM/PM` unless `labels.ampm` sets another.\n- In forced colors (Windows' contrast themes), the time wheels' band is drawn in the system's highlight color, since its fill is replaced there, and the values keep the system's text color.\n- The footer's confirm button exposes an accessible label (`Done`); the Reset button reverts your edits to the value the popover opened with, or on an `inline` picker, to the one described under [Inline](https://bestax.io/docs/api/form/datetime/datetimeinput#inline).\n- Tab order walks from the calendar to the footer (Reset / ✓), and from the time wheels to the footer while they are open.\n- On a right-to-left page the launcher sits at the end of the line and the calendar icon at the start. The time wheels keep `dir=\"ltr\"`.\n- A panel that would run past the left or right edge of the screen, as on a phone with the\n field mid-row, keeps its corner and moves sideways just far enough to fit, or, wider than\n the screen, to the edge its text starts from.\n- The `message` describes the input through `aria-describedby`, so a screen reader reads it when the input takes focus. Ids you pass in `aria-describedby` go on the container with the other attributes, except on a phone's native input, which lists them first. An `inline` picker has no input, so there the message describes the picker's group, when something names it.\n- `aria-invalid` and `aria-errormessage` go on the input, while the other attributes you pass go on the container, so a screen reader hears the input is invalid when it takes focus. An `inline` picker has no input, and they stay on its container.\n- The input takes its name from `label`, from a labeled `Field` that isn't `grouped` or `hasAddons` around a `DateTimeInputBase` with no `id` of its own, or from a `<label htmlFor>` of your own pointing at the `id` you give it. `aria-label` and `aria-labelledby` go on the container with the other attributes you pass, so they don't name the input, except on the native input `mobileNative` renders, which takes them itself. An `inline` picker has no input to name.\n- An `autoComplete` you give goes on the field. Without one the text field turns autocomplete off, since the browser's own suggestions would cover the panel. A date and time that autofill writes commits when it reads in the token `format` (the default one when `format` is `Intl` options) or through your `parse`. One it can't read, or that `min`, `max` or a blocked day or time rules out, isn't committed, as with typing: the field shows it as written, and submits it under a `name`, until focus next leaves the field.",
|
|
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.",
|
|
@@ -466,7 +466,7 @@
|
|
|
466
466
|
"name": "locale",
|
|
467
467
|
"type": "string",
|
|
468
468
|
"default": null,
|
|
469
|
-
"description": "BCP-47 locale tag for day/month names, the digits the calendar and the time wheels write their numbers in, the words a 12-hour wheel shows for AM and PM, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar and the wheels keep plain digits and AM and PM. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
469
|
+
"description": "BCP-47 locale tag for day/month names, the digits the calendar and the time wheels write their numbers in, the words a 12-hour wheel shows for AM and PM, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar and the wheels keep plain digits and AM and PM. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
470
470
|
"required": false,
|
|
471
471
|
"inherited": true,
|
|
472
472
|
"deprecated": false
|
|
@@ -901,7 +901,7 @@
|
|
|
901
901
|
"name": "locale",
|
|
902
902
|
"type": "string",
|
|
903
903
|
"default": null,
|
|
904
|
-
"description": "BCP-47 locale tag for day/month names, the digits the calendar and the time wheels write their numbers in, the words a 12-hour wheel shows for AM and PM, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar and the wheels keep plain digits and AM and PM. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ.",
|
|
904
|
+
"description": "BCP-47 locale tag for day/month names, the digits the calendar and the time wheels write their numbers in, the words a 12-hour wheel shows for AM and PM, and Intl formatting. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the calendar and the wheels keep plain digits and AM and PM. On a server render that locale is the server's, so an `inline` calendar rendered there names its days in the server's language and the browser's own render names them in the browser's: give it a locale, here or through a `LocaleProvider`, where the two can differ. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
905
905
|
"required": false,
|
|
906
906
|
"inherited": false,
|
|
907
907
|
"deprecated": false
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "In Running Text",
|
|
14
|
-
"code": "<Paragraph>\n Reviewed by{' '}\n <HoverCard
|
|
14
|
+
"code": "<Paragraph>\n Reviewed by{' '}\n <HoverCard\n appendToBody\n trigger={\n <Link href=\"#ada\" textTransform=\"underlined\">\n Ada Lovelace\n </Link>\n }\n >\n <Title as=\"p\" size=\"6\">\n Ada Lovelace\n </Title>\n <SubTitle as=\"p\" size=\"6\">\n Analytical Engine team\n </SubTitle>\n <Link href=\"#profile\">View profile</Link>\n </HoverCard>{' '}\n and merged the same day.\n</Paragraph>"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "Placement",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"note": "A path under /img/ here stands for a picture your own app serves, such as a file in its public/img/ folder."
|
|
90
90
|
}
|
|
91
91
|
],
|
|
92
|
-
"accessibility": "- The root `Navbar` renders as `<nav role=\"navigation\" aria-label=\"main navigation\">`.\n The default accessible name is `main navigation`. A screen reader announces it with\n the role, and since the name holds the role word, \"navigation\" is heard twice.\n Pass a name without the role word (`aria-label=\"Site\"`), and a different name\n on each Navbar when a page has more than one. A passed `aria-label` replaces\n the default.\n- `Navbar.Item active` sets `aria-current=\"page\"` on the element `as` renders, the link by\n default, so the current item isn't only a color. An `aria-current` you pass wins: a navbar of\n sections on one page can say `\"location\"`, and `aria-current={false}` turns it off.\n- Bulma fills an active link item with its selected color, the link color in a navbar with no\n `color`, and bestax's styles give its text the color Bulma picks to read on that fill,\n `--bulma-navbar-item-selected-color-l`. Bulma's own stylesheet leaves the text in the navbar's\n normal text color, dark gray on blue on the light scheme, so the rule ships in `bestax.css` and\n `extras.css`. A `--bulma-navbar-item-color` you set on the item itself still wins, and an item\n with a `bgColor` keeps the navbar's text color. A rule of your own that takes the fill off\n restates `color` too.\n- Use semantic links (`<a>`) and buttons, and provide clear `aria-label` and `aria-expanded` for the burger toggle.\n- `Navbar.Link` inside a `Navbar.Dropdown` automatically gets `aria-haspopup=\"true\"` and\n `aria-expanded` synced to the dropdown's open state — no manual wiring required.\n <kbd>Enter</kbd>/<kbd>Space</kbd> toggle the dropdown open/closed, and <kbd>Escape</kbd>\n closes it and keeps focus on the link. <kbd>Escape</kbd> anywhere else in the open dropdown, its\n menu included, puts focus back on the link and closes it too, unless a control there marks the\n key used, the key comes from a dialog or from content opened from the menu into a portal, or\n focus can't go back to the link. Focus landing outside an open dropdown, as <kbd>Tab</kbd> past\n its last item or <kbd>Shift</kbd>+<kbd>Tab</kbd> back past its link does, closes it too, so its\n menu isn't left over the page. A controlled one is told through `onActiveChange` and keeps its\n `active`. Focus moving into content opened from the menu into a portal or into a dialog marked\n `aria-modal`, such as a `Modal` an item opens, which gives focus back to the item when it closes, focus going\n nowhere, as the window losing focus does, and a press outside that doesn't move focus leave it\n open. When the trigger isn't interactive on its own — no\n `href`, not `as=\"button\"`, and not a custom component — it also gets `role=\"button\"` and\n `tabIndex={0}` so it's reachable and operable by keyboard, and a mouse/touch click on it\n toggles the dropdown too (a caller-supplied `onClick` still runs, and can\n `preventDefault()` to opt out).\n- A custom component passed to `as` keeps its own semantics, because a router link takes `to`\n rather than `href` and so can't be recognised from the props it's given. If yours renders\n something non-interactive instead, pass `role=\"button\"` and it takes the fallback above —\n `tabIndex` and click included. The keyboard path is wired either way.\n- `hoverable` dropdowns keep working with a mouse (hover-to-open); the keyboard path above\n opens and closes them independently of hover. Bulma shows a `hoverable` dropdown's menu while\n the pointer is on it and while focus is in it, the link included, on a desktop-wide window.\n <kbd>Escape</kbd> puts a menu shown that way away, and it stays away until the pointer has left\n the dropdown and focus has too, or until the pointer comes back or focus moves onto something in\n it. From the page, the key goes on to what has focus; from inside\n the dropdown, focus moves to the link, with the same exceptions as for an open one, such as focus\n that can't go back to the link, where the menu stays. Below the desktop breakpoint, where the menu always\n shows under the burger, Escape doesn't put it away, though it still closes an open one.\n- **A fixed navbar:** with `fixed=\"top\"`, bestax's styles pad the page's scroll by\n `--bulma-navbar-height`, so the browser scrolls a control that takes focus, or an in-page link's\n target, to below the navbar rather than under it. `fixed=\"bottom\"` pads the bottom of the page\n the same way, and a navbar fixed by Bulma's `is-fixed-top-touch` or `-desktop` classes (or the\n bottom pair) in its `className` gets the same at that breakpoint, as it gets the margins that\n keep it over the page while an overlay locks its scrolling. The page's own padding, so its top\n doesn't start under the navbar, is still Bulma's `has-navbar-fixed-top` on `<html>`, or\n `has-navbar-fixed-top-touch` or `-desktop` for a navbar fixed at one breakpoint. A\n `scroll-padding-top` of your own on `<html>`, or an [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s, wins\n over it: set yours for a navbar taller than
|
|
92
|
+
"accessibility": "- The root `Navbar` renders as `<nav role=\"navigation\" aria-label=\"main navigation\">`.\n The default accessible name is `main navigation`. A screen reader announces it with\n the role, and since the name holds the role word, \"navigation\" is heard twice.\n Pass a name without the role word (`aria-label=\"Site\"`), and a different name\n on each Navbar when a page has more than one. A passed `aria-label` replaces\n the default.\n- `Navbar.Item active` sets `aria-current=\"page\"` on the element `as` renders, the link by\n default, so the current item isn't only a color. An `aria-current` you pass wins: a navbar of\n sections on one page can say `\"location\"`, and `aria-current={false}` turns it off.\n- Bulma fills an active link item with its selected color, the link color in a navbar with no\n `color`, and bestax's styles give its text the color Bulma picks to read on that fill,\n `--bulma-navbar-item-selected-color-l`. Bulma's own stylesheet leaves the text in the navbar's\n normal text color, dark gray on blue on the light scheme, so the rule ships in `bestax.css` and\n `extras.css`. A `--bulma-navbar-item-color` you set on the item itself still wins, and an item\n with a `bgColor` keeps the navbar's text color. A rule of your own that takes the fill off\n restates `color` too.\n- Use semantic links (`<a>`) and buttons, and provide clear `aria-label` and `aria-expanded` for the burger toggle.\n- `Navbar.Link` inside a `Navbar.Dropdown` automatically gets `aria-haspopup=\"true\"` and\n `aria-expanded` synced to the dropdown's open state — no manual wiring required.\n <kbd>Enter</kbd>/<kbd>Space</kbd> toggle the dropdown open/closed, and <kbd>Escape</kbd>\n closes it and keeps focus on the link. <kbd>Escape</kbd> anywhere else in the open dropdown, its\n menu included, puts focus back on the link and closes it too, unless a control there marks the\n key used, the key comes from a dialog or from content opened from the menu into a portal, or\n focus can't go back to the link. Focus landing outside an open dropdown, as <kbd>Tab</kbd> past\n its last item or <kbd>Shift</kbd>+<kbd>Tab</kbd> back past its link does, closes it too, so its\n menu isn't left over the page. A controlled one is told through `onActiveChange` and keeps its\n `active`. Focus moving into content opened from the menu into a portal or into a dialog marked\n `aria-modal`, such as a `Modal` an item opens, which gives focus back to the item when it closes, focus going\n nowhere, as the window losing focus does, and a press outside that doesn't move focus leave it\n open. When the trigger isn't interactive on its own — no\n `href`, not `as=\"button\"`, and not a custom component — it also gets `role=\"button\"` and\n `tabIndex={0}` so it's reachable and operable by keyboard, and a mouse/touch click on it\n toggles the dropdown too (a caller-supplied `onClick` still runs, and can\n `preventDefault()` to opt out).\n- A custom component passed to `as` keeps its own semantics, because a router link takes `to`\n rather than `href` and so can't be recognised from the props it's given. If yours renders\n something non-interactive instead, pass `role=\"button\"` and it takes the fallback above —\n `tabIndex` and click included. The keyboard path is wired either way.\n- `hoverable` dropdowns keep working with a mouse (hover-to-open); the keyboard path above\n opens and closes them independently of hover. Bulma shows a `hoverable` dropdown's menu while\n the pointer is on it and while focus is in it, the link included, on a desktop-wide window.\n <kbd>Escape</kbd> puts a menu shown that way away, and it stays away until the pointer has left\n the dropdown and focus has too, or until the pointer comes back or focus moves onto something in\n it. From the page, the key goes on to what has focus; from inside\n the dropdown, focus moves to the link, with the same exceptions as for an open one, such as focus\n that can't go back to the link, where the menu stays. Below the desktop breakpoint, where the menu always\n shows under the burger, Escape doesn't put it away, though it still closes an open one.\n- **A fixed navbar:** with `fixed=\"top\"`, bestax's styles pad the page's scroll by\n `--bulma-navbar-height`, so the browser scrolls a control that takes focus, or an in-page link's\n target, to below the navbar rather than under it. `fixed=\"bottom\"` pads the bottom of the page\n the same way, and a navbar fixed by Bulma's `is-fixed-top-touch` or `-desktop` classes (or the\n bottom pair) in its `className` gets the same at that breakpoint, as it gets the margins that\n keep it over the page while an overlay locks its scrolling. From the desktop breakpoint up, a\n spaced navbar pads by its taller height, with `--bulma-navbar-padding-vertical` above and below\n (Bulma's `1rem` unless you register the variable on `:root` with your navbar's padding). The page's own padding, so its top\n doesn't start under the navbar, is still Bulma's `has-navbar-fixed-top` on `<html>`, or\n `has-navbar-fixed-top-touch` or `-desktop` for a navbar fixed at one breakpoint. A\n `scroll-padding-top` of your own on `<html>`, or an [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s, wins\n over it: set yours for a navbar taller than the height it pads by, or to `0` where your anchor\n targets already carry a `scroll-margin-top`, which adds to it. This ships in `bestax.css` and\n `extras.css`, not in Bulma's own stylesheet.\n- **Forced colors:** Bulma draws the burger's bars as a background color, which forced colors\n (Windows' contrast themes) replaces, so the burger would vanish there while it still works and\n takes focus. bestax's styles keep its bars visible in the system's button text color. That rule\n ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet, and an\n [`AppFrame`](https://bestax.io/docs/api/layout/appframe)'s burger gets it too. Bulma marks an active or selected\n link item, `Navbar.Link` and dropdown row with a fill and a text color alone, which forced\n colors replaces, so bestax's styles draw a bar in the system's highlight color inside it there:\n along its bottom in a row, and down its start edge where the items stack, in a dropdown and in\n the menu the burger opens. The item and everything in it stay in the contrast theme's colors,\n and an active tab gets the bar above Bulma's thicker underline. This ships in the same\n stylesheets.\n- **`Navbar.Divider` in forced colors:** Bulma draws it as a background color too, which forced\n colors paints in the dropdown's own color, so the line would vanish. bestax's styles draw it in\n the system's text color there, from the same stylesheets.\n- **An open dropdown's edge in forced colors:** from the desktop breakpoint up, Bulma draws\n `Navbar.DropdownMenu` as a box over the page, edged with a shadow and, for some, a line on the\n side it opens from. Forced colors drops the shadow and paints the box in the page's own color, so\n bestax's styles draw a one pixel line in the system's text color around it there, outside the\n box, so nothing moves. Under the burger its rows sit in the menu, with no box to edge. This\n ships in the same stylesheets.\n- **In a colored [`Hero`](https://bestax.io/docs/api/layout/hero):** Bulma's hero sets the colors its navbar's items\n take on hover and when active, but Bulma's navbar doesn't read them, so a focused or hovered\n item took the scheme's fill under the hero's text, and the active item and the burger took the\n link color. For a `Navbar` with no `color` of its own, bestax's styles draw a focused, hovered or\n active item in the hero's text color with the hero's background color as its text, the burger\n and a tab in the hero's text color, and the dropdown arrow in its link's text color. The menu the\n burger opens, and the dropdown's rows in it, take the hero's background and text, except an\n active row, which keeps Bulma's selected fill and the text that reads on it, and on a phone a bold hero's menu takes the hero's\n own gradient. Where `Navbar.DropdownMenu` is a box of its own, on a desktop, its links keep\n Bulma's colors. That rule ships in `bestax.css` and `extras.css`, not in Bulma's own stylesheet.\n\n:::note\nThere's no arrow-key roving between navbar items, and a press outside an open `Navbar.Dropdown`\ncloses it only when it moves focus there. A press on a field moves focus in every browser, and\none on a button or a link does in some, such as Chrome, and not in others, such as Safari. Bulma navbar dropdowns are hover/click surfaces, so this is\nintentionally kept simple.\n:::",
|
|
93
93
|
"related": ["Button", "Icon", "useBulmaClasses"],
|
|
94
94
|
"storybook": "https://bestax.io/storybook/?path=/story/components-navbar--default",
|
|
95
95
|
"summary": "The `Navbar` component implements Bulma's powerful, responsive navigation bar for your Bulma React UI.",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"name": "isSpaced",
|
|
154
154
|
"type": "boolean",
|
|
155
155
|
"default": "false",
|
|
156
|
-
"description": "Renders Bulma's `is-spaced`: padding around the navbar, rounded items and boxed dropdowns. Bulma applies it from the desktop breakpoint up, so below that the navbar looks the same either way.
|
|
156
|
+
"description": "Renders Bulma's `is-spaced`: padding around the navbar, rounded items and boxed dropdowns. Bulma applies it from the desktop breakpoint up, so below that the navbar looks the same either way. From desktop up a spaced navbar with `fixed=\"top\"` is taller than `has-navbar-fixed-top` pads the page for. Bulma's `has-spaced-navbar-fixed-top` is meant to pad it for the taller navbar, but it reads `--bulma-navbar-padding-vertical`, which Bulma sets on the navbar only, so on `<html>` it sets the page's padding to `0` and takes away `has-navbar-fixed-top`'s. Register that variable on `:root` with the padding the navbar uses (Bulma's default is `1rem`) to make it work beside `has-navbar-fixed-top`, or pad the page yourself; the same goes for the `-bottom` pair with `fixed=\"bottom\"`.",
|
|
157
157
|
"required": false,
|
|
158
158
|
"inherited": false,
|
|
159
159
|
"deprecated": false
|
|
@@ -474,7 +474,7 @@
|
|
|
474
474
|
"name": "locale",
|
|
475
475
|
"type": "string",
|
|
476
476
|
"default": null,
|
|
477
|
-
"description": "BCP-47 locale tag for Intl formatting, the digits the wheels write their hours, minutes and seconds in, and the words a 12-hour wheel shows for AM and PM. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the wheels keep plain digits and AM and PM.",
|
|
477
|
+
"description": "BCP-47 locale tag for Intl formatting, the digits the wheels write their hours, minutes and seconds in, and the words a 12-hour wheel shows for AM and PM. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the wheels keep plain digits and AM and PM. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
478
478
|
"required": false,
|
|
479
479
|
"inherited": true,
|
|
480
480
|
"deprecated": false
|
|
@@ -855,7 +855,7 @@
|
|
|
855
855
|
"name": "locale",
|
|
856
856
|
"type": "string",
|
|
857
857
|
"default": null,
|
|
858
|
-
"description": "BCP-47 locale tag for Intl formatting, the digits the wheels write their hours, minutes and seconds in, and the words a 12-hour wheel shows for AM and PM. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the wheels keep plain digits and AM and PM.",
|
|
858
|
+
"description": "BCP-47 locale tag for Intl formatting, the digits the wheels write their hours, minutes and seconds in, and the words a 12-hour wheel shows for AM and PM. Unset, it is the `locale` of a `LocaleProvider` around the picker, and with neither, `Intl` uses the runtime's own locale and the wheels keep plain digits and AM and PM. A `LocaleProvider` drops a tag `Intl` refuses, such as `\"en_US\"`, with a development warning, but this `locale` isn't checked, and formatting with such a tag can throw `Intl`'s `RangeError`. Write tags with a hyphen, `\"en-US\"`.",
|
|
859
859
|
"required": false,
|
|
860
860
|
"inherited": false,
|
|
861
861
|
"deprecated": false
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"summary": "The helper tuples enumerate the core accepted values for the shared Bulma helper props — public API for building prop types and validation.",
|
|
12
12
|
"import": "import {\n validColors,\n validSizes,\n validViewports,\n} from '@allxsmith/bestax-bulma';",
|
|
13
13
|
"api": null,
|
|
14
|
-
"doc": "# Valid value constants\n\n## Overview\n\nThe helper tuples enumerate the core accepted values for the shared Bulma helper props — public API for building prop types and validation. Each is a readonly `as const` tuple, so `(typeof validColors)[number]` gives you the exact string-literal union. `useBulmaClasses` (and the per-concern hooks) silently ignore unrecognized values. A few props accept documented extras beyond their tuple, noted in the table below: the `display*` props also take `'none'` (rendering the `is-hidden*` visibility class), the color props also take `'inherit'` and `'current'`, and the gap props also take each step as a number — so validate against the prop's TypeScript union, not the tuple alone, when you need the full contract.\n\nSome components also export a tuple for their own props. Those are not helper tuples, and they follow the [Constants](https://bestax.io/docs/api/helpers/valid-values#constants) table in sections of their own.\n\n---\n\n## Import\n\n```tsx\nimport {\n validColors,\n validSizes,\n validViewports,\n} from '@allxsmith/bestax-bulma';\n```\n\nEvery constant on this page is importable the same way.\n\n### Without loading the library\n\nTooling that only needs the helper tuples can take them from the `./constants`\nsubpath, which serves the value module on its own, with no React and no\ncomponent code:\n\n```ts\nimport { validColors } from '@allxsmith/bestax-bulma/constants';\n```\n\nIt resolves from both ESM and CommonJS. This is how\n[`@allxsmith/eslint-plugin-bestax`](https://bestax.io/docs/guides/getting-started/eslint-plugin)\nvalidates helper values at lint time rather than keeping a copy of them. The\n[form control constants](https://bestax.io/docs/api/helpers/valid-values#form-control-constants) and the\n[table color constant](https://bestax.io/docs/api/helpers/valid-values#table-color-constant) are not on this subpath.\n\n---\n\n## Constants\n\n| Constant | Values | Used by prop family |\n| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `validColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'`, the greys, and `'black'`, `'white'`, `'light'`, `'dark'`, each of `black`/`white` also in a `-bis` and `-ter` shade | `color`, `backgroundColor` helper props. Component `color` modifier unions are narrower and component-specific; some `validColors` members ship no `is-<color>` CSS (deprecated, warned in dev). See each component's Props table. Scheme-aware components extend their `bgColor` unions with `validSchemeColors` (below). |\n| `validColorShades` | `'00'`, `'05'` … `'95'`, `'invert'`, `'light'`, `'dark'`, `'soft'`, `'bold'`, `'on-scheme'` | `colorShade`, `backgroundColorShade` |\n| `validSchemeColors` | `'scheme-main'`, `'scheme-main-bis'`, `'scheme-main-ter'`, `'scheme-invert'`, `'scheme-invert-bis'`, `'scheme-invert-ter'` | Scheme-aware `bgColor`/`backgroundColor` values. Emit no class — components render them as a dark-mode-safe inline `background-color: var(--bulma-<value>)` style (Bulma ships no `has-background-scheme-*` helpers). |\n| `validSizes` | `'0'`–`'6'`, `'auto'` | Spacing: `m`, `mt`, `mr`, `mb`, `ml`, `mx`, `my`, `p`, `pt`, … `px`, `py` |\n| `validGaps` | `'0'`, `'0.5'`, `'1'`, `'1.5'`, `'2'`, `'2.5'`, `'3'`, `'3.5'`, `'4'`, `'4.5'`, `'5'`, `'5.5'`, `'6'`, `'6.5'`, `'7'`, `'7.5'`, `'8'` | `gap`, `columnGap`, `rowGap` (`is-gap-<value>`, `is-column-gap-<value>`, `is-row-gap-<value>`), which also take each step as a number. Each whole step is 0.5rem, a different scale from `validSizes`. |\n| `validTextSizes` | `'1'`–`'7'` | `textSize` (+ `textSizeMobile` … `textSizeFullhd`) |\n| `validAlignments` | `'centered'`, `'justified'`, `'left'`, `'right'` | `textAlign` (+ viewport variants) |\n| `validTextTransforms` | `'capitalized'`, `'lowercase'`, `'uppercase'`, `'italic'` | `textTransform` |\n| `validTextWeights` | `'light'`, `'normal'`, `'medium'`, `'semibold'`, `'bold'` | `textWeight` |\n| `validFontFamilies` | `'sans-serif'`, `'monospace'`, `'primary'`, `'secondary'`, `'code'` | `fontFamily` |\n| `validDisplays` | `'block'`, `'flex'`, `'inline'`, `'inline-block'`, `'inline-flex'`, `'grid'` — the `display*` props additionally accept `'none'` | `display` (+ `displayMobile` … `displayFullhd`) |\n| `validVisibilities` | `'hidden'`, `'sr-only'`, `'invisible'` | `visibility` (+ viewport variants) |\n| `validFlexDirections` | `'row'`, `'row-reverse'`, `'column'`, `'column-reverse'` | `flexDirection` |\n| `validFlexWraps` | `'nowrap'`, `'wrap'`, `'wrap-reverse'` | `flexWrap` |\n| `validJustifyContents` | `'flex-start'`, `'flex-end'`, `'center'`, `'space-between'`, `'space-around'`, `'space-evenly'`, `'start'`, `'end'`, `'left'`, `'right'` | `justifyContent` |\n| `validAlignContents` | `'flex-start'`, `'flex-end'`, `'center'`, `'space-between'`, `'space-around'`, `'space-evenly'`, `'stretch'` | `alignContent` |\n| `validAlignItems` | `'stretch'`, `'flex-start'`, `'flex-end'`, `'center'`, `'baseline'`, `'start'`, `'end'` | `alignItems` |\n| `validAlignSelfs` | `'auto'`, `'flex-start'`, `'flex-end'`, `'center'`, `'baseline'`, `'stretch'` | `alignSelf` |\n| `validFlexGrowShrink` | `'0'`–`'5'` | `flexGrow`, `flexShrink` |\n| `validViewports` | `'mobile'`, `'tablet'`, `'tablet-only'`, `'touch'`, `'desktop'`, `'desktop-only'`, `'widescreen'`, `'widescreen-only'`, `'fullhd'` | `viewport` (responsive modifier) |\n| `validFloats` | `'left'`, `'right'` | `float` |\n| `validOverflows` | `'clipped'`, `'auto'`, `'clip'`, `'hidden'`, `'scroll'`, `'visible'` | `overflow`. `clipped` renders `is-clipped`; the rest render `is-overflow-<value>`. |\n| `validAxisOverflows` | `'auto'`, `'clip'`, `'hidden'`, `'scroll'`, `'visible'` | `overflowX`, `overflowY` (`is-overflow-x-<value>`, `is-overflow-y-<value>`) |\n| `validInteractions` | `'unselectable'`, `'clickable'` | `interaction` |\n| `validCursors` | `'pointer'`, `'help'` | `cursor`. These share no class stem: `pointer` renders `is-clickable` and `help` renders `is-cursor-help`. |\n| `validRadii` | `'radiusless'`, `'small'`, `'normal'`, `'large'`, `'rounded'` | `radius`. `radiusless` removes the radius (`is-radiusless`); the sizes set one (`has-radius-<value>`). |\n| `validShadows` | `'shadowless'` | `shadow`. It removes the shadow, so `<Box shadow />` renders nothing. |\n| `validResponsives` | `'mobile'`, `'narrow'` | `responsive`. A different axis from `validViewports`: these are the Bulma column and table modifiers. |\n| `validPositions` | `'absolute'`, `'fixed'`, `'relative'`, `'static'`, `'sticky'` | `pos` (`is-position-<value>`) |\n| `validAspectRatios` | `'1by1'`, `'5by4'`, `'4by3'`, `'3by2'`, `'5by3'`, `'16by9'`, `'2by1'`, `'3by1'`, `'4by5'`, `'3by4'`, `'2by3'`, `'3by5'`, `'9by16'`, `'1by2'`, `'1by3'` | `aspectRatio` (`is-aspect-ratio-<value>`) |\n\n---\n\n## Form control constants\n\n`Checkbox`, `Radio` and `Switch` each export the values their own `color` and `size` props accept, as `as const` tuples like the ones above, and each prop's type is built from its tuple. They are not the helper tuples under another name: the colors are a subset of `validColors`, and the sizes are element sizes, not the spacing scale in `validSizes`. Each component checks membership at runtime too, so a value outside its tuple adds no modifier class.\n\n| Constant | Values | Used by prop family |\n| ---------------- | --------------------------------------------------------------------- | ------------------------------------------------------- |\n| `checkboxColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'` | [`Checkbox`](https://bestax.io/docs/api/form/checkbox) `color` |\n| `checkboxSizes` | `'small'`, `'normal'`, `'medium'`, `'large'` | [`Checkbox`](https://bestax.io/docs/api/form/checkbox) `size` |\n| `radioColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'` | [`Radio`](https://bestax.io/docs/api/form/radio) `color` |\n| `radioSizes` | `'small'`, `'normal'`, `'medium'`, `'large'` | [`Radio`](https://bestax.io/docs/api/form/radio) `size` |\n| `switchColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'` | [`Switch`](https://bestax.io/docs/api/form/switch) `color` and `passiveType` |\n| `switchSizes` | `'small'`, `'normal'`, `'medium'`, `'large'` | [`Switch`](https://bestax.io/docs/api/form/switch) `size` |\n\nImport them from the package root. The `./constants` subpath serves the helper module only, so tooling that reads these loads the main entry:\n\n```ts\nimport { switchColors, switchSizes } from '@allxsmith/bestax-bulma';\n\ntype SwitchColor = (typeof switchColors)[number];\ntype SwitchSize = (typeof switchSizes)[number];\n```\n\n---\n\n## Table color constant\n\n`Tr`, `Th` and `Td` share one `color` tuple, `validTableColors`, and the `TableColor` type their `color` prop takes is built from it. Like the form control colors, it is a subset of `validColors`, and each component checks membership at runtime, so a value outside the tuple adds no modifier class.\n\n| Constant | Values | Used by prop family |\n| ------------------ | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| `validTableColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'`, `'black'`, `'dark'`, `'light'`, `'white'` | [`Tr`, `Th` and `Td`](https://bestax.io/docs/api/elements/table) `color` |\n\nImport it from the package root. `TableColor` is exported there too, so a runtime check can narrow to it:\n\n```ts\nimport { validTableColors, type TableColor } from '@allxsmith/bestax-bulma';\n\nfunction isTableColor(value: string): value is TableColor {\n return (validTableColors as readonly string[]).includes(value);\n}\n```\n\n---\n\n## Typing with `(typeof …)[number]`\n\nBecause the arrays are `as const`, indexing them with `number` yields the union of their literal values — the same idiom the library uses internally for its prop types:\n\n```ts\nimport { validColors, validSizes } from '@allxsmith/bestax-bulma';\n\ntype Color = (typeof validColors)[number]; // 'primary' | 'link' | … | 'dark'\ntype Spacing = (typeof validSizes)[number]; // '0' | '1' | … | '6' | 'auto'\n\ninterface MyComponentProps {\n color?: Color;\n m?: Spacing;\n}\n```\n\nThey also work as runtime validators:\n\n```ts\nfunction isColor(value: string): value is (typeof validColors)[number] {\n return (validColors as readonly string[]).includes(value);\n}\n```\n\n:::warning `validSizes` is for spacing, not element sizes\n\n`validSizes` (`'0'`–`'6'` | `'auto'`) enumerates the **spacing helper** scale — the values for `m`/`p` props like `m=\"4\"` (→ `m-4`). Element `size` props are a different axis: `Button`, `Icon`, and friends declare an inline union such as `'small' | 'medium' | 'large'` (Button adds `'normal'`), **not** `validSizes`. Don't use `validSizes` to type a component's `size` prop.\n\n:::\n\n---\n\n## See Also\n\n- [`useBulmaClasses`](https://bestax.io/docs/api/helpers/usebulmaclasses): The hook that consumes these values and generates the helper classes.\n- [Helper guides](https://bestax.io/docs/guides/helpers/color): Task-oriented walkthroughs of the helper-prop system (color, spacing, typography, flex, visibility).",
|
|
14
|
+
"doc": "# Valid value constants\n\n## Overview\n\nThe helper tuples enumerate the core accepted values for the shared Bulma helper props — public API for building prop types and validation. Each is a readonly `as const` tuple, so `(typeof validColors)[number]` gives you the exact string-literal union. `useBulmaClasses` (and the per-concern hooks) silently ignore unrecognized values. A few props accept documented extras beyond their tuple, noted in the table below: the `display*` props also take `'none'` (rendering the `is-hidden*` visibility class), the color props also take `'inherit'` and `'current'`, and the gap props also take each step as a number — so validate against the prop's TypeScript union, not the tuple alone, when you need the full contract.\n\nSome components also export a tuple for their own props. Those are not helper tuples, and they follow the [Constants](https://bestax.io/docs/api/helpers/valid-values#constants) table in sections of their own.\n\n---\n\n## Import\n\n```tsx\nimport {\n validColors,\n validSizes,\n validViewports,\n} from '@allxsmith/bestax-bulma';\n```\n\nEvery constant on this page is importable the same way.\n\n### Without loading the library\n\nTooling that only needs the helper tuples can take them from the `./constants`\nsubpath, which serves the value module on its own, with no React and no\ncomponent code:\n\n```ts\nimport { validColors } from '@allxsmith/bestax-bulma/constants';\n```\n\nIt resolves from both ESM and CommonJS. This is how\n[`@allxsmith/eslint-plugin-bestax`](https://bestax.io/docs/guides/getting-started/eslint-plugin)\nvalidates helper values at lint time rather than keeping a copy of them. The\n[form control constants](https://bestax.io/docs/api/helpers/valid-values#form-control-constants) and the\n[table color constant](https://bestax.io/docs/api/helpers/valid-values#table-color-constant) are not on this subpath.\n\n---\n\n## Constants\n\n| Constant | Values | Used by prop family |\n| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `validColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'`, the greys, and `'black'`, `'white'`, `'light'`, `'dark'`, each of `black`/`white` also in a `-bis` and `-ter` shade | `color`, `backgroundColor` helper props. Component `color` modifier unions are narrower and component-specific; some `validColors` members ship no `is-<color>` CSS (deprecated, warned in dev). See each component's Props table. Scheme-aware components extend their `bgColor` unions with `validSchemeColors` (below). |\n| `validColorShades` | `'00'`, `'05'` … `'95'`, `'invert'`, `'light'`, `'dark'`, `'soft'`, `'bold'`, `'on-scheme'` | `colorShade`, `backgroundColorShade` |\n| `validSchemeColors` | `'scheme-main'`, `'scheme-main-bis'`, `'scheme-main-ter'`, `'scheme-invert'`, `'scheme-invert-bis'`, `'scheme-invert-ter'` | Scheme-aware `bgColor`/`backgroundColor` values. Emit no class — components render them as a dark-mode-safe inline `background-color: var(--bulma-<value>)` style (Bulma ships no `has-background-scheme-*` helpers). |\n| `validSizes` | `'0'`–`'6'`, `'auto'` | Spacing: `m`, `mt`, `mr`, `mb`, `ml`, `mx`, `my`, `p`, `pt`, … `px`, `py` |\n| `validGaps` | `'0'`, `'0.5'`, `'1'`, `'1.5'`, `'2'`, `'2.5'`, `'3'`, `'3.5'`, `'4'`, `'4.5'`, `'5'`, `'5.5'`, `'6'`, `'6.5'`, `'7'`, `'7.5'`, `'8'` | `gap`, `columnGap`, `rowGap` (`is-gap-<value>`, `is-column-gap-<value>`, `is-row-gap-<value>`), which also take each step as a number. Each whole step is 0.5rem, a different scale from `validSizes`. |\n| `validTextSizes` | `'1'`–`'7'` | `textSize` (+ `textSizeMobile` … `textSizeFullhd`) |\n| `validAlignments` | `'centered'`, `'justified'`, `'left'`, `'right'` | `textAlign` (+ viewport variants) |\n| `validTextTransforms` | `'capitalized'`, `'lowercase'`, `'uppercase'`, `'italic'`, `'underlined'` | `textTransform` |\n| `validTextWeights` | `'light'`, `'normal'`, `'medium'`, `'semibold'`, `'bold'` | `textWeight` |\n| `validFontFamilies` | `'sans-serif'`, `'monospace'`, `'primary'`, `'secondary'`, `'code'` | `fontFamily` |\n| `validDisplays` | `'block'`, `'flex'`, `'inline'`, `'inline-block'`, `'inline-flex'`, `'grid'` — the `display*` props additionally accept `'none'` | `display` (+ `displayMobile` … `displayFullhd`) |\n| `validVisibilities` | `'hidden'`, `'sr-only'`, `'invisible'` | `visibility` (+ viewport variants) |\n| `validFlexDirections` | `'row'`, `'row-reverse'`, `'column'`, `'column-reverse'` | `flexDirection` |\n| `validFlexWraps` | `'nowrap'`, `'wrap'`, `'wrap-reverse'` | `flexWrap` |\n| `validJustifyContents` | `'flex-start'`, `'flex-end'`, `'center'`, `'space-between'`, `'space-around'`, `'space-evenly'`, `'start'`, `'end'`, `'left'`, `'right'` | `justifyContent` |\n| `validAlignContents` | `'flex-start'`, `'flex-end'`, `'center'`, `'space-between'`, `'space-around'`, `'space-evenly'`, `'stretch'` | `alignContent` |\n| `validAlignItems` | `'stretch'`, `'flex-start'`, `'flex-end'`, `'center'`, `'baseline'`, `'start'`, `'end'` | `alignItems` |\n| `validAlignSelfs` | `'auto'`, `'flex-start'`, `'flex-end'`, `'center'`, `'baseline'`, `'stretch'` | `alignSelf` |\n| `validFlexGrowShrink` | `'0'`–`'5'` | `flexGrow`, `flexShrink` |\n| `validViewports` | `'mobile'`, `'tablet'`, `'tablet-only'`, `'touch'`, `'desktop'`, `'desktop-only'`, `'widescreen'`, `'widescreen-only'`, `'fullhd'` | `viewport` (responsive modifier) |\n| `validFloats` | `'left'`, `'right'` | `float` |\n| `validOverflows` | `'clipped'`, `'auto'`, `'clip'`, `'hidden'`, `'scroll'`, `'visible'` | `overflow`. `clipped` renders `is-clipped`; the rest render `is-overflow-<value>`. |\n| `validAxisOverflows` | `'auto'`, `'clip'`, `'hidden'`, `'scroll'`, `'visible'` | `overflowX`, `overflowY` (`is-overflow-x-<value>`, `is-overflow-y-<value>`) |\n| `validInteractions` | `'unselectable'`, `'clickable'` | `interaction` |\n| `validCursors` | `'pointer'`, `'help'` | `cursor`. These share no class stem: `pointer` renders `is-clickable` and `help` renders `is-cursor-help`. |\n| `validRadii` | `'radiusless'`, `'small'`, `'normal'`, `'large'`, `'rounded'` | `radius`. `radiusless` removes the radius (`is-radiusless`); the sizes set one (`has-radius-<value>`). |\n| `validShadows` | `'shadowless'` | `shadow`. It removes the shadow, so `<Box shadow />` renders nothing. |\n| `validResponsives` | `'mobile'`, `'narrow'` | `responsive`. A different axis from `validViewports`: these are the Bulma column and table modifiers. |\n| `validPositions` | `'absolute'`, `'fixed'`, `'relative'`, `'static'`, `'sticky'` | `pos` (`is-position-<value>`) |\n| `validAspectRatios` | `'1by1'`, `'5by4'`, `'4by3'`, `'3by2'`, `'5by3'`, `'16by9'`, `'2by1'`, `'3by1'`, `'4by5'`, `'3by4'`, `'2by3'`, `'3by5'`, `'9by16'`, `'1by2'`, `'1by3'` | `aspectRatio` (`is-aspect-ratio-<value>`) |\n\n---\n\n## Form control constants\n\n`Checkbox`, `Radio` and `Switch` each export the values their own `color` and `size` props accept, as `as const` tuples like the ones above, and each prop's type is built from its tuple. They are not the helper tuples under another name: the colors are a subset of `validColors`, and the sizes are element sizes, not the spacing scale in `validSizes`. Each component checks membership at runtime too, so a value outside its tuple adds no modifier class.\n\n| Constant | Values | Used by prop family |\n| ---------------- | --------------------------------------------------------------------- | ------------------------------------------------------- |\n| `checkboxColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'` | [`Checkbox`](https://bestax.io/docs/api/form/checkbox) `color` |\n| `checkboxSizes` | `'small'`, `'normal'`, `'medium'`, `'large'` | [`Checkbox`](https://bestax.io/docs/api/form/checkbox) `size` |\n| `radioColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'` | [`Radio`](https://bestax.io/docs/api/form/radio) `color` |\n| `radioSizes` | `'small'`, `'normal'`, `'medium'`, `'large'` | [`Radio`](https://bestax.io/docs/api/form/radio) `size` |\n| `switchColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'` | [`Switch`](https://bestax.io/docs/api/form/switch) `color` and `passiveType` |\n| `switchSizes` | `'small'`, `'normal'`, `'medium'`, `'large'` | [`Switch`](https://bestax.io/docs/api/form/switch) `size` |\n\nImport them from the package root. The `./constants` subpath serves the helper module only, so tooling that reads these loads the main entry:\n\n```ts\nimport { switchColors, switchSizes } from '@allxsmith/bestax-bulma';\n\ntype SwitchColor = (typeof switchColors)[number];\ntype SwitchSize = (typeof switchSizes)[number];\n```\n\n---\n\n## Table color constant\n\n`Tr`, `Th` and `Td` share one `color` tuple, `validTableColors`, and the `TableColor` type their `color` prop takes is built from it. Like the form control colors, it is a subset of `validColors`, and each component checks membership at runtime, so a value outside the tuple adds no modifier class.\n\n| Constant | Values | Used by prop family |\n| ------------------ | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| `validTableColors` | `'primary'`, `'link'`, `'info'`, `'success'`, `'warning'`, `'danger'`, `'black'`, `'dark'`, `'light'`, `'white'` | [`Tr`, `Th` and `Td`](https://bestax.io/docs/api/elements/table) `color` |\n\nImport it from the package root. `TableColor` is exported there too, so a runtime check can narrow to it:\n\n```ts\nimport { validTableColors, type TableColor } from '@allxsmith/bestax-bulma';\n\nfunction isTableColor(value: string): value is TableColor {\n return (validTableColors as readonly string[]).includes(value);\n}\n```\n\n---\n\n## Typing with `(typeof …)[number]`\n\nBecause the arrays are `as const`, indexing them with `number` yields the union of their literal values — the same idiom the library uses internally for its prop types:\n\n```ts\nimport { validColors, validSizes } from '@allxsmith/bestax-bulma';\n\ntype Color = (typeof validColors)[number]; // 'primary' | 'link' | … | 'dark'\ntype Spacing = (typeof validSizes)[number]; // '0' | '1' | … | '6' | 'auto'\n\ninterface MyComponentProps {\n color?: Color;\n m?: Spacing;\n}\n```\n\nThey also work as runtime validators:\n\n```ts\nfunction isColor(value: string): value is (typeof validColors)[number] {\n return (validColors as readonly string[]).includes(value);\n}\n```\n\n:::warning `validSizes` is for spacing, not element sizes\n\n`validSizes` (`'0'`–`'6'` | `'auto'`) enumerates the **spacing helper** scale — the values for `m`/`p` props like `m=\"4\"` (→ `m-4`). Element `size` props are a different axis: `Button`, `Icon`, and friends declare an inline union such as `'small' | 'medium' | 'large'` (Button adds `'normal'`), **not** `validSizes`. Don't use `validSizes` to type a component's `size` prop.\n\n:::\n\n---\n\n## See Also\n\n- [`useBulmaClasses`](https://bestax.io/docs/api/helpers/usebulmaclasses): The hook that consumes these values and generates the helper classes.\n- [Helper guides](https://bestax.io/docs/guides/helpers/color): Task-oriented walkthroughs of the helper-prop system (color, spacing, typography, flex, visibility).",
|
|
15
15
|
"parts": [],
|
|
16
16
|
"cssVars": []
|
|
17
17
|
}
|