@storybook/theming

  • Version 8.1.4
  • Published
  • 737 kB
  • 4 dependencies
  • MIT license

Install

npm i @storybook/theming
yarn add @storybook/theming
pnpm add @storybook/theming

Overview

Core Storybook Components

Index

Variables

variable background

const background: {
app: string;
bar: string;
content: string;
preview: string;
gridCellSize: number;
hoverable: string;
positive: string;
negative: string;
warning: string;
critical: string;
};

    variable CacheProvider

    const CacheProvider: Provider<EmotionCache>;

      variable color

      const color: {
      primary: string;
      secondary: string;
      tertiary: string;
      ancillary: string;
      orange: string;
      gold: string;
      green: string;
      seafoam: string;
      purple: string;
      ultraviolet: string;
      lightest: string;
      lighter: string;
      light: string;
      mediumlight: string;
      medium: string;
      mediumdark: string;
      dark: string;
      darker: string;
      darkest: string;
      border: string;
      positive: string;
      negative: string;
      warning: string;
      critical: string;
      defaultText: string;
      inverseText: string;
      positiveText: string;
      negativeText: string;
      warningText: string;
      };

        variable ignoreSsrWarning

        const ignoreSsrWarning: string;

          variable jsx

          const jsx: any;

            variable styled

            const styled: CreateStyled;

              variable ThemeProvider

              const ThemeProvider: ThemeProvider;

                variable themes

                const themes: { light: ThemeVars; dark: ThemeVars; normal: ThemeVars };

                  variable typography

                  const typography: {
                  fonts: { base: string; mono: string };
                  weight: { regular: number; bold: number };
                  size: {
                  s1: number;
                  s2: number;
                  s3: number;
                  m1: number;
                  m2: number;
                  m3: number;
                  l1: number;
                  l2: number;
                  l3: number;
                  code: number;
                  };
                  };

                    variable withTheme

                    const withTheme: withTheme;

                      Functions

                      function ClassNames

                      ClassNames: (props: ClassNamesProps) => ReactElement;
                      • JSX generic are supported only after TS@2.9

                      function convert

                      convert: (inherit?: ThemeVars) => StorybookTheme;

                        function create

                        create: (vars?: ThemeVarsPartial, rest?: Rest) => ThemeVars;

                          function createCache

                          createCache: (options: Options) => EmotionCache;

                            function createGlobal

                            createGlobal: ({
                            color,
                            background,
                            typography,
                            }: {
                            color: Color;
                            background: Background;
                            typography: Typography;
                            }) => Return;

                              function createReset

                              createReset: ({ typography }: { typography: Typography }) => Return;

                                function css

                                css: {
                                (
                                template: TemplateStringsArray,
                                ...args: Array<CSSInterpolation>
                                ): SerializedStyles;
                                (...args: CSSInterpolation[]): SerializedStyles;
                                };

                                  function darken

                                  darken: (color: string) => string;

                                    function ensure

                                    ensure: (input: ThemeVars) => StorybookTheme;

                                      function Global

                                      Global: (props: GlobalProps) => ReactElement;
                                      • JSX generic are supported only after TS@2.9

                                      function isPropValid

                                      isPropValid: (prop: string) => boolean;

                                        function keyframes

                                        keyframes: {
                                        (template: TemplateStringsArray, ...args: Array<CSSInterpolation>): Keyframes;
                                        (...args: CSSInterpolation[]): Keyframes;
                                        };

                                          function lighten

                                          lighten: (color: string) => string;

                                            function useTheme

                                            useTheme: () => Theme;

                                              Interfaces

                                              interface Brand

                                              interface Brand {}

                                                property image

                                                image: string | null | undefined;

                                                  property target

                                                  target: string | null | undefined;

                                                    property title

                                                    title: string | undefined;

                                                      property url

                                                      url: string | null | undefined;

                                                        interface CSSObject

                                                        interface CSSObject
                                                        extends CSSPropertiesWithMultiValues,
                                                        CSSPseudos,
                                                        CSSOthersObject {}

                                                          interface StorybookTheme

                                                          interface StorybookTheme {}

                                                            property animation

                                                            animation: Animation;

                                                              property appBorderColor

                                                              appBorderColor: string;

                                                                property appBorderRadius

                                                                appBorderRadius: number;

                                                                  property background

                                                                  background: Background;

                                                                    property barBg

                                                                    barBg: string;

                                                                      property barHoverColor

                                                                      barHoverColor: string;

                                                                        property barSelectedColor

                                                                        barSelectedColor: string;

                                                                          property barTextColor

                                                                          barTextColor: string;

                                                                            property brand

                                                                            brand: Brand;

                                                                              property code

                                                                              code: {
                                                                              [key: string]: string | object;
                                                                              };

                                                                                property color

                                                                                color: Color;

                                                                                  property easing

                                                                                  easing: Easing;

                                                                                    property input

                                                                                    input: {
                                                                                    border: string;
                                                                                    background: string;
                                                                                    color: string;
                                                                                    borderRadius: number;
                                                                                    };

                                                                                      property layoutMargin

                                                                                      layoutMargin: number;

                                                                                        property typography

                                                                                        typography: Typography;

                                                                                          index signature

                                                                                          [key: string]: any;

                                                                                            interface StyledComponent

                                                                                            interface StyledComponent<
                                                                                            ComponentProps extends {},
                                                                                            SpecificComponentProps extends {} = {},
                                                                                            JSXProps extends {} = {}
                                                                                            > extends React$1.FC<ComponentProps & SpecificComponentProps & JSXProps>,
                                                                                            ComponentSelector {}

                                                                                            method withComponent

                                                                                            withComponent: {
                                                                                            <C extends React$1.ComponentClass<React$1.ComponentProps<C>>>(
                                                                                            component: C
                                                                                            ): StyledComponent<
                                                                                            ComponentProps & PropsOf<C>,
                                                                                            {},
                                                                                            { ref?: React$1.Ref<InstanceType<C>> }
                                                                                            >;
                                                                                            <C extends React$1.ComponentType<React$1.ComponentProps<C>>>(
                                                                                            component: C
                                                                                            ): StyledComponent<any, {}, {}>;
                                                                                            <Tag extends string | number | symbol>(tag: Tag): StyledComponent<
                                                                                            ComponentProps,
                                                                                            JSX.IntrinsicElements,
                                                                                            {}
                                                                                            >;
                                                                                            };

                                                                                              interface Theme

                                                                                              interface Theme {}

                                                                                                interface Theme

                                                                                                interface Theme extends StorybookTheme {}

                                                                                                  interface ThemeProvider

                                                                                                  interface ThemeProvider {}

                                                                                                    call signature

                                                                                                    (props: ThemeProviderProps): React$1.ReactElement;

                                                                                                      interface ThemeVars

                                                                                                      interface ThemeVars extends ThemeVarsBase, ThemeVarsColors {}

                                                                                                        interface ThemeVarsColors

                                                                                                        interface ThemeVarsColors {}

                                                                                                          property appBg

                                                                                                          appBg: string;

                                                                                                            property appBorderColor

                                                                                                            appBorderColor: string;

                                                                                                              property appBorderRadius

                                                                                                              appBorderRadius: number;

                                                                                                                property appContentBg

                                                                                                                appContentBg: string;

                                                                                                                  property appPreviewBg

                                                                                                                  appPreviewBg: string;

                                                                                                                    property barBg

                                                                                                                    barBg: string;

                                                                                                                      property barHoverColor

                                                                                                                      barHoverColor: string;

                                                                                                                        property barSelectedColor

                                                                                                                        barSelectedColor: string;

                                                                                                                          property barTextColor

                                                                                                                          barTextColor: string;

                                                                                                                            property booleanBg

                                                                                                                            booleanBg: string;

                                                                                                                              property booleanSelectedBg

                                                                                                                              booleanSelectedBg: string;

                                                                                                                                property brandImage

                                                                                                                                brandImage?: string;

                                                                                                                                  property brandTarget

                                                                                                                                  brandTarget?: string;

                                                                                                                                    property brandTitle

                                                                                                                                    brandTitle?: string;

                                                                                                                                      property brandUrl

                                                                                                                                      brandUrl?: string;

                                                                                                                                        property buttonBg

                                                                                                                                        buttonBg: string;

                                                                                                                                          property buttonBorder

                                                                                                                                          buttonBorder: string;

                                                                                                                                            property colorPrimary

                                                                                                                                            colorPrimary: string;

                                                                                                                                              property colorSecondary

                                                                                                                                              colorSecondary: string;

                                                                                                                                                property fontBase

                                                                                                                                                fontBase: string;

                                                                                                                                                  property fontCode

                                                                                                                                                  fontCode: string;

                                                                                                                                                    property gridCellSize

                                                                                                                                                    gridCellSize?: number;

                                                                                                                                                      property inputBg

                                                                                                                                                      inputBg: string;

                                                                                                                                                        property inputBorder

                                                                                                                                                        inputBorder: string;

                                                                                                                                                          property inputBorderRadius

                                                                                                                                                          inputBorderRadius: number;

                                                                                                                                                            property inputTextColor

                                                                                                                                                            inputTextColor: string;

                                                                                                                                                              property textColor

                                                                                                                                                              textColor: string;

                                                                                                                                                                property textInverseColor

                                                                                                                                                                textInverseColor: string;

                                                                                                                                                                  property textMutedColor

                                                                                                                                                                  textMutedColor: string;

                                                                                                                                                                    interface ThemeVarsPartial

                                                                                                                                                                    interface ThemeVarsPartial extends ThemeVarsBase, Partial<ThemeVarsColors> {}

                                                                                                                                                                      Type Aliases

                                                                                                                                                                      type Animation

                                                                                                                                                                      type Animation = typeof animation;

                                                                                                                                                                        type Background

                                                                                                                                                                        type Background = typeof background;

                                                                                                                                                                          type Color

                                                                                                                                                                          type Color = typeof color;

                                                                                                                                                                            type Easing

                                                                                                                                                                            type Easing = typeof easing;

                                                                                                                                                                              type FunctionInterpolation

                                                                                                                                                                              type FunctionInterpolationEnhanced<T = {}> = FunctionInterpolation<
                                                                                                                                                                              T & {
                                                                                                                                                                              theme: StorybookTheme;
                                                                                                                                                                              }
                                                                                                                                                                              >;

                                                                                                                                                                                type Interpolation

                                                                                                                                                                                type InterpolationEnhanced<T = {}> = Interpolation<
                                                                                                                                                                                T & {
                                                                                                                                                                                theme: StorybookTheme;
                                                                                                                                                                                }
                                                                                                                                                                                >;

                                                                                                                                                                                  type Keyframes

                                                                                                                                                                                  type Keyframes = {
                                                                                                                                                                                  name: string;
                                                                                                                                                                                  styles: string;
                                                                                                                                                                                  anim: number;
                                                                                                                                                                                  toString: () => string;
                                                                                                                                                                                  } & string;

                                                                                                                                                                                    type TextSize

                                                                                                                                                                                    type TextSize = number | string;

                                                                                                                                                                                      type Typography

                                                                                                                                                                                      type Typography = typeof typography;

                                                                                                                                                                                        type withTheme

                                                                                                                                                                                        type withTheme = <C extends React$1.ComponentType<React$1.ComponentProps<C>>>(
                                                                                                                                                                                        component: C
                                                                                                                                                                                        ) => React$1.FC<DistributiveOmit<PropsOf<C>, 'theme'> & { theme?: Theme }>;

                                                                                                                                                                                          Namespaces

                                                                                                                                                                                          namespace EmotionJSX

                                                                                                                                                                                          namespace EmotionJSX {}

                                                                                                                                                                                            interface Element

                                                                                                                                                                                            interface Element extends ReactJSXElement {}

                                                                                                                                                                                              interface ElementAttributesProperty

                                                                                                                                                                                              interface ElementAttributesProperty extends ReactJSXElementAttributesProperty {}

                                                                                                                                                                                                interface ElementChildrenAttribute

                                                                                                                                                                                                interface ElementChildrenAttribute extends ReactJSXElementChildrenAttribute {}

                                                                                                                                                                                                  interface ElementClass

                                                                                                                                                                                                  interface ElementClass extends ReactJSXElementClass {}

                                                                                                                                                                                                    interface IntrinsicAttributes

                                                                                                                                                                                                    interface IntrinsicAttributes extends ReactJSXIntrinsicAttributes {}

                                                                                                                                                                                                      interface IntrinsicClassAttributes

                                                                                                                                                                                                      interface IntrinsicClassAttributes<T> extends ReactJSXIntrinsicClassAttributes<T> {}

                                                                                                                                                                                                        type ElementType

                                                                                                                                                                                                        type ElementType = ReactJSXElementType;

                                                                                                                                                                                                          type IntrinsicElements

                                                                                                                                                                                                          type IntrinsicElements = {
                                                                                                                                                                                                          [K in keyof ReactJSXIntrinsicElements]: ReactJSXIntrinsicElements[K] & {
                                                                                                                                                                                                          css?: Interpolation<Theme>;
                                                                                                                                                                                                          };
                                                                                                                                                                                                          };

                                                                                                                                                                                                            type LibraryManagedAttributes

                                                                                                                                                                                                            type LibraryManagedAttributes<C, P> = WithConditionalCSSProp<P> &
                                                                                                                                                                                                            ReactJSXLibraryManagedAttributes<C, P>;

                                                                                                                                                                                                              namespace jsx

                                                                                                                                                                                                              namespace jsx {}

                                                                                                                                                                                                                namespace jsx.JSX

                                                                                                                                                                                                                namespace jsx.JSX {}

                                                                                                                                                                                                                  interface Element

                                                                                                                                                                                                                  interface Element extends EmotionJSX.Element {}

                                                                                                                                                                                                                    interface ElementAttributesProperty

                                                                                                                                                                                                                    interface ElementAttributesProperty extends EmotionJSX.ElementAttributesProperty {}

                                                                                                                                                                                                                      interface ElementChildrenAttribute

                                                                                                                                                                                                                      interface ElementChildrenAttribute extends EmotionJSX.ElementChildrenAttribute {}

                                                                                                                                                                                                                        interface ElementClass

                                                                                                                                                                                                                        interface ElementClass extends EmotionJSX.ElementClass {}

                                                                                                                                                                                                                          interface IntrinsicAttributes

                                                                                                                                                                                                                          interface IntrinsicAttributes extends EmotionJSX.IntrinsicAttributes {}

                                                                                                                                                                                                                            interface IntrinsicClassAttributes

                                                                                                                                                                                                                            interface IntrinsicClassAttributes<T>
                                                                                                                                                                                                                            extends EmotionJSX.IntrinsicClassAttributes<T> {}

                                                                                                                                                                                                                              type ElementType

                                                                                                                                                                                                                              type ElementType = EmotionJSX.ElementType;

                                                                                                                                                                                                                                type IntrinsicElements

                                                                                                                                                                                                                                type IntrinsicElements = EmotionJSX.IntrinsicElements;

                                                                                                                                                                                                                                  type LibraryManagedAttributes

                                                                                                                                                                                                                                  type LibraryManagedAttributes<C, P> = EmotionJSX.LibraryManagedAttributes<C, P>;

                                                                                                                                                                                                                                    Package Files (2)

                                                                                                                                                                                                                                    Dependencies (4)

                                                                                                                                                                                                                                    Dev Dependencies (11)

                                                                                                                                                                                                                                    Peer Dependencies (2)

                                                                                                                                                                                                                                    Badge

                                                                                                                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@storybook/theming.

                                                                                                                                                                                                                                    • Markdown
                                                                                                                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@storybook/theming)
                                                                                                                                                                                                                                    • HTML
                                                                                                                                                                                                                                      <a href="https://www.jsdocs.io/package/@storybook/theming"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>