react-themes

UI theme composition with CSS Modules and React

OTHER License

Downloads
990
Stars
1
Committers
2

Bot releases are hidden (Show)

react-themes - v1.7.0 Latest Release

Published by birdofpreyru 4 months ago

Breaking Changes

  • [#63] As propTypes checks are deprecated in React v19, the following related changes have been done in this library:
    • Removed optional themeSchema argument of themed() function.

    • Removed castTheme property, and themeType field of themed components.

    • TypeScript: Theme type's generic argument is changed to be a union of string literals, rather than a typeof constant string array; i.e. type definitions for themes should be updated in the following manner:

      Before:

      import { type Theme } from '@dr.pogodin/react-themes';
      
      const validKeys = ['keyA', 'keyB'] as const;
      
      type BaseComponentPropsT = {
        theme: Theme<typeof validKeys>;
      };
      
      const BaseComponent: React.FunctionComponent<BaseComponentPropsT> = ...
      
      const ThemedComponent = themed(BaseComponent, 'ThemedComponent', validKeys);
      

      Now:

      import { type Theme } from '@dr.pogodin/react-themes';
      
      type BaseComponentPropsT = {
        theme: Theme<'keyA' | 'keyB'>;
      };
      
      const BaseComponent: React.FunctionComponent<BaseComponentPropsT> = ...
      
      const ThemedComponent = themed(BaseComponent, 'ThemedComponent');
      

Other Updates

  • Update of dependencies.
react-themes - v1.6.2

Published by birdofpreyru 5 months ago

  • [#61] Update of dependencies
react-themes - v1.6.1

Published by birdofpreyru 6 months ago

  • Update of dependencies.
react-themes - v1.6.0

Published by birdofpreyru 10 months ago

Breaking Changes

  • [#56] Typescript: Improves theme typing.

    This is a breaking change for TypeScript projects, as it requires corresponding code updates.

    Before:

    import themed, { type Theme } from '@dr.pogodin/react-themes';
    
    type ComponentPropsT = {
      theme: Theme & {
        keyA?: string;
        keyB?: string;
      };
    };
    
    const Component: React.FunctionComponent<ComponentPropsT> = ...
    
    const ThemedComponent = themed(Component, 'Component', [
      'keyA',
      'keyB',
    ]);
    

    Now:

    import themed, { type Theme } from '@dr.pogodin/react-themes';
    
    const validKeys = ['keyA', 'keyB'] as const;
    
    type ComponentPropsT = {
      theme: Theme<typeof validKeys>;
    };
    
    const Component: React.FunctionComponent<ComponentPropsT> = ...
    
    const ThemedComponent = themed(Component, 'Component', validKeys);
    

Other Updates

  • Updates dependencies.
react-themes - v1.5.1

Published by birdofpreyru 12 months ago

  • TypeScript: Minor fixes.
react-themes - v1.5.0

Published by birdofpreyru almost 1 year ago

  • [#55] Migrates the codebase to TypeScript (the packaged library now includes both JavaScript build with TS type definitions, and TypeScript sources).
  • Drops «compatibility mode» (optional emulation of similar, older react-css-themr and react-css-super-themr libraries).
  • Updates dependencies.
react-themes - v1.4.9

Published by birdofpreyru about 1 year ago

  • Updates dependencies.
react-themes - v1.4.8

Published by birdofpreyru over 1 year ago

  • Updates dependencies.
react-themes - v1.4.7

Published by birdofpreyru almost 2 years ago

  • Updates dependencies.
react-themes - v1.4.6

Published by birdofpreyru almost 2 years ago

  • Updates dependencies.
react-themes - v1.4.5

Published by birdofpreyru about 2 years ago

  • Updates dependencies.
react-themes - v1.4.4

Published by birdofpreyru over 2 years ago

Update of dependencies.

react-themes - v1.4.3

Published by birdofpreyru over 2 years ago

  • Adds default export to package.json, pointing to the Node build of the lib.
  • Updates dev dependencies.
react-themes - v1.4.2

Published by birdofpreyru over 2 years ago

  • Update of dependencies. In particular, declares compatibility with react@18 as peer dependency.
react-themes - v1.4.1

Published by birdofpreyru over 2 years ago

  • Returns "main" entry into package.json. It points to CommonJS build for Node LTS, and serves as a fallback for environments not recognizing "exports" object.
react-themes - v1.4.0

Published by birdofpreyru over 2 years ago

Breaking Change

  • Reworked library entry point. It now uses "exports" object in package.json to export CommonJS module for Node (build for the current LTS 16.14.0), and ES module for web bundlers (otherwise build for default browserslist browsers). Presumably, it should not be a breaking change, but just in case be careful about it.

Misc Updates

  • Updated development dependencies.
react-themes - v1.3.3

Published by birdofpreyru about 3 years ago

Maintenance release: no functional changes.

Internal Updates

  • Updated dependencies (mostly - development ones).
  • Reworked documentation.
  • Improved library entry-point: if Node environment is detected, but for any reason the node build of the library fails to load (most probably because it is not a true Node environment, but some sort of non-complete emulation) the library silently fallsback to web version (which is functionally the same, but targets older version of JS, thus compatible, but somewhat less efficient in Node).
react-themes - v1.3.2

Published by birdofpreyru over 3 years ago

react-themes - v1.3.1

Published by birdofpreyru almost 4 years ago

  • [#19] Fix: In case of nested <ThemeProvider>s it prevents the child <ThemeProvider> from shadowing any themes from parent <ThemeProvider>, which are not explicitly overriden (provided) by the child provider.
  • Updates dependencies.
react-themes - v1.3.0

Published by birdofpreyru about 4 years ago

Breaking

  • Adopts the New JSX Transform; it is only compatible with React >= 16.14.0, 15.7.0, 0.14.10.

Updates

  • Updates dependencies.