Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom cursor icons back #3649

Merged
merged 9 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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 .parcelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"docs:*.{js,ts,tsx,json}": ["parcel-transformer-docs", "@parcel/transformer-inline"],
"docs-json:*.{js,ts,tsx,json}": ["parcel-transformer-docs"],
"packages/*/*/intl/*.json": ["parcel-transformer-intl"],
"data-url:*.svg": ["@parcel/transformer-svg", "@parcel/transformer-inline-string"],
"*.{md,mdx}": ["parcel-transformer-mdx-docs"],
"*.svg": ["@parcel/transformer-svg-react"],
"*.css": ["...", "parcel-transformer-css-env"],
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions packages/@adobe/spectrum-css-temp/components/table/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -496,19 +496,6 @@ svg.spectrum-Table-sortedIcon {
}
}

.resize-ew,
.spectrum-Table-columnResizer--ewresize {
cursor: ew-resize !important;
}
.resize-e,
.spectrum-Table-columnResizer--eresize {
cursor: e-resize !important;
}
.resize-w,
.spectrum-Table-columnResizer--wresize {
cursor: w-resize !important;
}

@media (forced-colors: active) {
.spectrum-Table-row {
&:focus-ring {
Expand Down
17 changes: 9 additions & 8 deletions packages/@react-spectrum/table/src/Resizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import intlMessages from '../intl/*.json';
import {mergeProps} from '@react-aria/utils';
import React, {Key, RefObject, useEffect, useState} from 'react';
import ReactDOM from 'react-dom';
import rspStyles from './table.css';
import styles from '@adobe/spectrum-css-temp/components/table/vars.css';
import {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';
import {useTableColumnResize} from '@react-aria/table';
Expand All @@ -25,9 +26,9 @@ interface ResizerProps<T> {
}

let CURSOR_CLASSES = {
w: classNames(styles, 'resize-w'),
e: classNames(styles, 'resize-e'),
ew: classNames(styles, 'resize-ew')
w: classNames(rspStyles, 'resize-w'),
e: classNames(rspStyles, 'resize-e'),
ew: classNames(rspStyles, 'resize-ew')
};

function Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {
Expand Down Expand Up @@ -116,11 +117,11 @@ function Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {
className={classNames(
styles,
'spectrum-Table-columnResizer',
{
'spectrum-Table-columnResizer--ewresize': !(isEResizable && isWResizable),
'spectrum-Table-columnResizer--eresize': direction === 'rtl' ? isWResizable : isEResizable,
'spectrum-Table-columnResizer--wresize': direction === 'rtl' ? isEResizable : isWResizable
}
classNames(rspStyles, {
'react-spectrum-Table-columnResizer--ewresize': !(isEResizable && isWResizable),
'react-spectrum-Table-columnResizer--eresize': direction === 'rtl' ? isWResizable : isEResizable,
'react-spectrum-Table-columnResizer--wresize': direction === 'rtl' ? isEResizable : isWResizable
})
)}
{...resizerProps}>
<VisuallyHidden>
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.
13 changes: 13 additions & 0 deletions packages/@react-spectrum/table/src/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,16 @@
width: 100%;
height: 100%;
}

.resize-ew,
.react-spectrum-Table-columnResizer--ewresize {
cursor: url('data-url:./cursors/Cur_MoveHorizontal_9_9.svg'), ew-resize !important;
}
.resize-e,
.react-spectrum-Table-columnResizer--eresize {
cursor: url('data-url:./cursors/Cur_MoveToRight_9_9.svg'), e-resize !important;
}
.resize-w,
.react-spectrum-Table-columnResizer--wresize {
cursor: url('data-url:./cursors/Cur_MoveToLeft_9_9.svg'), w-resize !important;
}