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