refactor: drip stitches exports (#210)
This commit is contained in:
parent
389d6511b3
commit
df3e59f8a3
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class CardStyles {
|
export abstract class CardStyles {
|
||||||
static readonly Container = styled('div', {
|
static readonly Container = styled('div', {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import * as Avatar from '@radix-ui/react-avatar';
|
import * as Avatar from '@radix-ui/react-avatar';
|
||||||
|
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class AvatarStyles {
|
export abstract class AvatarStyles {
|
||||||
static readonly Root = styled(Avatar.Root, {
|
static readonly Root = styled(Avatar.Root, {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { dripStitches } from '../../../theme'; //TODO replace with absolute path
|
import { styled } from '@/theme';
|
||||||
import { Flex, Grid } from '../../layout';
|
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
import { Flex, Grid } from '../../layout';
|
||||||
|
|
||||||
export const StyledButtonContentGrid = styled(Grid, {
|
export const StyledButtonContentGrid = styled(Grid, {
|
||||||
gap: '$0h',
|
gap: '$0h',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '../../../theme'; //TODO replace with absolute path
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const StyledButtonIconSpan = styled('span', {
|
export const StyledButtonIconSpan = styled('span', {
|
||||||
all: 'unset',
|
all: 'unset',
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { dripStitches } from '../../../theme'; //TODO replace with absolute path
|
import { styled } from '@/theme';
|
||||||
import { Flex, Grid } from '../../layout';
|
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
import { Flex, Grid } from '../../layout';
|
||||||
|
|
||||||
export const StyledButtonSpinnerBox = styled(Flex, {
|
export const StyledButtonSpinnerBox = styled(Flex, {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { HTMLAttributes, useMemo } from 'react';
|
import React, { HTMLAttributes, useMemo } from 'react';
|
||||||
|
|
||||||
import { dripStitches } from '../../../theme'; //TODO replace with absolute path
|
import { keyframes } from '@/theme';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ButtonSpinnerProps,
|
ButtonSpinnerProps,
|
||||||
StyledButtonSpinnerBox,
|
StyledButtonSpinnerBox,
|
||||||
|
|
@ -35,8 +36,6 @@ export const ButtonSpinner: React.FC<ButtonSpinnerProps> = (props) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { keyframes } = dripStitches;
|
|
||||||
|
|
||||||
const blink = keyframes({
|
const blink = keyframes({
|
||||||
'0%': { opacity: 0.2 },
|
'0%': { opacity: 0.2 },
|
||||||
'50%': { opacity: 1 },
|
'50%': { opacity: 1 },
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { CSS } from '@stitches/react';
|
import { CSS } from '@stitches/react';
|
||||||
|
|
||||||
import { dripStitches } from '../../../theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
type StyledButtonProps = React.ComponentPropsWithRef<typeof StyledButton>;
|
type StyledButtonProps = React.ComponentPropsWithRef<typeof StyledButton>;
|
||||||
export interface ButtonProps extends StyledButtonProps {
|
export interface ButtonProps extends StyledButtonProps {
|
||||||
|
|
@ -149,8 +149,6 @@ const getButtonCompoundVariant = ({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const StyledButton = styled('button', {
|
export const StyledButton = styled('button', {
|
||||||
all: 'unset',
|
all: 'unset',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '../../../theme'; //TODO replace for absolute path
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class IconStyles {
|
export abstract class IconStyles {
|
||||||
static readonly Container = styled('span', {
|
static readonly Container = styled('span', {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { Flex } from '@/components/layout';
|
import { Flex } from '@/components/layout';
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class InputFileStyles {
|
export abstract class InputFileStyles {
|
||||||
static readonly Container = styled(Flex, {
|
static readonly Container = styled(Flex, {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
import { Icon } from '../icon';
|
import { Icon } from '../icon';
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
all: 'unset',
|
all: 'unset',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const Separator = styled('hr', {
|
export const Separator = styled('hr', {
|
||||||
borderTop: '1px solid $slate6',
|
borderTop: '1px solid $slate6',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const Text = styled('span');
|
export const Text = styled('span');
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { dripStitches } from '../../theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
import { Flex } from '../layout';
|
import { Flex } from '../layout';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
export abstract class FormStyles {
|
export abstract class FormStyles {
|
||||||
static readonly Field = styled(Flex, {
|
static readonly Field = styled(Flex, {
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { dripStitches } from '../../theme'; //TODO replace with absolute path
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const Flex = styled('div', {
|
export const Flex = styled('div', {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '../../theme'; //TODO replace with absolute path
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const Grid = styled('div', {
|
export const Grid = styled('div', {
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
import { Flex } from '../flex.styles';
|
import { Flex } from '../flex.styles';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
export abstract class NavBarStyles {
|
export abstract class NavBarStyles {
|
||||||
static readonly Container = styled('header', {
|
static readonly Container = styled('header', {
|
||||||
position: 'sticky',
|
position: 'sticky',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class PageStyles {
|
export abstract class PageStyles {
|
||||||
public static readonly Container = styled('div', {
|
public static readonly Container = styled('div', {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { keyframes, styled } from '@/theme';
|
||||||
|
|
||||||
const { styled, keyframes } = dripStitches;
|
|
||||||
|
|
||||||
const SkeletonKeyframes = keyframes({
|
const SkeletonKeyframes = keyframes({
|
||||||
'0%': {
|
'0%': {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '../../../theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class StepperStyles {
|
export abstract class StepperStyles {
|
||||||
static readonly Rail = styled('div', {
|
static readonly Rail = styled('div', {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
import { Flex } from '../layout';
|
import { Flex } from '../layout';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
export abstract class LogoStyles {
|
export abstract class LogoStyles {
|
||||||
static readonly Container = styled(Flex, {
|
static readonly Container = styled(Flex, {
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
import { Skeleton } from '../layout';
|
import { Skeleton } from '../layout';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const NFACardStyles = {
|
export const NFACardStyles = {
|
||||||
Container: styled(Link, {
|
Container: styled(Link, {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import { dripStitches, forwardStyledRef } from '@/theme';
|
import { forwardStyledRef, styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
const StyledSVG = styled('svg');
|
const StyledSVG = styled('svg');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class SpinnerStyles {
|
export abstract class SpinnerStyles {
|
||||||
static readonly Container = styled('svg', {
|
static readonly Container = styled('svg', {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
import * as ToastLib from '@radix-ui/react-toast';
|
import * as ToastLib from '@radix-ui/react-toast';
|
||||||
|
|
||||||
import { dripStitches } from '@/theme';
|
import { keyframes, styled } from '@/theme';
|
||||||
|
|
||||||
import { Icon, IconButton } from '../core';
|
import { Icon, IconButton } from '../core';
|
||||||
import { Flex } from '../layout';
|
import { Flex } from '../layout';
|
||||||
|
|
||||||
const { styled, keyframes } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class ToastStyles {
|
export abstract class ToastStyles {
|
||||||
static readonly Provider = ToastLib.Provider;
|
static readonly Provider = ToastLib.Provider;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from './themes';
|
import { keyframes } from './themes';
|
||||||
|
|
||||||
const { keyframes } = dripStitches;
|
|
||||||
|
|
||||||
export const KeyFrames = {
|
export const KeyFrames = {
|
||||||
slideUpAndFade: keyframes({
|
slideUpAndFade: keyframes({
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export interface CreateDripStitchesConfig<
|
||||||
utils?: ConfigType.Utils<Utils>;
|
utils?: ConfigType.Utils<Utils>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createDripStitches = <
|
const createDripStitches = <
|
||||||
Prefix extends string = '',
|
Prefix extends string = '',
|
||||||
Media extends {} = {},
|
Media extends {} = {},
|
||||||
Theme extends {} = {},
|
Theme extends {} = {},
|
||||||
|
|
@ -131,4 +131,17 @@ export const createDripStitches = <
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dripStitches = createDripStitches();
|
export const {
|
||||||
|
styled,
|
||||||
|
css,
|
||||||
|
config,
|
||||||
|
globalCss,
|
||||||
|
createTheme,
|
||||||
|
darkTheme,
|
||||||
|
darkThemeSelector,
|
||||||
|
getCssText,
|
||||||
|
keyframes,
|
||||||
|
prefix,
|
||||||
|
theme,
|
||||||
|
reset,
|
||||||
|
} = createDripStitches();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { Flex } from '@/components';
|
import { Flex } from '@/components';
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class Explore {
|
export abstract class Explore {
|
||||||
static readonly Container = styled(Flex, {
|
static readonly Container = styled(Flex, {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { Flex } from '@/components';
|
import { Flex } from '@/components';
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export abstract class Header {
|
export abstract class Header {
|
||||||
static readonly Container = styled(Flex, {
|
static readonly Container = styled(Flex, {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { dripStitches } from '@/theme';
|
import { styled } from '@/theme';
|
||||||
|
|
||||||
const { styled } = dripStitches;
|
|
||||||
|
|
||||||
export const ResultsContainer = styled('div', {
|
export const ResultsContainer = styled('div', {
|
||||||
fontSize: '$xl',
|
fontSize: '$xl',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue