-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
9,618 additions
and
35,620 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
|
||
export const SHead = ({ image, children }) => { | ||
return ( | ||
<div> | ||
<div className="justify-center items-center flex" style={{ | ||
backgroundImage: `url(${image})`, | ||
backgroundPosition: 'center center', | ||
backgroundRepeat: 'no-repeat', | ||
backgroundSize: 'cover', | ||
width: 'calc(100vw - 17px)', | ||
height: '400px', | ||
position: 'absolute', | ||
left: 0, | ||
top: 0 | ||
}}> | ||
<div style={{ | ||
position: 'absolute', | ||
content: ' ', | ||
width: '100%', | ||
height: '100%', | ||
top: 0, | ||
left: 0, | ||
backgroundColor: 'rgba(0, 0, 0, 0.3)', | ||
zIndex: 1, | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}}> | ||
<h2 style={{ | ||
color: 'white', | ||
fontSize: '3rem', | ||
fontWeight: 'bold', | ||
zIndex: 2, | ||
textShadow: '0 0 10px rgba(0, 0, 0, 0.5)', | ||
}}> | ||
{children} | ||
</h2> | ||
</div> | ||
</div> | ||
|
||
<div style={{ | ||
position: 'relative', | ||
marginTop: '400px', | ||
}}> | ||
|
||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
type Control = { | ||
type: string | ||
options?: string[] | ||
disable?: boolean | ||
presetColors?: string[] | ||
} | ||
|
||
export function parseControl(props: any, disabled = false) { | ||
const type = props.type | ||
const control = props.control || null | ||
const options = props.options || null | ||
const presetColors = props.presetColors || null | ||
|
||
let data: Control = { type: 'text', disable: disabled } | ||
|
||
if (type === Boolean) { | ||
data = control ? { type: control } : { type: 'boolean' } | ||
} else if (type === String) { | ||
data = control | ||
? control | ||
: options | ||
? { type: 'inline-radio' } | ||
: { type: 'text' } | ||
} else if (type === Number) { | ||
data = control ? control : { type: 'number' } | ||
} else if (Array.isArray(type)) { | ||
data = parseControl(type[0], disabled) | ||
} else { | ||
return { type: 'text' } | ||
} | ||
|
||
if (options) { | ||
data.options = options | ||
} | ||
|
||
if (presetColors) { | ||
data.presetColors = presetColors | ||
} | ||
|
||
return data | ||
} | ||
|
||
export function renderArgsV2(props: any) { | ||
const args: any = {} | ||
|
||
if (props) { | ||
Object.keys(props).forEach((key: string) => { | ||
const prop: any = props[key] | ||
|
||
const description = prop.description || undefined | ||
const options = prop.options || undefined | ||
const control = parseControl(prop, false) | ||
|
||
const type = Array.isArray(prop.type) | ||
? prop.type.map((t: any) => t.name).join(',') | ||
: prop.type.name | ||
|
||
args[key] = { | ||
description: description, | ||
control: control, | ||
options: options, | ||
table: { | ||
defaultValue: | ||
prop.default !== undefined | ||
? { summary: prop.default } | ||
: undefined, | ||
type: { | ||
summary: type.toLowerCase(), | ||
required: prop.required || false | ||
}, | ||
disable: false | ||
} | ||
} | ||
|
||
console.log(args) | ||
|
||
// args[prop.name].control = parseControl(prop, false) | ||
// args[prop.name].type.name = parseControl(prop, false).type | ||
// if (Array.isArray(prop.type)) { | ||
// const type = prop.type | ||
// .map((t: any) => { | ||
// return getReturnType(t) | ||
// }) | ||
// .join(' | ') | ||
|
||
// args[prop.name].table.type.summary = type | ||
// } else { | ||
// args[prop.name].table.type.summary = getReturnType(prop.type) | ||
// } | ||
}) | ||
} | ||
|
||
return args | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<style> | ||
html.light .sidebar-container .sidebar-item, | ||
html.light .sidebar-container .sidebar-item>a{ | ||
color: #9CA3AF; | ||
} | ||
|
||
html.light .sidebar-container .sidebar-item[data-selected=true]>a, | ||
html.light .sidebar-container .sidebar-item[data-selected=true]{ | ||
color: white; | ||
} | ||
|
||
html.light #storybook-explorer-searchfield{ | ||
border: 1px solid #1F2937; | ||
} | ||
</style> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.