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
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/DatePicker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const relatedPages = [{'title': 'useDatePicker', 'url': 'https://react-sp
props={['label', 'granularity', 'isDisabled']}
initialProps={{label: 'Date'}}
type="tailwind"
files={["starters/tailwind/src/DatePicker.tsx", "starters/tailwind/src/DateField.tsx", "starters/tailwind/src/index.css"]} />
files={["starters/tailwind/src/DatePicker.tsx"]} />
</ExampleSwitcher>

## Value
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/DateRangePicker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const relatedPages = [{'title': 'useDateRangePicker', 'url': 'https://rea
props={['label', 'granularity', 'isDisabled']}
initialProps={{label: 'Date range'}}
type="tailwind"
files={["starters/tailwind/src/DateRangePicker.tsx", "starters/tailwind/src/DateField.tsx", "starters/tailwind/src/index.css"]} />
files={["starters/tailwind/src/DateRangePicker.tsx"]} />
</ExampleSwitcher>

## Value
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/Modal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const relatedPages = [{'title': 'useModalOverlay', 'url': 'https://react-
}
```

```tsx render docs={vanillaDocs.exports.Modal} links={vanillaDocs.links} props={['isDismissable', 'isKeyboardDismissDisabled']} type="tailwind" files={["starters/docs/src/Modal.tsx"]}
```tsx render docs={vanillaDocs.exports.Modal} links={vanillaDocs.links} props={['isDismissable', 'isKeyboardDismissDisabled']} type="tailwind" files={["starters/tailwind/src/Modal.tsx"]}
"use client";
import {DialogTrigger, Heading} from 'react-aria-components';
import {Modal} from 'tailwind-starter/Modal';
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/Popover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const relatedPages = [{'title': 'usePopover', 'url': 'https://react-spect
}
```

```tsx render docs={vanillaDocs.exports.Popover} links={vanillaDocs.links} props={['placement', 'offset', 'crossOffset', 'shouldFlip']} type="tailwind" files={["starters/docs/src/Popover.tsx"]}
```tsx render docs={vanillaDocs.exports.Popover} links={vanillaDocs.links} props={['placement', 'offset', 'crossOffset', 'shouldFlip']} type="tailwind" files={["starters/tailwind/src/Popover.tsx"]}
"use client";
import {DialogTrigger} from 'react-aria-components';
import {Popover} from 'tailwind-starter/Popover';
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/Toolbar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const relatedPages = [{'title': 'useToolbar', 'url': 'https://react-spect
</Toolbar>
```

```tsx render docs={docs.exports.Toolbar} links={docs.links} props={['orientation']} initialProps={{'aria-label': 'Text formatting'}} type="tailwind" files={["starters/docs/src/Toolbar.tsx"]}
```tsx render docs={docs.exports.Toolbar} links={docs.links} props={['orientation']} initialProps={{'aria-label': 'Text formatting'}} type="tailwind" files={["starters/tailwind/src/Toolbar.tsx"]}
"use client";
import {Toolbar} from 'tailwind-starter/Toolbar';
import {ToggleButtonGroup} from 'tailwind-starter/ToggleButtonGroup';
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/Tooltip.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const relatedPages = [{'title': 'useTooltipTrigger', 'url': 'https://reac
}
```

```tsx render docs={vanillaDocs.exports.Tooltip} links={vanillaDocs.links} props={['placement', 'offset', 'crossOffset', 'shouldFlip']} type="tailwind" files={["starters/docs/src/Tooltip.tsx"]}
```tsx render docs={vanillaDocs.exports.Tooltip} links={vanillaDocs.links} props={['placement', 'offset', 'crossOffset', 'shouldFlip']} type="tailwind" files={["starters/tailwind/src/Tooltip.tsx"]}
"use client";
import {TooltipTrigger} from 'react-aria-components';
import {Tooltip} from 'tailwind-starter/Tooltip';
Expand Down
11 changes: 10 additions & 1 deletion packages/dev/s2-docs/src/VisualExampleClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {ActionButton, Avatar, Collection, ComboBox, ComboBoxItem, Content, ContextualHelp, Footer, Header, Heading, NotificationBadge, NumberField, Picker, PickerItem, PickerSection, RangeSlider, Slider, Switch, Text, TextField, ToggleButton, ToggleButtonGroup} from '@react-spectrum/s2';
import AddCircle from '@react-spectrum/s2/icons/AddCircle';
import {baseColor, focusRing, style, StyleString} from '@react-spectrum/s2/style' with { type: 'macro' };
import {CenterBaseline} from '../../../@react-spectrum/s2/src/CenterBaseline';
import {CodePlatter, Pre, ShareUrlProvider} from './CodePlatter';
import {ExampleOutput} from './ExampleOutput';
import {ExampleSwitcherContext} from './ExampleSwitcher';
Expand Down Expand Up @@ -549,7 +550,15 @@ function Wrapper({control, children, styles, ref}: {control: PropControl, childr
{control.name}
<span className={style({whiteSpace: 'nowrap'})}>
&nbsp;
{control.description ? <div style={{display: 'inline-flex'}}><PropContextualHelp control={control} /></div> : null}
{control.description ? (
<CenterBaseline
styles={style({
display: 'inline-flex',
height: 0
})}>
<PropContextualHelp control={control} />
</CenterBaseline>
) : null}
</span>
</span>
{children}
Expand Down
12 changes: 12 additions & 0 deletions starters/docs/src/Table.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
transition-duration: 200ms;
-webkit-tap-highlight-color: transparent;

&tr:last-child {
border-radius: 0 0 var(--radius) var(--radius);
}

&[data-focus-visible] {
outline: 2px solid var(--focus-ring-color);
outline-offset: -2px;
Expand Down Expand Up @@ -144,6 +148,14 @@
height: 100%;
}

&:is(.react-aria-Row > :first-child) {
border-end-start-radius: var(--radius);
}

&:is(.react-aria-Row > :last-child) {
border-end-end-radius: var(--radius);
}

&[data-focus-visible] {
outline: 2px solid var(--focus-ring-color);
outline-offset: -2px;
Expand Down
3 changes: 2 additions & 1 deletion starters/docs/src/Toast.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
display: flex;
align-items: center;
gap: var(--spacing-4);
background: var(--tint-1000);
background: var(--highlight-background);
padding: var(--spacing-3) var(--spacing-4);
border-radius: var(--radius-lg);
outline: none;
Expand Down Expand Up @@ -75,6 +75,7 @@

&[data-pressed] {
background: var(--highlight-pressed);
box-shadow: none;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion starters/tailwind/src/GridList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function GridList<T extends object>(

const itemStyles = tv({
extend: focusRing,
base: 'relative flex gap-3 cursor-default select-none py-2 px-3 text-sm text-neutral-900 dark:text-neutral-200 border-y dark:border-y-neutral-700 border-transparent first:border-t-0 last:border-b-0 first:rounded-t-lg last:rounded-b-lg -mb-px last:mb-0 -outline-offset-2',
base: 'relative flex gap-3 cursor-default select-none py-2 px-3 text-sm text-neutral-900 dark:text-neutral-200 border-t dark:border-t-neutral-700 border-transparent first:border-t-0 first:rounded-t-lg last:rounded-b-lg last:mb-0 -outline-offset-2',
variants: {
isSelected: {
false: 'hover:bg-neutral-100 dark:hover:bg-neutral-700/60',
Expand Down
4 changes: 2 additions & 2 deletions starters/tailwind/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function TableBody<T extends object>(props: TableBodyProps<T>) {

const rowStyles = tv({
extend: focusRing,
base: 'group/row relative cursor-default select-none -outline-offset-2 text-neutral-900 disabled:text-neutral-300 dark:text-neutral-200 dark:disabled:text-neutral-600 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800 selected:bg-blue-100 selected:hover:bg-blue-200 dark:selected:bg-blue-700/30 dark:selected:hover:bg-blue-700/40'
base: 'group/row relative cursor-default select-none -outline-offset-2 text-neutral-900 disabled:text-neutral-300 dark:text-neutral-200 dark:disabled:text-neutral-600 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800 selected:bg-blue-100 selected:hover:bg-blue-200 dark:selected:bg-blue-700/30 dark:selected:hover:bg-blue-700/40 last:rounded-b-lg'
});

export function Row<T extends object>(
Expand Down Expand Up @@ -135,7 +135,7 @@ export function Row<T extends object>(

const cellStyles = tv({
extend: focusRing,
base: 'box-border border-b border-b-neutral-200 dark:border-b-neutral-700 group-last/row:border-b-0 [--selected-border:var(--color-blue-200)] dark:[--selected-border:var(--color-blue-900)] group-selected/row:border-(--selected-border) in-[:has(+[data-selected])]:border-(--selected-border) p-2 truncate -outline-offset-2'
base: 'box-border border-b border-b-neutral-200 dark:border-b-neutral-700 group-last/row:border-b-0 [--selected-border:var(--color-blue-200)] dark:[--selected-border:var(--color-blue-900)] group-selected/row:border-(--selected-border) in-[:has(+[data-selected])]:border-(--selected-border) p-2 truncate -outline-offset-2 group-last/row:first:rounded-bl-lg group-last/row:last:rounded-br-lg'
});

export function Cell(props: CellProps) {
Expand Down
2 changes: 1 addition & 1 deletion starters/tailwind/src/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { composeTailwindRenderProps, focusRing } from './utils';

const itemStyles = tv({
extend: focusRing,
base: 'relative font-sans w-48 flex group gap-3 cursor-default select-none py-1 px-3 text-sm text-neutral-900 dark:text-neutral-200 bg-white dark:bg-neutral-900 border-y dark:border-y-neutral-700 border-transparent first:border-t-0 last:border-b-0 -mb-px last:mb-0 -outline-offset-2',
base: 'relative font-sans w-48 flex group gap-3 cursor-default select-none py-1 px-3 text-sm text-neutral-900 dark:text-neutral-200 bg-white dark:bg-neutral-900 border-t dark:border-t-neutral-700 border-transparent first:border-t-0 -outline-offset-2 first:rounded-t-lg last:rounded-b-lg',
variants: {
isSelected: {
false: 'hover:bg-neutral-100 dark:hover:bg-neutral-800',
Expand Down