Skip to content

Commit 58e17cb

Browse files
Upgrade @microbit/ui to 0.1.0-alpha.6; adopt LinkButton
FirmwareDialog's hand-rolled anchor+button() combo becomes the new LinkButton; the OSS preset's languageText/languageTextHover overrides go (the base default is now brand.500/600 - this app's exact values).
1 parent 255a830 commit 58e17cb

4 files changed

Lines changed: 15 additions & 27 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@codemirror/state": "^6.4.1",
2121
"@codemirror/view": "^6.26.3",
2222
"@microbit/microbit-connection": "^1.0.0",
23-
"@microbit/ui": "0.1.0-alpha.5",
23+
"@microbit/ui": "0.1.0-alpha.6",
2424
"@microbit/microbit-fs": "^0.10.0",
2525
"@sanity/block-content-to-react": "^3.0.0",
2626
"@sanity/image-url": "^1.0.1",

src/deployment/default/panda-preset.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ export const appPreset = definePreset({
9999
sidebarTablistBg: { value: "black" },
100100
sidebarTabSelectedText: { value: "black" },
101101
sidebarTabSelectedBg: { value: "{colors.gray.50}" },
102-
// Button `language` variant text. The base preset defaults these to
103-
// the grey brand2 ramp; python-editor uses the primary brand ramp, so
104-
// the brand divergence flows through the brand ramp values.
105-
languageText: { value: "{colors.brand.500}" },
106-
languageTextHover: { value: "{colors.brand.600}" },
102+
// `languageText`/`languageTextHover`: the base preset defaults are
103+
// brand.500/600 (since 0.1.0-alpha.6) — exactly this app's values,
104+
// so no override; divergence flows through the brand ramp.
107105
},
108106
},
109107
slotRecipes: {

src/workbench/connect-dialogs/FirmwareDialog.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
*
44
* SPDX-License-Identifier: MIT
55
*/
6-
import { Button, Icon, Image, Link, Text } from "@microbit/ui";
6+
import { Button, Icon, Image, Link, LinkButton, Text } from "@microbit/ui";
77
import { ReactNode, useCallback, useState } from "react";
88
import { RiExternalLinkLine } from "react-icons/ri";
99
import { FormattedMessage } from "react-intl";
10-
import { css, cx } from "styled-system/css";
1110
import { HStack, VStack } from "styled-system/jsx";
12-
import { button } from "styled-system/recipes";
1311
import { GenericDialog } from "../../common/GenericDialog";
1412
import firmwareUpgrade from "./firmware-upgrade.svg";
1513
import { FinalFocusRef } from "../../project/project-actions";
@@ -122,25 +120,17 @@ const FirmwareDialogFooter = ({
122120
<Button onPress={onTryAgain} size="lg" css={{ minWidth: buttonWidth }}>
123121
<FormattedMessage id="try-again-action" />
124122
</Button>
125-
{/* An anchor styled as a primary button (Chakra's Button as="a"). No
126-
@microbit/ui link-button primitive yet — flagged for review. */}
127-
<a
128-
className={cx(
129-
button({ variant: "primary", size: "lg" }),
130-
css({
131-
minWidth: buttonWidth,
132-
gap: "2",
133-
textDecoration: "none",
134-
_hover: { textDecoration: "none" },
135-
})
136-
)}
123+
<LinkButton
124+
variant="primary"
125+
size="lg"
126+
css={{ minWidth: buttonWidth }}
137127
target="_blank"
138128
rel="noreferrer"
139129
href="https://microbit.org/get-started/user-guide/firmware/"
130+
rightIcon={<Icon as={RiExternalLinkLine} />}
140131
>
141132
<FormattedMessage id="update-firmware-action" />
142-
<Icon as={RiExternalLinkLine} />
143-
</a>
133+
</LinkButton>
144134
</HStack>
145135
);
146136
};

0 commit comments

Comments
 (0)