@microbit/ui 0.3.0 → 0.3.2

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.
@@ -40,7 +40,7 @@
40
40
  "description": "Accessible label for a row-selection checkbox in a list or table; screen readers read it together with the row's content"
41
41
  },
42
42
  "ui.toast-region": {
43
- "defaultMessage": "{count, plural, one {# fógra} two {# fhógra} few {# fógraí} many {# notifications} other {# fógraí}}.",
43
+ "defaultMessage": "{count, plural, one {# fógra} two {# fhógra} few {# fógraí} many {# fógraí} other {# fógraí}}",
44
44
  "description": "Accessible label for the notifications area; count is the number of notifications showing"
45
45
  },
46
46
  "ui.toast-status-error": {
package/lang/ui.ja.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "description": "Accessible label for the button that opens a ComboBox's suggestions dropdown"
17
17
  },
18
18
  "ui.loading": {
19
- "defaultMessage": "読み込み中",
19
+ "defaultMessage": "ロード中",
20
20
  "description": "Announced by screen readers for a button showing a loading spinner"
21
21
  },
22
22
  "ui.new-tab-notice": {
package/lang/ui.nl.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "ui.breadcrumb": {
3
- "defaultMessage": "Kruimelpad",
3
+ "defaultMessage": "Kruimelspoor",
4
4
  "description": "Accessible label for the breadcrumb navigation trail (the WAI-ARIA APG's conventional name)"
5
5
  },
6
6
  "ui.close-action": {
@@ -52,7 +52,7 @@
52
52
  "description": "Announced by screen readers before an informational notification"
53
53
  },
54
54
  "ui.toast-status-success": {
55
- "defaultMessage": "Succes",
55
+ "defaultMessage": "Succesvol",
56
56
  "description": "Announced by screen readers before a success notification"
57
57
  },
58
58
  "ui.toast-status-warning": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microbit/ui",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "micro:bit design-system primitives: react-aria-components + Panda CSS with a design language ported from Chakra UI v2. Ships as source; see README for the consumption setup.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,11 +49,11 @@ export const input = defineRecipe({
49
49
  "&&&:is([data-invalid], :user-invalid)": {
50
50
  borderColor: "danger.500",
51
51
  },
52
- // Modality-tracked: RAC's attribute, or Input.tsx's. Native
52
+ // Modality-tracked: RAC's attribute, or Input/NativeSelect's. Native
53
53
  // :focus-visible is the fallback for a bare element wearing the recipe,
54
- // but not text-entry ones — browsers match it there on a pointer click,
55
- // which is what the tracking exists to exclude.
56
- "&&&:is([data-focus-visible], :focus-visible:not([data-rac], input, textarea))":
54
+ // but not form controls — browsers match it there on a pointer click
55
+ // (Chrome includes select), which is what the tracking exists to exclude.
56
+ "&&&:is([data-focus-visible], :focus-visible:not([data-rac], input, textarea, select))":
57
57
  {
58
58
  focusRing: "outline",
59
59
  },
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
6
  import { forwardRef, SelectHTMLAttributes } from "react";
7
+ import { mergeProps, useFocusRing } from "react-aria";
7
8
  import { css, cx } from "styled-system/css";
8
9
  import { input, InputVariantProps } from "styled-system/recipes";
9
10
  import { SystemStyleObject } from "styled-system/types";
@@ -40,9 +41,14 @@ export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
40
41
  { hideChevron = false, size, css: cssProp, wrapperCss, className, ...rest },
41
42
  ref,
42
43
  ) {
44
+ // Modality tracked here rather than via the recipe's native
45
+ // :focus-visible fallback: Chrome matches that on a clicked select (as it
46
+ // does on text inputs), and this ring is keyboard-only.
47
+ const { isFocusVisible, focusProps } = useFocusRing();
43
48
  const select = (
44
49
  <select
45
50
  ref={ref}
51
+ data-focus-visible={isFocusVisible || undefined}
46
52
  className={cx(
47
53
  input({ size }),
48
54
  css(
@@ -59,7 +65,7 @@ export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
59
65
  ),
60
66
  className,
61
67
  )}
62
- {...rest}
68
+ {...mergeProps(rest, focusProps)}
63
69
  />
64
70
  );
65
71
  if (hideChevron) {