Skip to content

Commit 545437a

Browse files
committed
make linearGradient/edgeToText internal only
1 parent afb1eb5 commit 545437a

File tree

7 files changed

+31
-26
lines changed

7 files changed

+31
-26
lines changed

packages/@react-spectrum/s2/src/Accordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export const Accordion = forwardRef(function Accordion(props: AccordionProps, re
8787
);
8888
});
8989

90-
// TODO: export these
9190
export interface AccordionItemState {
9291
/** Whether the accordion item is currently expanded. */
9392
readonly isExpanded: boolean,
@@ -149,6 +148,7 @@ export interface AccordionItemProps extends Omit<RenderProps<AccordionItemRender
149148
/** Whether the accordion item is expanded by default (uncontrolled). */
150149
defaultExpanded?: boolean
151150
}
151+
152152
/**
153153
* A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.
154154
*/

packages/@react-spectrum/s2/src/Button.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
import {baseColor, focusRing, fontRelative, lightDark, linearGradient, style} from '../style' with {type: 'macro'};
14-
import {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';
15-
import {centerBaseline} from './CenterBaseline';
16-
import {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};
17-
import {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';
1813
import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared';
19-
import {IconContext} from './Icon';
14+
import {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';
15+
import {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';
2016
// @ts-ignore
2117
import intlMessages from '../intl/*.json';
18+
import {baseColor, focusRing, fontRelative, lightDark, style} from '../style' with {type: 'macro'};
19+
import {linearGradient} from '../style/spectrum-theme' with {type: 'macro'};
20+
import {centerBaseline} from './CenterBaseline';
21+
import {IconContext} from './Icon';
2222
import {pressScale} from './pressScale';
2323
import {ProgressCircle} from './ProgressCircle';
2424
import {SkeletonContext} from './Skeleton';
25+
import {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};
2526
import {Text, TextContext} from './Content';
2627
import {useFocusableRef} from '@react-spectrum/utils';
2728
import {useFormProps} from './Form';

packages/@react-spectrum/s2/src/ComboBox.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13+
import {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';
14+
import {AsyncLoadable, GlobalDOMAttributes, HelpTextProps, LoadingState, SpectrumLabelableProps} from '@react-types/shared';
1315
import {
1416
ComboBox as AriaComboBox,
1517
ComboBoxProps as AriaComboBoxProps,
@@ -33,10 +35,9 @@ import {
3335
SectionProps,
3436
Virtualizer
3537
} from 'react-aria-components';
36-
import {AsyncLoadable, GlobalDOMAttributes, HelpTextProps, LoadingState, SpectrumLabelableProps} from '@react-types/shared';
38+
import {baseColor, focusRing, space, style} from '../style' with {type: 'macro'};
39+
import {edgeToText} from '../style/spectrum-theme' with {type: 'macro'};
3740
import {AvatarContext} from './Avatar';
38-
import {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';
39-
import {baseColor, edgeToText, focusRing, space, style} from '../style' with {type: 'macro'};
4041
import {centerBaseline} from './CenterBaseline';
4142
import {centerPadding, control, controlBorderRadius, controlFont, controlSize, field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
4243
import {

packages/@react-spectrum/s2/src/Menu.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13+
import {DOMRef, DOMRefValue, GlobalDOMAttributes, PressEvent} from '@react-types/shared';
14+
import {createContext, forwardRef, JSX, ReactNode, useContext, useRef, useState} from 'react';
1315
import {
1416
Menu as AriaMenu,
1517
MenuItem as AriaMenuItem,
@@ -28,15 +30,14 @@ import {
2830
Separator,
2931
SeparatorProps
3032
} from 'react-aria-components';
31-
import {baseColor, edgeToText, focusRing, fontRelative, size, space, style} from '../style' with {type: 'macro'};
32-
import {box, iconStyles} from './Checkbox';
33-
import {centerBaseline} from './CenterBaseline';
34-
import {centerPadding, control, controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
3533
import CheckmarkIcon from '../ui-icons/Checkmark';
3634
import ChevronRightIcon from '../ui-icons/Chevron';
37-
import {createContext, forwardRef, JSX, ReactNode, useContext, useRef, useState} from 'react';
35+
import {baseColor, focusRing, fontRelative, size, space, style} from '../style' with {type: 'macro'};
36+
import {edgeToText} from '../style/spectrum-theme' with {type: 'macro'};
37+
import {centerBaseline} from './CenterBaseline';
38+
import {box, iconStyles} from './Checkbox';
3839
import {divider} from './Divider';
39-
import {DOMRef, DOMRefValue, GlobalDOMAttributes, PressEvent} from '@react-types/shared';
40+
import {centerPadding, control, controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
4041
import {forwardRefType} from './types';
4142
import {HeaderContext, HeadingContext, KeyboardContext, Text, TextContext} from './Content';
4243
import {IconContext} from './Icon'; // chevron right removed??

packages/@react-spectrum/s2/src/Picker.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ import {
3333
Virtualizer
3434
} from 'react-aria-components';
3535
import {AsyncLoadable, FocusableRef, FocusableRefValue, GlobalDOMAttributes, HelpTextProps, LoadingState, PressEvent, RefObject, SpectrumLabelableProps} from '@react-types/shared';
36+
import {baseColor, focusRing, style} from '../style' with {type: 'macro'};
37+
import {edgeToText} from '../style/spectrum-theme' with {type: 'macro'};
3638
import {AvatarContext} from './Avatar';
37-
import {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};
38-
import {box, iconStyles as checkboxIconStyles} from './Checkbox';
3939
import {centerBaseline} from './CenterBaseline';
40+
import {box, iconStyles as checkboxIconStyles} from './Checkbox';
4041
import {
4142
checkbox,
4243
checkmark,

packages/@react-spectrum/s2/src/TabsPicker.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ import {
2323
Provider,
2424
SelectValue
2525
} from 'react-aria-components';
26-
import {baseColor, edgeToText, focusRing, size, style} from '../style' with {type: 'macro'};
26+
import {FocusableRef, FocusableRefValue, SpectrumLabelableProps} from '@react-types/shared';
27+
import CheckmarkIcon from '../ui-icons/Checkmark';
28+
import ChevronIcon from '../ui-icons/Chevron';
29+
import {baseColor, focusRing, size, style} from '../style' with {type: 'macro'};
30+
import {edgeToText} from '../style/spectrum-theme' with {type: 'macro'};
2731
import {centerBaseline} from './CenterBaseline';
32+
import {
33+
FieldLabel
34+
} from './Field';
2835
import {
2936
checkmark,
3037
description,
@@ -34,13 +41,7 @@ import {
3441
sectionHeader,
3542
sectionHeading
3643
} from './Menu';
37-
import CheckmarkIcon from '../ui-icons/Checkmark';
38-
import ChevronIcon from '../ui-icons/Chevron';
3944
import {controlFont, fieldInput, StyleProps} from './style-utils' with {type: 'macro'};
40-
import {
41-
FieldLabel
42-
} from './Field';
43-
import {FocusableRef, FocusableRefValue, SpectrumLabelableProps} from '@react-types/shared';
4445
import {forwardRefType} from './types';
4546
import {HeaderContext, HeadingContext, Text, TextContext} from './Content';
4647
import {IconContext} from './Icon';

packages/@react-spectrum/s2/style/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {Inset, fontRelative as internalFontRelative, space as internalSpace, Spa
1515
import type {MacroContext} from '@parcel/macros';
1616
import {StyleString} from './types';
1717

18-
export {baseColor, color, edgeToText, lightDark, linearGradient, colorMix, size, style} from './spectrum-theme';
18+
export {baseColor, color, lightDark, colorMix, size, style} from './spectrum-theme';
1919
export type {StyleString} from './types';
2020

2121
// Wrap these functions in arbitrary value syntax when called from the outside.

0 commit comments

Comments
 (0)