Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@react-spectrum/s2/style/style-macro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ export function createTheme<T extends Theme>(
let prop = properties.get(property);
if (prop) {
for (let property of prop.cssProperties) {
// oxlint-disable-next-line max-depth
if (property && allowedOverridesSet.has(property)) {
let selector = classNamePrefix(property, property);
let p = property.replace('--', '__');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ function getStylePropValue(
} else if (value.type === 'ArrayExpression') {
let values: string[] = [];
for (let element of value.elements) {
// oxlint-disable-next-line max-depth
if (element?.type === 'StringLiteral' || element?.type === 'NumericLiteral') {
values.push(convertGridTrack(element.value) as string);
} else if (element?.type === 'CallExpression') {
// TODO: match to import using scope
// oxlint-disable-next-line max-depth
if (
element.callee.type === 'Identifier' &&
element.callee.name === 'minmax' &&
Expand Down Expand Up @@ -352,6 +354,7 @@ function getStylePropValue(
if (prop === 'padding' && value.type === 'StringLiteral' && /\s/.test(value.value)) {
// Check if it has multiple whitespace-separated values
let expansions = expandSpaceShorthand(prop, value.value, convertDimension);
// oxlint-disable-next-line max-depth
if (!expansions) {
return null;
}
Expand Down Expand Up @@ -680,11 +683,13 @@ export default function transformStyleProps(
macroValues.set(val.key, val.value);
}
if (value.dynamicValues) {
// oxlint-disable-next-line max-depth
for (let val of value.dynamicValues) {
dynamicValues.set(val.key, val.value);
}
}
if (value.conditions) {
// oxlint-disable-next-line max-depth
for (let val of value.conditions) {
conditions.set(val.key, val.value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper
} else if (value.type === 'StringLiteral') {
let m = value.value.match(/^var\(--spectrum-global-dimension-font-size-(.+)\)$/);
if (m) {
// oxlint-disable-next-line max-depth
switch (m[1]) {
case '25':
return `[${10 / 16}rem]`;
Expand Down Expand Up @@ -296,6 +297,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper
if (value.type === 'StringLiteral') {
let m = value.value.match(/^var\(--spectrum-global-font-weight-(.+)\)$/);
if (m) {
// oxlint-disable-next-line max-depth
switch (m[1]) {
case 'light':
case 'medium':
Expand All @@ -307,6 +309,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper
return 'normal';
}
} else {
// oxlint-disable-next-line max-depth
switch (value.value) {
case 'normal':
case 'bold':
Expand Down Expand Up @@ -443,6 +446,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper
if (value.type === 'StringLiteral') {
let m = value.value.match(/^var\(--spectrum-global-animation-duration-(.+)\)$/);
if (m) {
// oxlint-disable-next-line max-depth
switch (m[1]) {
case '0':
return 0;
Expand Down
3 changes: 2 additions & 1 deletion packages/dev/docs/pages/blog/SubmenuAnimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ export function SubmenuAnimation(): JSX.Element {
}
]);

let mouseCurrent = mouseRef.current!;
return () => {
cancel();
setIsSubmenuOpen(false);
setHovered('Option 1');
mouseRef.current!.getAnimations().forEach(a => a.cancel());
mouseCurrent.getAnimations().forEach(a => a.cancel());
isAnimating.current = false;
};
};
Expand Down
1 change: 1 addition & 0 deletions packages/dev/s2-docs/scripts/generateMarkdownDocs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,7 @@ function remarkDocsComponentsToMarkdown() {
const desc = getComponentDescription(m[1], file);
if (desc) {
// Replace with normal paragraph node.
// oxlint-disable-next-line max-depth
if (node.type === 'mdxJsxFlowElement') {
parent.children[index] = {
type: 'paragraph',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-aria/src/combobox/useComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ function useValueId(depArray: ReadonlyArray<any> = []): string | undefined {

useEffect(() => {
if (exists && !document.getElementById(id)) {
// eslint-disable-next-line react-hooks/set-state-in-effect
// oxlint-disable-next-line react-hooks-js/set-state-in-effect
setExists(false);
}
}, [id, exists, lastDeps]);
Expand Down
3 changes: 3 additions & 0 deletions packages/react-aria/src/focus/FocusScope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,12 @@ function useRestoreFocus(
while (treeNode) {
if (
treeNode.scopeRef &&
// TODO: this is probably a false positive based on naming, it's not a real ref, rename.
// oxlint-disable-next-line react-hooks/exhaustive-deps
treeNode.scopeRef.current &&
focusScopeTree.getTreeNode(treeNode.scopeRef)
) {
// oxlint-disable-next-line react-hooks/exhaustive-deps
let node = getFirstInScope(treeNode.scopeRef.current, true);
restoreFocusToElement(node);
return;
Expand Down
2 changes: 2 additions & 0 deletions packages/react-aria/src/gridlist/useGridListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export function useGridListItem<T>(
} else {
walker.currentNode = ref.current;
let lastElement = last(walker);
// oxlint-disable-next-line max-depth
if (lastElement) {
focusSafely(lastElement);
scrollIntoViewport(lastElement, {containingElement: getScrollParent(ref.current)});
Expand Down Expand Up @@ -267,6 +268,7 @@ export function useGridListItem<T>(
} else {
walker.currentNode = ref.current;
let lastElement = last(walker);
// oxlint-disable-next-line max-depth
if (lastElement) {
focusSafely(lastElement);
scrollIntoViewport(lastElement, {containingElement: getScrollParent(ref.current)});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ export function useSelectableCollection(
let last: FocusableElement;
do {
last = walker.lastChild() as FocusableElement;
// oxlint-disable-next-line max-depth
if (last) {
next = last;
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-aria/src/utils/useSyncRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<
context.ref.current = ref.current;
return () => {
if (context.ref) {
// oxlint-disable-next-line react-hooks/exhaustive-deps
context.ref.current = null;
}
};
Expand Down
3 changes: 1 addition & 2 deletions starters/tailwind/stories/Table.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {type Meta} from '@storybook/react';
import React, {useMemo, useState} from 'react';
import {TableBody} from 'react-aria-components/Table';
import {Cell, Column, Row, Table, TableHeader} from '../src/Table';
import {Cell, Column, Row, Table, TableBody, TableHeader} from '../src/Table';

const meta: Meta<typeof Table> = {
component: Table,
Expand Down