@microbit/ui 0.1.0 → 0.2.0
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/package.json +3 -3
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microbit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/node": "^26.1.1",
|
|
46
46
|
"@types/react": "^18.3.3",
|
|
47
47
|
"@types/react-dom": "^18.3.0",
|
|
48
|
-
"@vitejs/plugin-react": "^
|
|
48
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
49
49
|
"jsdom": "^29.1.1",
|
|
50
50
|
"react": "^18.3.1",
|
|
51
51
|
"react-aria": "^3.50.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"react-icons": "^4.12.0",
|
|
55
55
|
"react-intl": "^6.6.8",
|
|
56
56
|
"typescript": "^5.4.2",
|
|
57
|
-
"vite": "^
|
|
57
|
+
"vite": "^7.3.6",
|
|
58
58
|
"vitest": "^4.1.10"
|
|
59
59
|
}
|
|
60
60
|
}
|
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: ["*"],
|