Skip to content

Commit 5b4ce50

Browse files
authored
refactor: Remove @adobe/react-spectrum imports where prohibited (#2198)
Fixes #2195 Had to just ignore some of the errors because we compare spectrum components in the styleguide and I didn't want to mess with that for now. I still think it's a bit confusing that there are things in `components/src/spectrum` that aren't pure re-exports (e.g. ComboBox). Makes it confusing to know which to use.
1 parent 34befe2 commit 5b4ce50

18 files changed

Lines changed: 35 additions & 34 deletions

.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ module.exports = {
2525
},
2626
{
2727
name: '@adobe/react-spectrum',
28-
message:
29-
'Import from @deephaven/components instead of @adobe/react-spectrum.',
28+
message: `Import from ${
29+
packageName === '@deephaven/components'
30+
? './spectrum'
31+
: '@deephaven/components'
32+
} instead of @adobe/react-spectrum.`,
3033
},
3134
],
3235
},

packages/app-utils/src/plugins/remote-component.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import react from 'react';
77
import * as redux from 'redux';
88
import * as reactRedux from 'react-redux';
99
import ReactDOM from 'react-dom';
10+
// eslint-disable-next-line no-restricted-imports
1011
import * as AdobeReactSpectrum from '@adobe/react-spectrum';
1112
import * as DeephavenAuthPlugins from '@deephaven/auth-plugins';
1213
import * as DeephavenChart from '@deephaven/chart';

packages/code-studio/src/styleguide/GotoTopButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useCallback, useEffect } from 'react';
2+
// eslint-disable-next-line no-restricted-imports
23
import { Button, Icon } from '@adobe/react-spectrum';
34
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
45
import { vsChevronUp } from '@deephaven/icons';

packages/code-studio/src/styleguide/Grids.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from '@deephaven/grid';
99
import { IrisGrid } from '@deephaven/iris-grid';
1010
import { useApi } from '@deephaven/jsapi-bootstrap';
11-
import { Flex } from '@adobe/react-spectrum';
11+
import { Flex } from '@deephaven/components';
1212
import MockIrisGridTreeModel from './MockIrisGridTreeModel';
1313
import StaticExample from './grid-examples/StaticExample';
1414
import QuadrillionExample from './grid-examples/QuadrillionExample';

packages/code-studio/src/styleguide/Icons.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import {
66
dhSquareFilled,
77
dhAddSmall,
88
} from '@deephaven/icons';
9-
import { Icon } from '@adobe/react-spectrum';
109
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
11-
import { Button } from '@deephaven/components';
10+
import { Button, Icon } from '@deephaven/components';
1211
import PropTypes from 'prop-types';
1312
import SampleSection from './SampleSection';
1413

packages/code-studio/src/styleguide/Pickers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
ComboBox,
55
ComboBoxNormalized,
66
Flex,
7+
Icon,
78
Item,
89
ItemKey,
910
PICKER_ITEM_HEIGHTS,
@@ -14,7 +15,6 @@ import {
1415
Text,
1516
} from '@deephaven/components';
1617
import { vsPerson } from '@deephaven/icons';
17-
import { Icon } from '@adobe/react-spectrum';
1818
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
1919
import { getPositionOfSelectedItem } from '@deephaven/react-hooks';
2020
import { generateItemElements, generateNormalizedItems } from './utils';

packages/code-studio/src/styleguide/SamplesMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Key, useCallback, useEffect, useState } from 'react';
2+
// eslint-disable-next-line no-restricted-imports
23
import {
34
ActionButton,
45
Icon,

packages/code-studio/src/styleguide/SpectrumComparison.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable react/style-prop-object */
22
import React, { Fragment, useState } from 'react';
3+
// eslint-disable-next-line no-restricted-imports
34
import {
45
ActionButton,
56
Button,

packages/code-studio/src/styleguide/SpectrumComponents.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable react/style-prop-object */
22
import React from 'react';
3+
// eslint-disable-next-line no-restricted-imports
34
import {
45
ActionButton,
56
Button,

packages/components/src/BulkActionBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ActionBar } from '@adobe/react-spectrum';
21
import type { StyleProps } from '@react-types/shared';
2+
import { ActionBar } from './spectrum';
33
import commonStyles from './SpectrumComponent.module.scss';
44

55
export interface BulkActionBarProps {

0 commit comments

Comments
 (0)