mirror of
https://github.com/dzeiocom/components.git
synced 2025-06-15 20:19:20 +00:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
031971b859
|
|||
1488386e1d
|
|||
26c2c50f23 | |||
c591c2f0a8 | |||
7fe816c997 | |||
7e28baf2aa | |||
b19992b57c | |||
0bb84f9946 | |||
8cddeab594 | |||
68939d8390 | |||
8186284ded | |||
e173bd2a37 | |||
754da58a68 | |||
3b314d5307 | |||
8c64a57a16
|
|||
c1e40c6789
|
|||
bd0787d0ec
|
|||
5f51088ab0
|
|||
d7a09a4dcd
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dzeio/components",
|
"name": "@dzeio/components",
|
||||||
"version": "0.7.2",
|
"version": "0.8.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"types": "./types/index.d.ts",
|
"types": "./types/index.d.ts",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "rm -rf src/dzeio/**/*.js && start-storybook -p 6006",
|
"dev": "rm -rf src/dzeio/**/*.js && start-storybook -s ./.storybook/public -p 6006",
|
||||||
"build": "rollup --config",
|
"build": "rollup --config",
|
||||||
"prepublishOnly": "yarn build",
|
"prepublishOnly": "yarn build",
|
||||||
"postinstall": "rollup --config"
|
"postinstall": "rollup --config"
|
||||||
|
@ -12,7 +12,9 @@ export default [
|
|||||||
url: false,
|
url: false,
|
||||||
autoModules: true,
|
autoModules: true,
|
||||||
mode: 'extract',
|
mode: 'extract',
|
||||||
|
modules: {
|
||||||
|
generateScopedName: '[local][hash:5]'
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
typescript({useTsconfigDeclarationDir: true}), // so Rollup can convert TypeScript to JavaScript
|
typescript({useTsconfigDeclarationDir: true}), // so Rollup can convert TypeScript to JavaScript
|
||||||
],
|
],
|
||||||
|
@ -1,34 +1,29 @@
|
|||||||
@import "../config"
|
@import "../config"
|
||||||
|
|
||||||
$transparent = 75%
|
$transparent = 15%
|
||||||
|
|
||||||
.back
|
.back
|
||||||
transition all $transition
|
transition all $transition
|
||||||
background linear-gradient(to left, $default, transparentify($default, $transparent))
|
background $mainGradient
|
||||||
|
|
||||||
.primary
|
&.fullscreen
|
||||||
$color = $primary
|
min-height 100vh
|
||||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
|
||||||
|
|
||||||
.secondary
|
|
||||||
$color = $secondary
|
|
||||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
|
||||||
|
|
||||||
.info
|
.info
|
||||||
$color = $info
|
$color = $info
|
||||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||||
|
|
||||||
.success
|
.success
|
||||||
$color = $success
|
$color = $success
|
||||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||||
|
|
||||||
.danger
|
.danger
|
||||||
$color = $danger
|
$color = $danger
|
||||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||||
|
|
||||||
.warning
|
.warning
|
||||||
$color = $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)
|
@media (prefers-color-scheme dark)
|
||||||
.back
|
.back
|
||||||
|
@ -8,12 +8,18 @@ interface Props {
|
|||||||
color?: ColorType
|
color?: ColorType
|
||||||
className?: string
|
className?: string
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
|
fullscreen?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make the background a linear-gradient
|
||||||
|
*
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
export default class GradientBackground extends React.Component<Props> {
|
export default class GradientBackground extends React.Component<Props> {
|
||||||
|
|
||||||
public render = () => (
|
public render = () => (
|
||||||
<div className={buildClassName([css.back], [css[this.props.color as string], this.props.color], [this.props.className])}>
|
<div className={buildClassName(css.back, [css[this.props.color as string], this.props.color], this.props.className)}>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -24,7 +24,7 @@ interface Props {
|
|||||||
export default class Link extends React.Component<Props> {
|
export default class Link extends React.Component<Props> {
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
const external = this.props.external ?? !this.props.href.startsWith('/')
|
const external = this.props.external ?? this.props.href.startsWith('http')
|
||||||
if (external) {
|
if (external) {
|
||||||
// external link
|
// external link
|
||||||
return (
|
return (
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
width 100%
|
width 100%
|
||||||
height 7px
|
height 7px
|
||||||
pointer-events none
|
pointer-events none
|
||||||
|
z-index 200
|
||||||
|
|
||||||
top 0
|
top 0
|
||||||
&.hide
|
&.hide
|
||||||
|
@ -4,9 +4,22 @@ import { buildClassName } from '../Util'
|
|||||||
import css from './Loader.module.styl'
|
import css from './Loader.module.styl'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
/**
|
||||||
|
* The new Percentage (if you calculate it yourself)
|
||||||
|
*/
|
||||||
percent?: number
|
percent?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto random loader
|
||||||
|
*/
|
||||||
auto?: {
|
auto?: {
|
||||||
|
/**
|
||||||
|
* the minimum and maximum interval between two increment
|
||||||
|
*/
|
||||||
interval: [number, number]
|
interval: [number, number]
|
||||||
|
/**
|
||||||
|
* the minimum and maximum incrementation (MUST be an integer)
|
||||||
|
*/
|
||||||
increment: [number, number]
|
increment: [number, number]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -15,6 +28,11 @@ interface State {
|
|||||||
percent?: number
|
percent?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a simple loading animation at the top of the page
|
||||||
|
*
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
export default class Loader extends React.Component<Props, State> {
|
export default class Loader extends React.Component<Props, State> {
|
||||||
|
|
||||||
public state: State = {}
|
public state: State = {}
|
||||||
|
@ -216,9 +216,7 @@
|
|||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
|
|
||||||
.userMenu
|
.userMenu a
|
||||||
// padding-bottom 16px
|
|
||||||
a
|
|
||||||
padding 16px 0
|
padding 16px 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ interface Props {
|
|||||||
name: string
|
name: string
|
||||||
}>
|
}>
|
||||||
/**
|
/**
|
||||||
* Internal Usem don't use it !
|
* Internal Use don't use it !
|
||||||
*/
|
*/
|
||||||
mobileMenu?: () => void
|
mobileMenu?: () => void
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,12 @@
|
|||||||
.row
|
.row
|
||||||
display flex
|
display flex
|
||||||
flex-wrap wrap
|
flex-wrap wrap
|
||||||
|
margin (0 - $gapSize) 0 0 (0 - $gapSize)
|
||||||
|
padding $gapSize
|
||||||
|
|
||||||
&:not(.nomargin)
|
&.nomargin
|
||||||
margin (0 - $gapSize) 0 0
|
.row
|
||||||
padding 0 $gapSize * 2 0 $gapSize
|
padding 0
|
||||||
|
|
||||||
.row:not(.nomargin)
|
|
||||||
padding 0
|
|
||||||
margin (0 - $gapSize) 0 0 (0 - $gapSize)
|
|
||||||
|
|
||||||
.nowrap
|
.nowrap
|
||||||
flex-wrap nowrap
|
flex-wrap nowrap
|
||||||
|
@ -12,7 +12,6 @@ interface Props {
|
|||||||
|
|
||||||
export default class Text extends React.Component<Props> {
|
export default class Text extends React.Component<Props> {
|
||||||
|
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
const classes = buildClassName(
|
const classes = buildClassName(
|
||||||
css.text,
|
css.text,
|
||||||
@ -23,16 +22,10 @@ export default class Text extends React.Component<Props> {
|
|||||||
this.props.className
|
this.props.className
|
||||||
)
|
)
|
||||||
|
|
||||||
switch (this.props.type || 'p') {
|
if (this.props.type === 'em') {
|
||||||
case 'h1': return (<h1 className={classes}>{this.props.children}</h1>)
|
return (<p className={classes}><em>{this.props.children}</em></p>)
|
||||||
case 'h2': return (<h2 className={classes}>{this.props.children}</h2>)
|
|
||||||
case 'h3': return (<h3 className={classes}>{this.props.children}</h3>)
|
|
||||||
case 'h4': return (<h4 className={classes}>{this.props.children}</h4>)
|
|
||||||
case 'h5': return (<h5 className={classes}>{this.props.children}</h5>)
|
|
||||||
case 'h6': return (<h6 className={classes}>{this.props.children}</h6>)
|
|
||||||
case 'em': return (<p className={classes}><em>{this.props.children}</em></p>)
|
|
||||||
case 'span': return (<span className={classes}>{this.props.children}</span>)
|
|
||||||
default: return (<p className={classes}>{this.props.children}</p>)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return React.createElement(this.props.type || 'p', {className: classes, children: this.props.children})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGAttributes } from 'react'
|
import { SVGAttributes } from 'react'
|
||||||
|
|
||||||
export type ColorType = 'primary' | 'info' | 'success' | 'error' | 'warning'
|
export type ColorType = 'info' | 'success' | 'error' | 'warning'
|
||||||
|
|
||||||
export interface IconProps extends SVGAttributes<SVGElement> {
|
export interface IconProps extends SVGAttributes<SVGElement> {
|
||||||
color?: string
|
color?: string
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* @summary DZEIO Component Library
|
* @summary DZEIO Component Library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import './dzeio/general.styl'
|
||||||
|
|
||||||
import Box from './dzeio/Box'
|
import Box from './dzeio/Box'
|
||||||
import Button from './dzeio/Button'
|
import Button from './dzeio/Button'
|
||||||
import Checkbox from './dzeio/Checkbox'
|
import Checkbox from './dzeio/Checkbox'
|
||||||
|
Reference in New Issue
Block a user