using storybook

converted to jss
This commit is contained in:
Ari Sosnovsky committed 2021-11-15 16:27:28 -05:00
1 parent 6d4fe7749a
commit df272e138c
33 files changed
+8944 -1650

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
$primary: #111111;
$secondary: #1c1c1c;
$primary-accent: #bbbbbb;
$secondary-accent: #929191;
$font-color-primary: #e1e1e1;
$gray: #403f3f;
$green: #68caa4;
$blue: #68aaca;
-127
View File
@@ -1,127 +0,0 @@
html,
body,
#app {
margin: 0;
padding: 0;
height: 100vh;
width: 100vw;
overflow: hidden;
font-family: Tahoma, Geneva, sans-serif;
background-color: $primary;
display: grid;
align-items: center;
justify-items: center;
color: $font-color-primary;
}
h1,
h2,
h3,
h4,
h5 {
justify-content: center;
align-items: center;
display: flex;
text-align: center;
}
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: $secondary;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: $secondary-accent;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: $primary-accent;
}
:root {
touch-action: pan-x pan-y;
height: 100%;
}
button {
background-color: $secondary;
color: $primary-accent;
border-color: $primary-accent;
&:hover {
background-color: $primary;
border-color: $secondary-accent;
}
&:disabled {
background-color: $gray;
border-color: $gray;
color: darken($gray, 50);
cursor: not-allowed;
}
&.secondary {
background-color: $primary;
color: $secondary-accent;
border-color: $secondary-accent;
&:hover {
background-color: $secondary;
border-color: $primary-accent;
}
}
border-style: solid;
border-width: 1px;
padding: 2.5px;
margin-left: 5px;
margin-right: 5px;
border-radius: 5px;
cursor: pointer;
}
select {
@extend button;
margin: 0;
}
input {
@extend button;
margin: 0;
cursor: text;
}
input[type="number"]::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
opacity: 0;
}
textarea {
@extend button;
cursor: text;
margin: 0;
width: 98%;
height: 100%;
}
span.checkbox {
height: 16px;
width: 16px;
font-size: 12px;
cursor: pointer;
border: 1px $primary-accent solid;
align-content: center;
text-align: center;
justify-content: center;
display: flex;
background-color: $primary;
color: $primary-accent;
overflow: hidden;
&:hover {
background-color: $secondary;
color: $secondary-accent;
}
}
@@ -1,123 +0,0 @@
.automation-editor {
height: 99%;
width: 99%;
font-size: 0.5em;
color: $primary-accent;
display: flex;
flex-direction: row;
&-dag {
border: 1px solid $secondary-accent;
width: 100%;
svg {
height: 99%;
width: 99%;
padding: 0;
margin: 0;
circle {
fill: adjust-color($color: $secondary, $green: 125, $blue: 125);
&.blue {
fill: adjust-color($color: $secondary, $blue: 125);
}
}
}
}
&-info-box {
display: flex;
flex-direction: column;
justify-content: flex-start;
overflow: auto;
// .input-wrapper {
// max-height: 100%;
// max-width: 100%;
// height: 100%;
// width: 100%;
// * {
// margin: 0;
// }
// input,
// textarea,
// div {
// font-size: 1em;
// resize: none;
// }
// }
}
.edge {
stroke: $secondary-accent;
}
#arrow > path {
fill: $secondary-accent;
}
&--node {
display: flex;
flex-direction: row;
background-color: $secondary;
border-radius: 1em;
height: 100%;
max-height: 100%;
max-width: 100%;
width: 100%;
&-inner {
display: flex;
flex-direction: row;
flex: 1;
&.top-color {
&.red {
border-top-color: adjust-color($color: $secondary, $red: 125);
}
&.blue {
border-top-color: adjust-color($color: $secondary, $blue: 125);
}
&.green {
border-top-color: adjust-color($color: $secondary, $green: 125);
}
border-top-width: 1px;
border-top-style: solid;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
&-text {
flex: 2;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
}
&-edge {
flex: 1;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
border-radius: 1em;
justify-content: space-around;
align-items: center;
&.left {
border-left: 1px $secondary-accent solid;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
&.right {
border-right: 1px $secondary-accent solid;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
&:hover {
background-color: $primary-accent;
cursor: pointer;
}
}
}
}
}
@@ -1,59 +0,0 @@
.input-wrapper {
position: relative;
display: flex;
flex-direction: column;
margin-top: 0.25em;
margin-bottom: 0.25em;
label {
font-size: 0.5em;
position: absolute;
left: 0.75em;
top: 0.5em;
font-weight: bold;
}
textarea,
input {
padding-top: 0.65em;
}
// .input-view {
// @extend input;
// cursor: default;
// }
// a.icon {
// cursor: pointer;
// position: absolute;
// right: 0.5em;
// top: 0.5em;
// &:hover {
// transform: rotate(90deg);
// > svg {
// fill: $secondary-accent;
// }
// }
// &.opened {
// transform: rotate(360deg);
// height: 0.5em;
// right: 0.25em;
// &.checkmark {
// opacity: 1;
// z-index: 1;
// }
// &.pencil {
// opacity: 0;
// z-index: -1;
// }
// }
// &.pencil {
// opacity: 1;
// z-index: 1;
// }
// &.checkmark {
// opacity: 0;
// z-index: -1;
// }
// }
}
@@ -1,45 +0,0 @@
.new-node-modal {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
&--background {
position: absolute;
z-index: 0;
width: 100vw;
height: 100vw;
background-color: rgba($secondary, 0.5);
}
&--inner {
z-index: 1;
max-width: 80%;
max-height: 60%;
min-height: 200px;
min-width: 200px;
border-radius: 20px;
padding: 15px;
display: flex;
flex-direction: column;
background-color: $primary;
border: 1px solid $primary-accent;
}
&--title {
text-align: center;
padding: 10px;
font-weight: bold;
}
&--body {
flex-grow: 1;
}
&--footer {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
}
@@ -1,2 +0,0 @@
.state-manager-options {
}
-7
View File
@@ -1,7 +0,0 @@
@import "./NewNodeModal.scss";
@import "./InputWrapper.scss";
@import "./AutomationDAG.scss";
* {
transition: all 200ms ease-in;
}
-8
View File
@@ -1,8 +0,0 @@
a.icon {
height: 1em;
width: 1em;
display: flex;
svg {
fill: $primary-accent;
}
}
-7
View File
@@ -1,7 +0,0 @@
@import "./colors.scss";
@import "./pages/index.scss";
@import "./utils.scss";
@import "./common.scss";
@import "./components/index.scss";
@import "./tooltip.scss";
@import "./icons.scss";
+46
View File
@@ -0,0 +1,46 @@
import { createAppUseStyles } from "./theme";
export const usePageTheme = createAppUseStyles(theme => ({
page: {
// dims
height: '100vh',
width: '100vw',
margin: 0,
padding: 0,
overflow: 'hidden',
maxWidth: '100vw',
maxHeight: '100vh',
// font
fontSize: '16px',
fontFamily: 'Tahoma, Geneva, sans-serif',
color: theme.primaryAccent,
// background
backgroundColor: theme.primary,
// children
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
'> div': {
flex: 1,
},
// scroll
'&::-webkit-scrollbar': {
width: '10px'
},
'&::-webkit-scrollbar-track': {
background: theme.secondary,
},
'&::-webkit-scrollbar-thumb': {
background: theme.secondaryAccent,
},
'&::-webkit-scrollbar-thumb:hover': {
background: theme.primaryAccent,
},
}
}))
-4
View File
@@ -1,4 +0,0 @@
#page--home {
align-items: center;
justify-content: center;
}
-20
View File
@@ -1,20 +0,0 @@
@import "./Home.scss";
.page {
height: 100vh;
width: 100vw;
overflow: hidden;
font-size: 16px;
color: $font-color-primary;
max-width: 100vw;
max-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
> div {
flex: 1;
}
}
+32
View File
@@ -0,0 +1,32 @@
import { Context, createContext } from "react"
import { createUseStyles, Styles } from "react-jss";
import { createTheming } from "theming"
// import Color from 'color';
export const {
context: ThemeContext,
ThemeProvider,
useTheme,
} = createTheming(createContext({
primary: '#111111',
secondary: '#1c1c1c',
primaryAccent: '#bbbbbb',
secondaryAccent: '#929191',
condition: {
primaryColor: '#4f4f77',
},
red: '#ed0c0c',
redAccent: '#9f3a3a'
}));
type GetThemeType<C extends Context<any>> = C extends Context<infer T> ? T : unknown;
export type AppTheme = GetThemeType<typeof ThemeContext>;
export const createAppUseStyles = <
Props extends {} = {},
C extends string = string,
>(f: (theme: AppTheme) => Styles<C, Props, AppTheme>) => (props: Props) => {
const theme = useTheme();
const useStyles = createUseStyles<C,Props,AppTheme>(f)
const classes = useStyles({...props, theme});
return {classes, theme};
}
-30
View File
@@ -1,30 +0,0 @@
.tooltip {
&.hide {
width: 0;
height: 0;
display: none;
}
&-bg {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
z-index: 9;
}
ul {
position: absolute;
left: 0;
top: 0;
list-style: none;
margin: 0;
padding: 0;
z-index: 10;
li {
@extend button;
margin: 0;
}
}
}
-9
View File
@@ -1,9 +0,0 @@
.box {
background-color: $secondary;
max-width: 80%;
max-height: 30%;
min-width: 80%;
min-height: 30%;
border-radius: 10px;
padding: 10px;
}