Skip to content

Commit ad067cc

Browse files
Upgrade to @microbit/ui@0.1.0-alpha.31 (#1268)
Also @microbit/ui-patterns@0.1.0-alpha.4. alpha.31 renames the props whose names said left/right while meaning reading order: `leftIcon`/`rightIcon` are `startIcon`/`endIcon`, and `InputLeftElement`/`InputRightElement` are `InputStartElement`/`InputEndElement`. CollapsibleButton's `Omit` follows. Mechanical, and no change in an LTR build. The search field's leading padding follows its InputGroup element to logical: that element moved to `insetStart` in alpha.31, so `pl` would sit opposite it the moment a locale is RTL.
1 parent 8397f79 commit ad067cc

12 files changed

Lines changed: 31 additions & 31 deletions

File tree

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"@codemirror/view": "^6.26.3",
2222
"@microbit/microbit-connection": "^1.0.0",
2323
"@microbit/microbit-fs": "^0.10.0",
24-
"@microbit/ui": "0.1.0-alpha.30",
25-
"@microbit/ui-patterns": "0.1.0-alpha.3",
24+
"@microbit/ui": "^0.1.0-alpha.31",
25+
"@microbit/ui-patterns": "^0.1.0-alpha.4",
2626
"@sanity/block-content-to-react": "^3.0.0",
2727
"@sanity/image-url": "^1.0.1",
2828
"@testing-library/jest-dom": "^5.14.1",

src/common/CollapsibleButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React, { ForwardedRef } from "react";
88
import { SystemStyleObject } from "styled-system/types";
99

1010
export interface CollapsibleButtonProps
11-
extends Omit<ButtonProps, "children" | "leftIcon" | "rightIcon"> {
11+
extends Omit<ButtonProps, "children" | "startIcon" | "endIcon"> {
1212
mode: "icon" | "button";
1313
text: string;
1414
icon: React.ReactElement;
@@ -55,8 +55,8 @@ const CollapsibleButton = React.forwardRef(
5555
) : (
5656
<Button
5757
ref={ref}
58-
leftIcon={icon && !iconRight ? icon : undefined}
59-
rightIcon={icon && iconRight ? icon : undefined}
58+
startIcon={icon && !iconRight ? icon : undefined}
59+
endIcon={icon && iconRight ? icon : undefined}
6060
{...props}
6161
css={cssProp}
6262
>

src/documentation/common/CodeActionButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ const CodeActionButton = ({
5151
ml: "5",
5252
}}
5353
onPress={codeAction}
54-
leftIcon={
54+
startIcon={
5555
toolkitType === "ideas" ? <Icon as={RiFolderOpenLine} /> : undefined
5656
}
57-
rightIcon={
57+
endIcon={
5858
toolkitType !== "ideas" ? <Icon as={RiFileCopy2Line} /> : undefined
5959
}
6060
>

src/documentation/common/DocumentationBreadcrumbHeading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const DocumentationBreadcrumbHeading = ({
102102
height: "1.5rem",
103103
},
104104
}}
105-
leftIcon={<RiArrowLeftSFill />}
105+
startIcon={<RiArrowLeftSFill />}
106106
>
107107
<Text as="span">
108108
{grandparent && grandparent + " / "}

src/documentation/search/SearchDialog.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
IconButton,
99
Input,
1010
InputGroup,
11-
InputLeftElement,
12-
InputRightElement,
11+
InputStartElement,
12+
InputEndElement,
1313
Text,
1414
} from "@microbit/ui";
1515
import { useCallback, useRef } from "react";
@@ -50,9 +50,9 @@ const SearchDialog = ({
5050
<Box>
5151
<Box py="1.5" px="1">
5252
<InputGroup>
53-
<InputLeftElement pointerEvents="none">
53+
<InputStartElement pointerEvents="none">
5454
<RiSearch2Line />
55-
</InputLeftElement>
55+
</InputStartElement>
5656
<Input
5757
aria-label={intl.formatMessage({ id: "search" })}
5858
// react-aria focuses the dialog itself on open unless told
@@ -65,7 +65,7 @@ const SearchDialog = ({
6565
css={{
6666
outline: "none",
6767
border: "none",
68-
pl: "10",
68+
ps: "10",
6969
fontSize: "lg",
7070
// Needs some thought, the default breaks the design.
7171
"&:is(:focus-visible, [data-focused])": {
@@ -79,7 +79,7 @@ const SearchDialog = ({
7979
placeholder={intl.formatMessage({ id: "search" })}
8080
/>
8181
{query && (
82-
<InputRightElement>
82+
<InputEndElement>
8383
<IconButton
8484
css={{ fontSize: "2xl", color: "#838383" }}
8585
variant="ghost"
@@ -88,7 +88,7 @@ const SearchDialog = ({
8888
>
8989
<RiCloseLine />
9090
</IconButton>
91-
</InputRightElement>
91+
</InputEndElement>
9292
)}
9393
</InputGroup>
9494
</Box>

src/project/SendButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const SendButton = React.forwardRef(
9797
ref={ref}
9898
size={size}
9999
variant="primary"
100-
leftIcon={<RiUsbLine />}
100+
startIcon={<RiUsbLine />}
101101
onPress={() => handleSendToMicrobit(sendButtonRef)}
102102
>
103103
<FormattedMessage id="send-action" />

src/simulator/DataLoggingModule.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const DataLoggingModule = ({
167167
)}
168168
</HStack>
169169
<Button
170-
leftIcon={<RiDownload2Line />}
170+
startIcon={<RiDownload2Line />}
171171
onPress={handleSaveLog}
172172
isDisabled={!hasContent}
173173
>

src/workbench/AboutDialog/AboutDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const AboutDialog = ({ isOpen, onClose, finalFocusRef }: AboutDialogProps) => {
202202
))}
203203
</styled.tbody>
204204
</styled.table>
205-
<Button leftIcon={<RiFileCopy2Line />} onPress={onCopy} size="md">
205+
<Button startIcon={<RiFileCopy2Line />} onPress={onCopy} size="md">
206206
<FormattedMessage id={hasCopied ? "copied" : "copy-action"} />
207207
</Button>
208208
</VStack>
@@ -236,7 +236,7 @@ const AboutDialog = ({ isOpen, onClose, finalFocusRef }: AboutDialogProps) => {
236236
fontSize: "lg",
237237
fontWeight: "normal",
238238
}}
239-
rightIcon={<ExpandCollapseIcon open={micropythonOpen} />}
239+
endIcon={<ExpandCollapseIcon open={micropythonOpen} />}
240240
onPress={() => setMicropythonOpen((open) => !open)}
241241
>
242242
{intl.formatMessage({

src/workbench/PreReleaseNotice.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const PreReleaseNotice = ({ onDialogChange }: PreReleaseNoticeProps) => {
8282
<HStack>
8383
{hasInfoDialog && (
8484
<Button
85-
leftIcon={<RiInformationFill />}
85+
startIcon={<RiInformationFill />}
8686
variant="link"
8787
size="xs"
8888
css={{ color: "white", p: "1", fontWeight: "semibold" }}
@@ -92,7 +92,7 @@ const PreReleaseNotice = ({ onDialogChange }: PreReleaseNoticeProps) => {
9292
</Button>
9393
)}
9494
<Button
95-
leftIcon={<RiFeedbackFill />}
95+
startIcon={<RiFeedbackFill />}
9696
variant="link"
9797
size="xs"
9898
css={{ color: "white", p: "1", fontWeight: "semibold" }}

0 commit comments

Comments
 (0)