@microbit/ui 0.1.1 → 0.2.1
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/lang/ui.ar.json +1 -1
- package/lang/ui.ga-ie.json +9 -9
- package/lang/ui.lol.json +14 -14
- package/package.json +1 -1
- package/src/Breadcrumb.tsx +2 -1
- package/src/Link.recipe.ts +36 -0
- package/src/Link.tsx +5 -14
- package/src/base-preset.ts +3 -0
package/lang/ui.ar.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"description": "Shown in a Select's trigger while nothing is chosen and the app supplies no placeholder"
|
|
37
37
|
},
|
|
38
38
|
"ui.select-row-action": {
|
|
39
|
-
"defaultMessage": "
|
|
39
|
+
"defaultMessage": "حدّد",
|
|
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": {
|
package/lang/ui.ga-ie.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"ui.breadcrumb": {
|
|
3
|
-
"defaultMessage": "
|
|
3
|
+
"defaultMessage": "Grabhróg aráin",
|
|
4
4
|
"description": "Accessible label for the breadcrumb navigation trail (the WAI-ARIA APG's conventional name)"
|
|
5
5
|
},
|
|
6
6
|
"ui.close-action": {
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"description": "Close button text or label"
|
|
9
9
|
},
|
|
10
10
|
"ui.combobox-listbox": {
|
|
11
|
-
"defaultMessage": "
|
|
11
|
+
"defaultMessage": "Moltaí",
|
|
12
12
|
"description": "Accessible label for a ComboBox's dropdown list of suggestions"
|
|
13
13
|
},
|
|
14
14
|
"ui.combobox-trigger": {
|
|
15
|
-
"defaultMessage": "
|
|
15
|
+
"defaultMessage": "Taispeáin moltaí",
|
|
16
16
|
"description": "Accessible label for the button that opens a ComboBox's suggestions dropdown"
|
|
17
17
|
},
|
|
18
18
|
"ui.loading": {
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"description": "Visually hidden suffix on links that open a new tab, announced by screen readers"
|
|
25
25
|
},
|
|
26
26
|
"ui.numberfield-decrease": {
|
|
27
|
-
"defaultMessage": "
|
|
27
|
+
"defaultMessage": "Laghdaigh {fieldLabel}",
|
|
28
28
|
"description": "Accessible label for a number field's decrement stepper; fieldLabel is the field's label and may be empty"
|
|
29
29
|
},
|
|
30
30
|
"ui.numberfield-increase": {
|
|
31
|
-
"defaultMessage": "
|
|
31
|
+
"defaultMessage": "Méadaigh {fieldLabel}",
|
|
32
32
|
"description": "Accessible label for a number field's increment stepper; fieldLabel is the field's label and may be empty"
|
|
33
33
|
},
|
|
34
34
|
"ui.select-placeholder": {
|
|
35
|
-
"defaultMessage": "
|
|
35
|
+
"defaultMessage": "Roghnaigh mír",
|
|
36
36
|
"description": "Shown in a Select's trigger while nothing is chosen and the app supplies no placeholder"
|
|
37
37
|
},
|
|
38
38
|
"ui.select-row-action": {
|
|
@@ -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 {#
|
|
43
|
+
"defaultMessage": "{count, plural, one {# fógra} two {# fhógra} few {# fógraí} many {# notifications} 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": {
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"description": "Announced by screen readers before an error notification"
|
|
49
49
|
},
|
|
50
50
|
"ui.toast-status-info": {
|
|
51
|
-
"defaultMessage": "
|
|
51
|
+
"defaultMessage": "Eolas",
|
|
52
52
|
"description": "Announced by screen readers before an informational notification"
|
|
53
53
|
},
|
|
54
54
|
"ui.toast-status-success": {
|
|
55
|
-
"defaultMessage": "
|
|
55
|
+
"defaultMessage": "Rath",
|
|
56
56
|
"description": "Announced by screen readers before a success notification"
|
|
57
57
|
},
|
|
58
58
|
"ui.toast-status-warning": {
|
package/lang/ui.lol.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"ui.breadcrumb": {
|
|
3
|
-
"defaultMessage": "
|
|
3
|
+
"defaultMessage": "crwdns370036:0crwdne370036:0",
|
|
4
4
|
"description": "Accessible label for the breadcrumb navigation trail (the WAI-ARIA APG's conventional name)"
|
|
5
5
|
},
|
|
6
6
|
"ui.close-action": {
|
|
7
|
-
"defaultMessage": "
|
|
7
|
+
"defaultMessage": "crwdns370038:0crwdne370038:0",
|
|
8
8
|
"description": "Close button text or label"
|
|
9
9
|
},
|
|
10
10
|
"ui.combobox-listbox": {
|
|
11
|
-
"defaultMessage": "
|
|
11
|
+
"defaultMessage": "crwdns370040:0crwdne370040:0",
|
|
12
12
|
"description": "Accessible label for a ComboBox's dropdown list of suggestions"
|
|
13
13
|
},
|
|
14
14
|
"ui.combobox-trigger": {
|
|
15
|
-
"defaultMessage": "
|
|
15
|
+
"defaultMessage": "crwdns370042:0crwdne370042:0",
|
|
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": "crwdns370044:0crwdne370044:0",
|
|
20
20
|
"description": "Announced by screen readers for a button showing a loading spinner"
|
|
21
21
|
},
|
|
22
22
|
"ui.new-tab-notice": {
|
|
@@ -24,39 +24,39 @@
|
|
|
24
24
|
"description": "Visually hidden suffix on links that open a new tab, announced by screen readers"
|
|
25
25
|
},
|
|
26
26
|
"ui.numberfield-decrease": {
|
|
27
|
-
"defaultMessage": "
|
|
27
|
+
"defaultMessage": "crwdns370046:0{fieldLabel}crwdne370046:0",
|
|
28
28
|
"description": "Accessible label for a number field's decrement stepper; fieldLabel is the field's label and may be empty"
|
|
29
29
|
},
|
|
30
30
|
"ui.numberfield-increase": {
|
|
31
|
-
"defaultMessage": "
|
|
31
|
+
"defaultMessage": "crwdns370048:0{fieldLabel}crwdne370048:0",
|
|
32
32
|
"description": "Accessible label for a number field's increment stepper; fieldLabel is the field's label and may be empty"
|
|
33
33
|
},
|
|
34
34
|
"ui.select-placeholder": {
|
|
35
|
-
"defaultMessage": "
|
|
35
|
+
"defaultMessage": "crwdns370050:0crwdne370050:0",
|
|
36
36
|
"description": "Shown in a Select's trigger while nothing is chosen and the app supplies no placeholder"
|
|
37
37
|
},
|
|
38
38
|
"ui.select-row-action": {
|
|
39
|
-
"defaultMessage": "
|
|
39
|
+
"defaultMessage": "crwdns370052:0crwdne370052:0",
|
|
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
|
|
43
|
+
"defaultMessage": "crwdns370054:0count={count}crwdne370054:0",
|
|
44
44
|
"description": "Accessible label for the notifications area; count is the number of notifications showing"
|
|
45
45
|
},
|
|
46
46
|
"ui.toast-status-error": {
|
|
47
|
-
"defaultMessage": "
|
|
47
|
+
"defaultMessage": "crwdns370056:0crwdne370056:0",
|
|
48
48
|
"description": "Announced by screen readers before an error notification"
|
|
49
49
|
},
|
|
50
50
|
"ui.toast-status-info": {
|
|
51
|
-
"defaultMessage": "
|
|
51
|
+
"defaultMessage": "crwdns370058:0crwdne370058:0",
|
|
52
52
|
"description": "Announced by screen readers before an informational notification"
|
|
53
53
|
},
|
|
54
54
|
"ui.toast-status-success": {
|
|
55
|
-
"defaultMessage": "
|
|
55
|
+
"defaultMessage": "crwdns370060:0crwdne370060:0",
|
|
56
56
|
"description": "Announced by screen readers before a success notification"
|
|
57
57
|
},
|
|
58
58
|
"ui.toast-status-warning": {
|
|
59
|
-
"defaultMessage": "
|
|
59
|
+
"defaultMessage": "crwdns370062:0crwdne370062:0",
|
|
60
60
|
"description": "Announced by screen readers before a warning notification"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microbit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|
package/src/Breadcrumb.tsx
CHANGED
|
@@ -110,5 +110,6 @@ export const BreadcrumbLink = (props: BreadcrumbLinkProps) => {
|
|
|
110
110
|
</CurrentPageText>
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
// The trail is navigation, so the prose underline stays off by default.
|
|
114
|
+
return <Link variant="standalone" {...props} />;
|
|
114
115
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (c) 2026, Micro:bit Educational Foundation and contributors
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Link recipe — underlined by default: a link in prose must be marked by
|
|
10
|
+
* more than colour (WCAG 1.4.1). `standalone` drops the underline until
|
|
11
|
+
* hover, for links whose context already shows they are links (navigation,
|
|
12
|
+
* menus, cards, icon links).
|
|
13
|
+
*
|
|
14
|
+
* Registered in the base preset (base-preset.ts).
|
|
15
|
+
*/
|
|
16
|
+
export const link = defineRecipe({
|
|
17
|
+
className: "link",
|
|
18
|
+
jsx: ["Link"],
|
|
19
|
+
base: {
|
|
20
|
+
cursor: "pointer",
|
|
21
|
+
textDecoration: "underline",
|
|
22
|
+
outline: "none",
|
|
23
|
+
transitionProperty:
|
|
24
|
+
"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",
|
|
25
|
+
transitionDuration: "normal",
|
|
26
|
+
_focusVisible: { focusRing: "outline" },
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
standalone: {
|
|
31
|
+
textDecoration: "none",
|
|
32
|
+
_hover: { textDecoration: "underline" },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
package/src/Link.tsx
CHANGED
|
@@ -4,20 +4,11 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
6
|
import { styled } from "styled-system/jsx";
|
|
7
|
+
import { link } from "styled-system/recipes";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Link — a styled anchor
|
|
10
|
-
*
|
|
10
|
+
* Link — a styled anchor, underlined by default (see Link.recipe.ts).
|
|
11
|
+
* Pass `variant="standalone"` for links whose context already shows they
|
|
12
|
+
* are links. Accepts Panda style props for colour etc.
|
|
11
13
|
*/
|
|
12
|
-
export const Link = styled("a",
|
|
13
|
-
base: {
|
|
14
|
-
cursor: "pointer",
|
|
15
|
-
textDecoration: "none",
|
|
16
|
-
outline: "none",
|
|
17
|
-
transitionProperty:
|
|
18
|
-
"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",
|
|
19
|
-
transitionDuration: "normal",
|
|
20
|
-
_hover: { textDecoration: "underline" },
|
|
21
|
-
_focusVisible: { focusRing: "outline" },
|
|
22
|
-
},
|
|
23
|
-
});
|
|
14
|
+
export const Link = styled("a", link);
|
package/src/base-preset.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { drawer } from "./Drawer.recipe";
|
|
|
33
33
|
import { gridList } from "./GridList.recipe";
|
|
34
34
|
import { heading } from "./Heading.recipe";
|
|
35
35
|
import { input } from "./Input.recipe";
|
|
36
|
+
import { link } from "./Link.recipe";
|
|
36
37
|
import { listBox } from "./ListBox.recipe";
|
|
37
38
|
import { numberField } from "./NumberField.recipe";
|
|
38
39
|
import { menu } from "./Menu.recipe";
|
|
@@ -295,6 +296,7 @@ export const basePreset = definePreset({
|
|
|
295
296
|
button,
|
|
296
297
|
heading,
|
|
297
298
|
input,
|
|
299
|
+
link,
|
|
298
300
|
text,
|
|
299
301
|
tooltip,
|
|
300
302
|
},
|
|
@@ -439,6 +441,7 @@ export const basePreset = definePreset({
|
|
|
439
441
|
drawer: ["*"],
|
|
440
442
|
field: ["*"],
|
|
441
443
|
gridList: ["*"],
|
|
444
|
+
link: ["*"],
|
|
442
445
|
listBox: ["*"],
|
|
443
446
|
input: ["*"],
|
|
444
447
|
numberField: ["*"],
|