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
22 changes: 22 additions & 0 deletions .cursor/rules/add-subheadings.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
alwaysApply: false
---

# Step 3: Add sub-headings

Within the Enhancements, Fixes, and Under Construction categories, group commits by UI component under sub-headings.

### Sub-heading rules:
- Use sub-headings ONLY for:
- Enhancements
- Fixes
- Under Construction
- Do NOT create sub-headings for:
- Documentation
- To Be Categorized
- S2
- Sub-headings should be in alphabetical order
- Use "Miscellaneous" as a sub-heading for commits that do not belong to a specific component
- Each category can have its own Miscellaneous sub-heading
- Write sub-headings and commits as unordered lists using a hyphen (-)
- Do NOT bold the sub-heading text
36 changes: 36 additions & 0 deletions .cursor/rules/categorize-commits.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
alwaysApply: false
---

# Step 1: Categorize commits

Sort ALL commit messages into one of six main categories. The main categories are the following:
- Enhancements
- Fixes
- Documentation
- Under Construction
- To Be Categorized
- S2

Before categorizing commits into other groups, check whether each commit should be classified as “Under Construction.”
- Follow the steps below in order:
1. Identify pre-release packages
- Use a command such as grep to scan the repository for package versions that include prerelease identifiers (e.g., alpha, beta, rc)
2. Extract component keywords from commit messages
- Parse each commit message to identify possible component names
- Normalize these keywords (e.g., lowercase, remove punctuation) for easier comparison.
3. Compare extracted keywords with pre-release packages
- If any keyword matches a package in the list, mark the commit as Under Construction.
4. Check for explicit prerelease keywords in commit text
- If the commit message directly includes alpha, beta, or rc, classify it as Under Construction, regardless of package matches.

Next, categorize the remaining commits not categorized as "Under Construction". Use the following keywords to determine the category:
| Keyword | Category |
|----------------------------|----------|
| feat | Enhancements|
| fix | Fixes |
| docs | Documentation |
| chore, revert, bump, build | To Be Categorized |
| S2 | S2 |

Do not duplicate commits. In terms of priority, it should be Under Construction > S2 > To Be Categorized > Enhancements > Fixes > Documentation
27 changes: 27 additions & 0 deletions .cursor/rules/rewrite-commit-message.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
alwaysApply: false
---

You are a expert technical writer for front-end development.

# Step 2: Rewrite commit messages

Original format: Type (Scope): Summary of changes - [@username](link to username) - [PR](link to PR)
New Format: Summary of changes - [@username](link to username) - [PR](link to PR)

### General Guidelines:
- Keep the summary as a single, grammatically correct sentence
- Verbs should be first person present tense but do NOT include the subject (e.g. I)
- The message should be concise and easy to read
- Wrap any camelCase or code-like terms (e.g. onClick, onAction, isDisabled) in backticks (``)
- Do NOT use backticks for component names
- Replace specific terms:
- RAC -> React Aria
- V3 -> React Spectrum
- ALWAYS capitalize UI component names
- Example:
- toast -> Toast
- inline alert -> InlineAlert

### Component Names to Capitalize:
Accordion, Autocomplete, Badge, Breadcrumbs, Buttons, Calendar, Checkbox, CheckboxGroup, Collections, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorWheel, ComboBox, Date and Time, DateField, DatePicker, DateRangePicker, Dialog, Disclosure, DisclosureGroup, Drag and Drop, DropZone, FileTrigger, Form, InlineAlert, Link, Listbox, ListView, Menu, Meter, Modal, NotificationBadge, NumberField, Picker, ProgressBar, ProgressCircle, RadioGroup, RangeCalendar, SearchField, Select, Slider, StatusLight, Switch, Table, Tabs, TagGroup, TextArea, TextField, TimeField, Toast, ToggleButton, ToggleButtonGroup, Tooltip, Tree, Virtualizer.
4 changes: 2 additions & 2 deletions packages/@react-aria/disclosure/src/useDisclosure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function useDisclosure(props: AriaDisclosureProps, state: DisclosureState
if (raf.current) {
cancelAnimationFrame(raf.current);
}
if (ref.current && !isDisabled && !isSSR) {
if (ref.current && !isSSR) {
let panel = ref.current;

if (isExpandedRef.current == null || typeof panel.getAnimations !== 'function') {
Expand Down Expand Up @@ -155,7 +155,7 @@ export function useDisclosure(props: AriaDisclosureProps, state: DisclosureState
role: 'group',
'aria-labelledby': triggerId,
'aria-hidden': !state.isExpanded,
hidden: !state.isExpanded || undefined
hidden: isSSR ? !state.isExpanded : undefined
}
};
}
6 changes: 3 additions & 3 deletions packages/@react-aria/disclosure/test/useDisclosure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('useDisclosure', () => {
});

it('should keep panel hidden when toggling disabled state', () => {
let {result, rerender} = renderHook(({isDisabled}: {isDisabled: boolean}) => {
let {rerender} = renderHook(({isDisabled}: {isDisabled: boolean}) => {
let state = useDisclosureState({});
return useDisclosure({isDisabled}, state, ref);
}, {initialProps: {isDisabled: false}});
Expand All @@ -100,13 +100,13 @@ describe('useDisclosure', () => {
rerender({isDisabled: true});
});

expect(result.current.panelProps.hidden).toBe(true);
expect(ref.current.hidden).toBe(true);

act(() => {
rerender({isDisabled: false});
});

expect(result.current.panelProps.hidden).toBe(true);
expect(ref.current.hidden).toBe(true);
});

it('should set correct IDs for accessibility', () => {
Expand Down
9 changes: 6 additions & 3 deletions packages/@react-aria/table/src/useTableColumnHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export interface AriaTableColumnHeaderProps<T> {

export interface TableColumnHeaderAria {
/** Props for the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) element. */
columnHeaderProps: DOMAttributes
columnHeaderProps: DOMAttributes,
/** Whether the column is currently in a pressed state. */
isPressed: boolean
}

/**
Expand All @@ -48,7 +50,7 @@ export function useTableColumnHeader<T>(props: AriaTableColumnHeaderProps<T>, st

let isSelectionCellDisabled = node.props.isSelectionCell && state.selectionManager.selectionMode === 'single';

let {pressProps} = usePress({
let {pressProps, isPressed} = usePress({
isDisabled: !allowsSorting || isSelectionCellDisabled,
onPress() {
state.sort(node.key);
Expand Down Expand Up @@ -100,6 +102,7 @@ export function useTableColumnHeader<T>(props: AriaTableColumnHeaderProps<T>, st
id: getColumnHeaderId(state, node.key),
'aria-colspan': node.colSpan && node.colSpan > 1 ? node.colSpan : undefined,
'aria-sort': ariaSort
}
},
isPressed
};
}
21 changes: 1 addition & 20 deletions packages/@react-aria/textfield/src/useTextField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@

import {AriaTextFieldProps} from '@react-types/textfield';
import {DOMAttributes, ValidationResult} from '@react-types/shared';
import {filterDOMProps, getOwnerWindow, mergeProps, useFormReset} from '@react-aria/utils';
import {filterDOMProps, mergeProps, useFormReset} from '@react-aria/utils';
import React, {
ChangeEvent,
HTMLAttributes,
type JSX,
LabelHTMLAttributes,
RefObject,
useEffect,
useState
} from 'react';
import {useControlledState} from '@react-stately/utils';
Expand Down Expand Up @@ -147,24 +146,6 @@ export function useTextField<T extends TextFieldIntrinsicElements = DefaultEleme
useFormReset(ref, props.defaultValue ?? initialValue, setValue);
useFormValidation(props, validationState, ref);

useEffect(() => {
// This works around a React/Chrome bug that prevents textarea elements from validating when controlled.
// We prevent React from updating defaultValue (i.e. children) of textarea when `value` changes,
// which causes Chrome to skip validation. Only updating `value` is ok in our case since our
// textareas are always controlled. React is planning on removing this synchronization in a
// future major version.
// https://github.com/facebook/react/issues/19474
// https://github.com/facebook/react/issues/11896
if (ref.current instanceof getOwnerWindow(ref.current).HTMLTextAreaElement) {
let input = ref.current;
Object.defineProperty(input, 'defaultValue', {
get: () => input.value,
set: () => {},
configurable: true
});
}
}, [ref]);

return {
labelProps,
inputProps: mergeProps(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/dev/docs/pages/assets/component-illustrations/Avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions packages/dev/docs/pages/assets/component-illustrations/Card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading