diff --git a/package.json b/package.json index 09950e9..c138a9c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@dzeio/components", - "version": "0.7.0", + "version": "0.8.0", "license": "MIT", - "main": "./index.mjs", + "main": "./index.js", "types": "./types/index.d.ts", "devDependencies": { "@babel/core": "^7.12.16", diff --git a/rollup.config.js b/rollup.config.js index 8610643..61489b9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,14 +12,16 @@ export default [ url: false, autoModules: true, mode: 'extract', - + modules: { + generateScopedName: '[local][hash:5]' + } }), typescript({useTsconfigDeclarationDir: true}), // so Rollup can convert TypeScript to JavaScript ], output: [ { file: pkg.main, - format: 'es', + format: 'cjs', assetFileNames: 'style.css' } ] diff --git a/src/dzeio/GradientBackground/GradientBackground.module.styl b/src/dzeio/GradientBackground/GradientBackground.module.styl index de2492c..4b90860 100644 --- a/src/dzeio/GradientBackground/GradientBackground.module.styl +++ b/src/dzeio/GradientBackground/GradientBackground.module.styl @@ -1,34 +1,29 @@ @import "../config" -$transparent = 75% +$transparent = 15% .back transition all $transition - background linear-gradient(to left, $default, transparentify($default, $transparent)) + background $mainGradient -.primary - $color = $primary - background linear-gradient(to left, $color, transparentify($color, $transparent)) - -.secondary - $color = $secondary - background linear-gradient(to left, $color, transparentify($color, $transparent)) + &.fullscreen + min-height 100vh .info $color = $info - background linear-gradient(to left, $color, transparentify($color, $transparent)) + background linear-gradient(to left, $color, lighten($color, $transparent)) .success $color = $success - background linear-gradient(to left, $color, transparentify($color, $transparent)) + background linear-gradient(to left, $color, lighten($color, $transparent)) .danger $color = $danger - background linear-gradient(to left, $color, transparentify($color, $transparent)) + background linear-gradient(to left, $color, lighten($color, $transparent)) .warning $color = $warning - background linear-gradient(to left, $color, transparentify($color, $transparent)) + background linear-gradient(to left, $color, lighten($color, $transparent)) @media (prefers-color-scheme dark) .back diff --git a/src/dzeio/GradientBackground/index.tsx b/src/dzeio/GradientBackground/index.tsx index bd55cbf..8645fe9 100644 --- a/src/dzeio/GradientBackground/index.tsx +++ b/src/dzeio/GradientBackground/index.tsx @@ -8,12 +8,18 @@ interface Props { color?: ColorType className?: string children: React.ReactNode + fullscreen?: boolean } +/** + * Make the background a linear-gradient + * + * @version 1.0.0 + */ export default class GradientBackground extends React.Component { public render = () => ( -
+
{this.props.children}
) diff --git a/src/dzeio/Link/index.tsx b/src/dzeio/Link/index.tsx index e1ed69a..701a34c 100644 --- a/src/dzeio/Link/index.tsx +++ b/src/dzeio/Link/index.tsx @@ -24,7 +24,7 @@ interface Props { export default class Link extends React.Component { public render() { - const external = this.props.external ?? !this.props.href.startsWith('/') + const external = this.props.external ?? this.props.href.startsWith('http') if (external) { // external link return ( diff --git a/src/dzeio/Loader/index.tsx b/src/dzeio/Loader/index.tsx index 5766343..8584379 100644 --- a/src/dzeio/Loader/index.tsx +++ b/src/dzeio/Loader/index.tsx @@ -4,9 +4,22 @@ import { buildClassName } from '../Util' import css from './Loader.module.styl' interface Props { + /** + * The new Percentage (if you calculate it yourself) + */ percent?: number + + /** + * Auto random loader + */ auto?: { + /** + * the minimum and maximum interval between two increment + */ interval: [number, number] + /** + * the minimum and maximum incrementation (MUST be an integer) + */ increment: [number, number] } } @@ -15,6 +28,11 @@ interface State { percent?: number } +/** + * Display a simple loading animation at the top of the page + * + * @version 1.0.0 + */ export default class Loader extends React.Component { public state: State = {} diff --git a/src/dzeio/Navbar/index.tsx b/src/dzeio/Navbar/index.tsx index 2c924db..26f7975 100644 --- a/src/dzeio/Navbar/index.tsx +++ b/src/dzeio/Navbar/index.tsx @@ -21,7 +21,7 @@ interface Props { /** * Logo to display */ - logo: ImageProps & {height: number, width: number} + logo?: ImageProps & {height: number, width: number} /** * Login URL */ @@ -82,7 +82,7 @@ interface State { /** * Navbar/Sidebar Component - * @version 1.0.0 + * @version 1.0.1 */ export default class Navbar extends React.Component { @@ -164,11 +164,13 @@ export default class Navbar extends React.Component { <>