mirror of
https://github.com/actualbudget/actual.git
synced 2026-11-16 14:56:16 -06:00
lint: a11y issue fixes (#6679)
* Fix accessibility issues: use semantic HTML and correct tab indices - Replace View with semantic h1 in ModalHeader - Fix tabIndex from 1 to 0 in Menu component - Remove disabled oxlint accessibility rules - Update components to use proper semantic HTML elements * Refactor button elements to semantic HTML in Autocomplete and CategoryAutocomplete components - Replace button elements with div/View while maintaining role="button" for accessibility. - Update styles and props accordingly to ensure consistent behavior. - Adjust onClick types in Item and SecondaryItem components for better type safety. * Add release notes for upcoming maintenance updates addressing various accessibility issues * Refactor autocomplete components to improve text alignment and button semantics - Added textAlign: 'left' style to AccountItem and PayeeItem for consistent text alignment. - Removed type="button" from CategoryItem to streamline button semantics. - Updated ItemContent to use the Button component instead of a button element, enhancing accessibility and consistency. * Refactor budget and report components to improve text alignment - Removed font: 'inherit' style from EnvelopeBudgetComponents and TrackingBudgetComponents for cleaner styling. - Updated ActionableGridListItem and ReportCard components to replace font: 'inherit' with textAlign: 'left' for consistent text alignment. * Update ActionableGridListItem to include font inheritance for improved styling consistency * Refactor button elements to use the Button component for consistency and improved semantics - Updated various components (EnvelopeBudgetComponents, IncomeCategoryMonth, CategoryMonth, ActionableGridListItem, ReportCard, DesktopLinkedNotes) to replace native button elements with the custom Button component. - Adjusted styles and event handlers to align with the new Button implementation, ensuring consistent behavior and accessibility across the application. * Update Button and ActionableGridListItem styles for consistency - Set a fixed borderRadius of 4 for the Button component, ensuring uniformity across variants. - Adjusted ActionableGridListItem to have a borderRadius of 0 for a cleaner design. * Update CategoryAutocomplete to include button type attribute for improved semantics * Update VRT screenshots Auto-generated by VRT workflow PR: #6679 * Update VRT screenshot for Payees search functionality --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
parent
9376217c5e
commit
65dee4c627
@@ -18,11 +18,6 @@
|
|||||||
"FS": "readonly"
|
"FS": "readonly"
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// TODO fix all these and re-enable
|
|
||||||
"jsx-a11y/click-events-have-key-events": "off",
|
|
||||||
"jsx-a11y/prefer-tag-over-role": "off",
|
|
||||||
"jsx-a11y/tabindex-no-positive": "off",
|
|
||||||
|
|
||||||
// Import sorting
|
// Import sorting
|
||||||
// TODO replace once oxfmt supports this: https://github.com/oxc-project/oxc/issues/17076
|
// TODO replace once oxfmt supports this: https://github.com/oxc-project/oxc/issues/17076
|
||||||
"perfectionist/sort-imports": [
|
"perfectionist/sort-imports": [
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export function Menu<const NameType = string>({
|
|||||||
<View
|
<View
|
||||||
className={className}
|
className={className}
|
||||||
style={{ outline: 'none', borderRadius: 4, overflow: 'hidden', ...style }}
|
style={{ outline: 'none', borderRadius: 4, overflow: 'hidden', ...style }}
|
||||||
tabIndex={1}
|
tabIndex={0}
|
||||||
onKeyDown={onKeyDown}
|
onKeyDown={onKeyDown}
|
||||||
innerRef={elRef}
|
innerRef={elRef}
|
||||||
>
|
>
|
||||||
|
|||||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 89 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 88 KiB |
@@ -76,9 +76,7 @@ export function MobilePageHeader({
|
|||||||
>
|
>
|
||||||
{leftContent}
|
{leftContent}
|
||||||
</View>
|
</View>
|
||||||
<View
|
<h1
|
||||||
role="heading"
|
|
||||||
aria-level={1}
|
|
||||||
style={{
|
style={{
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@@ -88,10 +86,13 @@ export function MobilePageHeader({
|
|||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
overflowY: 'auto',
|
overflowY: 'auto',
|
||||||
|
display: 'flex',
|
||||||
|
margin: 0,
|
||||||
|
padding: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</View>
|
</h1>
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
flexBasis: '25%',
|
flexBasis: '25%',
|
||||||
|
|||||||
@@ -250,7 +250,8 @@ function AccountItem({
|
|||||||
: {};
|
: {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<button
|
||||||
|
type="button"
|
||||||
// List each account up to a max
|
// List each account up to a max
|
||||||
// Downshift calls `setTimeout(..., 250)` in the `onMouseMove`
|
// Downshift calls `setTimeout(..., 250)` in the `onMouseMove`
|
||||||
// event handler they set on this element. When this code runs
|
// event handler they set on this element. When this code runs
|
||||||
@@ -267,13 +268,13 @@ function AccountItem({
|
|||||||
// there's some "fast path" logic that can be triggered in various
|
// there's some "fast path" logic that can be triggered in various
|
||||||
// ways to force WebKit to bail on the content observation process.
|
// ways to force WebKit to bail on the content observation process.
|
||||||
// One of those ways is setting `role="button"` (or a number of
|
// One of those ways is setting `role="button"` (or a number of
|
||||||
// other aria roles) on the element, which is what we're doing here.
|
// other aria roles) on the element. Now we use a semantic button
|
||||||
|
// element instead which provides the same fast path behavior.
|
||||||
//
|
//
|
||||||
// ref:
|
// ref:
|
||||||
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
||||||
role="button"
|
|
||||||
className={cx(
|
className={cx(
|
||||||
className,
|
className,
|
||||||
css({
|
css({
|
||||||
@@ -286,6 +287,9 @@ function AccountItem({
|
|||||||
padding: 4,
|
padding: 4,
|
||||||
paddingLeft: 20,
|
paddingLeft: 20,
|
||||||
borderRadius: embedded ? 4 : 0,
|
borderRadius: embedded ? 4 : 0,
|
||||||
|
border: 'none',
|
||||||
|
textAlign: 'left',
|
||||||
|
font: 'inherit',
|
||||||
...narrowStyle,
|
...narrowStyle,
|
||||||
}),
|
}),
|
||||||
)}
|
)}
|
||||||
@@ -294,7 +298,7 @@ function AccountItem({
|
|||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<TextOneLine>{item.name}</TextOneLine>
|
<TextOneLine>{item.name}</TextOneLine>
|
||||||
</div>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ function defaultRenderItems<T extends AutocompleteItem>(
|
|||||||
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
||||||
|
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role
|
||||||
role="button"
|
role="button"
|
||||||
className={css({
|
className={css({
|
||||||
padding: 5,
|
padding: 5,
|
||||||
|
|||||||
@@ -380,6 +380,7 @@ function SplitTransactionButton({
|
|||||||
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
||||||
|
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role
|
||||||
role="button"
|
role="button"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: highlighted
|
backgroundColor: highlighted
|
||||||
@@ -461,10 +462,10 @@ function CategoryItem({
|
|||||||
const toBudget = useEnvelopeSheetValue(envelopeBudget.toBudget);
|
const toBudget = useEnvelopeSheetValue(envelopeBudget.toBudget);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<button
|
||||||
|
type="button"
|
||||||
style={style}
|
style={style}
|
||||||
// See comment above.
|
// See comment above.
|
||||||
role="button"
|
|
||||||
className={cx(
|
className={cx(
|
||||||
className,
|
className,
|
||||||
css({
|
css({
|
||||||
@@ -477,6 +478,8 @@ function CategoryItem({
|
|||||||
padding: 4,
|
padding: 4,
|
||||||
paddingLeft: 20,
|
paddingLeft: 20,
|
||||||
borderRadius: embedded ? 4 : 0,
|
borderRadius: embedded ? 4 : 0,
|
||||||
|
border: 'none',
|
||||||
|
font: 'inherit',
|
||||||
...narrowStyle,
|
...narrowStyle,
|
||||||
}),
|
}),
|
||||||
)}
|
)}
|
||||||
@@ -519,7 +522,7 @@ function CategoryItem({
|
|||||||
)}
|
)}
|
||||||
</TextOneLine>
|
</TextOneLine>
|
||||||
</View>
|
</View>
|
||||||
</div>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -642,7 +642,8 @@ function PayeeItem({
|
|||||||
paddingLeftOverFromIcon -= iconSize + 5;
|
paddingLeftOverFromIcon -= iconSize + 5;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<button
|
||||||
|
type="button"
|
||||||
// Downshift calls `setTimeout(..., 250)` in the `onMouseMove`
|
// Downshift calls `setTimeout(..., 250)` in the `onMouseMove`
|
||||||
// event handler they set on this element. When this code runs
|
// event handler they set on this element. When this code runs
|
||||||
// in WebKit on touch-enabled devices, taps on this element end
|
// in WebKit on touch-enabled devices, taps on this element end
|
||||||
@@ -658,13 +659,13 @@ function PayeeItem({
|
|||||||
// there's some "fast path" logic that can be triggered in various
|
// there's some "fast path" logic that can be triggered in various
|
||||||
// ways to force WebKit to bail on the content observation process.
|
// ways to force WebKit to bail on the content observation process.
|
||||||
// One of those ways is setting `role="button"` (or a number of
|
// One of those ways is setting `role="button"` (or a number of
|
||||||
// other aria roles) on the element, which is what we're doing here.
|
// other aria roles) on the element. Now we use a semantic button
|
||||||
|
// element instead which provides the same fast path behavior.
|
||||||
//
|
//
|
||||||
// ref:
|
// ref:
|
||||||
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
// * https://github.com/WebKit/WebKit/blob/447d90b0c52b2951a69df78f06bb5e6b10262f4b/LayoutTests/fast/events/touch/ios/content-observation/400ms-hover-intent.html
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebCore/page/ios/ContentChangeObserver.cpp
|
||||||
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
// * https://github.com/WebKit/WebKit/blob/58956cf59ba01267644b5e8fe766efa7aa6f0c5c/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L783
|
||||||
role="button"
|
|
||||||
className={cx(
|
className={cx(
|
||||||
className,
|
className,
|
||||||
css({
|
css({
|
||||||
@@ -677,6 +678,9 @@ function PayeeItem({
|
|||||||
borderRadius: embedded ? 4 : 0,
|
borderRadius: embedded ? 4 : 0,
|
||||||
padding: 4,
|
padding: 4,
|
||||||
paddingLeft: paddingLeftOverFromIcon,
|
paddingLeft: paddingLeftOverFromIcon,
|
||||||
|
border: 'none',
|
||||||
|
font: 'inherit',
|
||||||
|
textAlign: 'left',
|
||||||
...narrowStyle,
|
...narrowStyle,
|
||||||
}),
|
}),
|
||||||
)}
|
)}
|
||||||
@@ -688,7 +692,7 @@ function PayeeItem({
|
|||||||
{itemIcon}
|
{itemIcon}
|
||||||
{item.name}
|
{item.name}
|
||||||
</TextOneLine>
|
</TextOneLine>
|
||||||
</div>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-9
@@ -469,9 +469,9 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
|
|||||||
width="flex"
|
width="flex"
|
||||||
style={{ paddingRight: styles.monthRightPadding, textAlign: 'right' }}
|
style={{ paddingRight: styles.monthRightPadding, textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
<span
|
<Button
|
||||||
role="button"
|
variant="bare"
|
||||||
onClick={() => {
|
onPress={() => {
|
||||||
resetBalancePosition(-6, -4);
|
resetBalancePosition(-6, -4);
|
||||||
setBalanceMenuOpen(true);
|
setBalanceMenuOpen(true);
|
||||||
}}
|
}}
|
||||||
@@ -484,6 +484,12 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
|
|||||||
e.clientY - rect.bottom - 8,
|
e.clientY - rect.bottom - 8,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
background: 'transparent',
|
||||||
|
width: '100%',
|
||||||
|
padding: 0,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<BalanceWithCarryover
|
<BalanceWithCarryover
|
||||||
carryover={envelopeBudget.catCarryover(category.id)}
|
carryover={envelopeBudget.catCarryover(category.id)}
|
||||||
@@ -493,7 +499,7 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
|
|||||||
longGoal={envelopeBudget.catLongGoal(category.id)}
|
longGoal={envelopeBudget.catLongGoal(category.id)}
|
||||||
tooltipDisabled={balanceMenuOpen}
|
tooltipDisabled={balanceMenuOpen}
|
||||||
/>
|
/>
|
||||||
</span>
|
</Button>
|
||||||
|
|
||||||
<Popover
|
<Popover
|
||||||
triggerRef={balanceMenuTriggerRef}
|
triggerRef={balanceMenuTriggerRef}
|
||||||
@@ -584,9 +590,9 @@ export function IncomeCategoryMonth({
|
|||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<Button
|
||||||
role="button"
|
variant="bare"
|
||||||
onClick={() => {
|
onPress={() => {
|
||||||
resetIncomePosition(-6, -4);
|
resetIncomePosition(-6, -4);
|
||||||
setIncomeMenuOpen(true);
|
setIncomeMenuOpen(true);
|
||||||
}}
|
}}
|
||||||
@@ -599,7 +605,11 @@ export function IncomeCategoryMonth({
|
|||||||
e.clientY - rect.bottom - 8,
|
e.clientY - rect.bottom - 8,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
style={{ paddingRight: styles.monthRightPadding }}
|
style={{
|
||||||
|
background: 'transparent',
|
||||||
|
padding: 0,
|
||||||
|
paddingRight: styles.monthRightPadding,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<BalanceWithCarryover
|
<BalanceWithCarryover
|
||||||
carryover={envelopeBudget.catCarryover(category.id)}
|
carryover={envelopeBudget.catCarryover(category.id)}
|
||||||
@@ -608,7 +618,7 @@ export function IncomeCategoryMonth({
|
|||||||
budgeted={envelopeBudget.catBudgeted(category.id)}
|
budgeted={envelopeBudget.catBudgeted(category.id)}
|
||||||
longGoal={envelopeBudget.catLongGoal(category.id)}
|
longGoal={envelopeBudget.catLongGoal(category.id)}
|
||||||
/>
|
/>
|
||||||
</span>
|
</Button>
|
||||||
<Popover
|
<Popover
|
||||||
triggerRef={incomeMenuTriggerRef}
|
triggerRef={incomeMenuTriggerRef}
|
||||||
placement="bottom end"
|
placement="bottom end"
|
||||||
|
|||||||
+10
-4
@@ -446,10 +446,16 @@ export const CategoryMonth = memo(function CategoryMonth({
|
|||||||
width="flex"
|
width="flex"
|
||||||
style={{ paddingRight: styles.monthRightPadding, textAlign: 'right' }}
|
style={{ paddingRight: styles.monthRightPadding, textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
<span
|
<Button
|
||||||
role="button"
|
variant="bare"
|
||||||
ref={triggerBalanceMenuRef}
|
ref={triggerBalanceMenuRef}
|
||||||
onClick={() => !category.is_income && setBalanceMenuOpen(true)}
|
onPress={() => !category.is_income && setBalanceMenuOpen(true)}
|
||||||
|
style={{
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
background: 'transparent',
|
||||||
|
width: '100%',
|
||||||
|
padding: 0,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<BalanceWithCarryover
|
<BalanceWithCarryover
|
||||||
isDisabled={category.is_income}
|
isDisabled={category.is_income}
|
||||||
@@ -459,7 +465,7 @@ export const CategoryMonth = memo(function CategoryMonth({
|
|||||||
budgeted={trackingBudget.catBudgeted(category.id)}
|
budgeted={trackingBudget.catBudgeted(category.id)}
|
||||||
longGoal={trackingBudget.catLongGoal(category.id)}
|
longGoal={trackingBudget.catLongGoal(category.id)}
|
||||||
/>
|
/>
|
||||||
</span>
|
</Button>
|
||||||
|
|
||||||
<Popover
|
<Popover
|
||||||
triggerRef={triggerBalanceMenuRef}
|
triggerRef={triggerBalanceMenuRef}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function InfiniteScrollWrapper({
|
|||||||
// Hide the last border of the item in the table
|
// Hide the last border of the item in the table
|
||||||
marginBottom: -1,
|
marginBottom: -1,
|
||||||
}}
|
}}
|
||||||
tabIndex={1}
|
tabIndex={0}
|
||||||
data-testid="table"
|
data-testid="table"
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -313,15 +313,16 @@ export function ModalHeader({
|
|||||||
}: ModalHeaderProps) {
|
}: ModalHeaderProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<View
|
<h1
|
||||||
role="heading"
|
|
||||||
aria-level={1}
|
|
||||||
style={{
|
style={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
height: 60,
|
height: 60,
|
||||||
flex: 'none',
|
flex: 'none',
|
||||||
|
display: 'flex',
|
||||||
|
margin: 0,
|
||||||
|
padding: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
@@ -369,7 +370,7 @@ export function ModalHeader({
|
|||||||
{rightContent}
|
{rightContent}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</h1>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useRef, useState, type ReactNode } from 'react';
|
|||||||
import { GridListItem, type GridListItemProps } from 'react-aria-components';
|
import { GridListItem, type GridListItemProps } from 'react-aria-components';
|
||||||
import { animated, config, useSpring } from 'react-spring';
|
import { animated, config, useSpring } from 'react-spring';
|
||||||
|
|
||||||
|
import { Button } from '@actual-app/components/button';
|
||||||
import { styles } from '@actual-app/components/styles';
|
import { styles } from '@actual-app/components/styles';
|
||||||
import { theme } from '@actual-app/components/theme';
|
import { theme } from '@actual-app/components/theme';
|
||||||
import { useDrag } from '@use-gesture/react';
|
import { useDrag } from '@use-gesture/react';
|
||||||
@@ -107,20 +108,20 @@ export function ActionableGridListItem<T extends object>({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Main content */}
|
{/* Main content */}
|
||||||
<div
|
<Button
|
||||||
role="button"
|
variant="bare"
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: theme.tableBackground,
|
backgroundColor: theme.tableBackground,
|
||||||
minWidth: '100%',
|
minWidth: '100%',
|
||||||
padding: 16,
|
padding: 16,
|
||||||
|
textAlign: 'left',
|
||||||
|
borderRadius: 0,
|
||||||
}}
|
}}
|
||||||
onClick={handleAction}
|
onClick={handleAction}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</Button>
|
||||||
|
|
||||||
{/* Actions that appear when swiped */}
|
{/* Actions that appear when swiped */}
|
||||||
{hasActions && (
|
{hasActions && (
|
||||||
|
|||||||
@@ -107,19 +107,19 @@ export function ReportCard({
|
|||||||
if (to) {
|
if (to) {
|
||||||
return (
|
return (
|
||||||
<Layout {...layoutProps}>
|
<Layout {...layoutProps}>
|
||||||
<View
|
<Button
|
||||||
role="button"
|
variant="bare"
|
||||||
onClick={isEditing || disableClick ? undefined : () => navigate(to)}
|
onPress={isEditing || disableClick ? undefined : () => navigate(to)}
|
||||||
style={{
|
style={{
|
||||||
height: '100%',
|
height: '100%',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
':hover': {
|
background: 'transparent',
|
||||||
cursor: 'pointer',
|
padding: 0,
|
||||||
},
|
textAlign: 'left',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
</View>
|
</Button>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { Block } from '@actual-app/components/block';
|
|
||||||
import { InitialFocus } from '@actual-app/components/initial-focus';
|
import { InitialFocus } from '@actual-app/components/initial-focus';
|
||||||
import { Input } from '@actual-app/components/input';
|
import { Input } from '@actual-app/components/input';
|
||||||
import { styles } from '@actual-app/components/styles';
|
import { styles } from '@actual-app/components/styles';
|
||||||
@@ -42,15 +41,16 @@ export const ReportCardName = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Block
|
<h2
|
||||||
style={{
|
style={{
|
||||||
|
display: 'block',
|
||||||
|
margin: 0,
|
||||||
|
padding: 0,
|
||||||
...styles.mediumText,
|
...styles.mediumText,
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
}}
|
}}
|
||||||
role="heading"
|
|
||||||
aria-level={2}
|
|
||||||
>
|
>
|
||||||
{name}
|
{name}
|
||||||
</Block>
|
</h2>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export function ReportTable({
|
|||||||
outline: 'none',
|
outline: 'none',
|
||||||
'& .animated .animated-row': { transition: '.25s transform' },
|
'& .animated .animated-row': { transition: '.25s transform' },
|
||||||
}}
|
}}
|
||||||
tabIndex={1}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<Block
|
<Block
|
||||||
innerRef={listScrollRef}
|
innerRef={listScrollRef}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import React, {
|
import React, {
|
||||||
|
type ComponentProps,
|
||||||
type ComponentType,
|
type ComponentType,
|
||||||
type CSSProperties,
|
type CSSProperties,
|
||||||
type MouseEventHandler,
|
|
||||||
type ReactNode,
|
type ReactNode,
|
||||||
type SVGProps,
|
type SVGProps,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
@@ -23,7 +23,7 @@ type ItemProps = {
|
|||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
style?: CSSProperties;
|
style?: CSSProperties;
|
||||||
indent?: number;
|
indent?: number;
|
||||||
onClick?: MouseEventHandler<HTMLDivElement>;
|
onClick?: ComponentProps<typeof ItemContent>['onClick'];
|
||||||
forceHover?: boolean;
|
forceHover?: boolean;
|
||||||
forceActive?: boolean;
|
forceActive?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
import React, {
|
import React, { type ComponentProps, type ReactNode } from 'react';
|
||||||
type ComponentProps,
|
|
||||||
type MouseEventHandler,
|
|
||||||
type ReactNode,
|
|
||||||
} from 'react';
|
|
||||||
|
|
||||||
|
import { Button } from '@actual-app/components/button';
|
||||||
import { type CSSProperties } from '@actual-app/components/styles';
|
import { type CSSProperties } from '@actual-app/components/styles';
|
||||||
import { View } from '@actual-app/components/view';
|
import { type View } from '@actual-app/components/view';
|
||||||
|
|
||||||
import { Link } from '@desktop-client/components/common/Link';
|
import { Link } from '@desktop-client/components/common/Link';
|
||||||
|
|
||||||
type ItemContentProps = {
|
type ItemContentProps = {
|
||||||
style: ComponentProps<typeof View>['style'];
|
style: ComponentProps<typeof View>['style'];
|
||||||
to: string;
|
to: string;
|
||||||
onClick: MouseEventHandler<HTMLDivElement>;
|
onClick: ComponentProps<typeof Button>['onPress'];
|
||||||
activeStyle: CSSProperties;
|
activeStyle: CSSProperties;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
forceActive?: boolean;
|
forceActive?: boolean;
|
||||||
@@ -27,21 +24,17 @@ export function ItemContent({
|
|||||||
children,
|
children,
|
||||||
}: ItemContentProps) {
|
}: ItemContentProps) {
|
||||||
return onClick ? (
|
return onClick ? (
|
||||||
<View
|
<Button
|
||||||
role="button"
|
variant="bare"
|
||||||
tabIndex={0}
|
|
||||||
style={{
|
style={{
|
||||||
|
justifyContent: 'flex-start',
|
||||||
...style,
|
...style,
|
||||||
touchAction: 'auto',
|
|
||||||
userSelect: 'none',
|
|
||||||
userDrag: 'none',
|
|
||||||
cursor: 'pointer',
|
|
||||||
...(forceActive ? activeStyle : {}),
|
...(forceActive ? activeStyle : {}),
|
||||||
}}
|
}}
|
||||||
onClick={onClick}
|
onPress={onClick}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Link variant="internal" to={to} style={style} activeStyle={activeStyle}>
|
<Link variant="internal" to={to} style={style} activeStyle={activeStyle}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import React, {
|
import React, {
|
||||||
|
type ComponentProps,
|
||||||
type ComponentType,
|
type ComponentType,
|
||||||
type CSSProperties,
|
type CSSProperties,
|
||||||
type MouseEventHandler,
|
|
||||||
type SVGProps,
|
type SVGProps,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ type SecondaryItemProps = {
|
|||||||
| ComponentType<SVGProps<SVGElement>>
|
| ComponentType<SVGProps<SVGElement>>
|
||||||
| ComponentType<SVGProps<SVGSVGElement>>;
|
| ComponentType<SVGProps<SVGSVGElement>>;
|
||||||
style?: CSSProperties;
|
style?: CSSProperties;
|
||||||
onClick?: MouseEventHandler<HTMLDivElement>;
|
onClick?: ComponentProps<typeof ItemContent>['onClick'];
|
||||||
bold?: boolean;
|
bold?: boolean;
|
||||||
indent?: number;
|
indent?: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1158,7 +1158,7 @@ export const Table = forwardRef(
|
|||||||
outline: 'none',
|
outline: 'none',
|
||||||
...style,
|
...style,
|
||||||
}}
|
}}
|
||||||
tabIndex={1}
|
tabIndex={0}
|
||||||
{...getNavigatorProps(props)}
|
{...getNavigatorProps(props)}
|
||||||
data-testid="table"
|
data-testid="table"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { type MouseEvent } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { Button } from '@actual-app/components/button';
|
||||||
import { theme } from '@actual-app/components/theme';
|
import { theme } from '@actual-app/components/theme';
|
||||||
import { css } from '@emotion/css';
|
|
||||||
|
|
||||||
import { isElectron } from 'loot-core/shared/environment';
|
import { isElectron } from 'loot-core/shared/environment';
|
||||||
|
|
||||||
@@ -18,14 +17,12 @@ type DesktopLinkedNotesProps = {
|
|||||||
isFilePath: boolean;
|
isFilePath: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const linkStyles = css({
|
const linkStyles = {
|
||||||
color: theme.pageTextLink,
|
color: theme.pageTextLink,
|
||||||
textDecoration: 'underline',
|
textDecoration: 'underline',
|
||||||
cursor: 'pointer',
|
background: 'transparent',
|
||||||
'&:hover': {
|
padding: 0,
|
||||||
color: theme.pageTextLinkLight,
|
};
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export function DesktopLinkedNotes({
|
export function DesktopLinkedNotes({
|
||||||
displayText,
|
displayText,
|
||||||
@@ -36,10 +33,7 @@ export function DesktopLinkedNotes({
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const handleClick = async (e: MouseEvent) => {
|
const handleClick = async () => {
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
if (isFilePath) {
|
if (isFilePath) {
|
||||||
if (isElectron()) {
|
if (isElectron()) {
|
||||||
// Open file in file manager
|
// Open file in file manager
|
||||||
@@ -65,14 +59,9 @@ export function DesktopLinkedNotes({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span
|
<Button variant="bare" style={linkStyles} onPress={handleClick}>
|
||||||
role="button"
|
|
||||||
className={linkStyles}
|
|
||||||
onMouseDown={e => e.stopPropagation()}
|
|
||||||
onClick={handleClick}
|
|
||||||
>
|
|
||||||
{displayText}
|
{displayText}
|
||||||
</span>
|
</Button>
|
||||||
{separator}
|
{separator}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
category: Maintenance
|
||||||
|
authors: [MatissJanis]
|
||||||
|
---
|
||||||
|
|
||||||
|
lint: fix various a11y issues
|
||||||
Reference in New Issue
Block a user