-
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
25 changed files
with
428 additions
and
229 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { Builder, withChildren } from "@builder.io/react"; | ||
import { DEFAULT_PROPS } from "@/constants/builderProps"; | ||
import { CSS_EDITABLE_INPUTS } from "@/constants/builderInputs"; | ||
import { BACKGROUND_COLORS, REM_VALUES } from "@/constants/builderEnums"; | ||
import Box from "."; | ||
|
||
Builder.registerComponent(withChildren(Box), { | ||
...DEFAULT_PROPS, | ||
name: "Custom Box", | ||
canHaveChildren: true, | ||
inputs: [ | ||
...CSS_EDITABLE_INPUTS, | ||
{ | ||
name: "backgroundColor", | ||
type: "string", | ||
enum: ["bg-base0", "bg-base1"], | ||
enum: BACKGROUND_COLORS, | ||
}, | ||
...CSS_EDITABLE_INPUTS, | ||
], | ||
}); |
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 |
---|---|---|
@@ -1,32 +1,9 @@ | ||
import styled, { css } from "styled-components"; | ||
import styled from "styled-components"; | ||
import { BoxProps } from "./types"; | ||
import { calculateCssEditableProps } from "@/hooks/calculateCssEditableProps"; | ||
|
||
export const StyledBox = styled.div<BoxProps>` | ||
${({ | ||
theme, | ||
margin, | ||
marginTop, | ||
marginBottom, | ||
marginRight, | ||
marginLeft, | ||
padding, | ||
paddingTop, | ||
paddingBottom, | ||
paddingRight, | ||
paddingLeft, | ||
}) => { | ||
return css` | ||
margin: ${margin}; | ||
margin-top: ${marginTop}; | ||
margin-bottom: ${marginBottom}; | ||
margin-right: ${marginRight}; | ||
margin-left: ${marginLeft}; | ||
padding: ${padding}; | ||
padding-top: ${paddingTop}; | ||
padding-bottom: ${paddingBottom}; | ||
padding-right: ${paddingRight}; | ||
padding-left: ${paddingLeft}; | ||
position: relative; | ||
`; | ||
${({ theme, ...cssEditableProps }) => { | ||
return calculateCssEditableProps(theme, cssEditableProps); | ||
}} | ||
`; |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { CssEditableProps } from "@/types/CssEditableProps"; | ||
import { HTMLAttributes } from "react"; | ||
|
||
export type BoxProps = CssEditableProps & { | ||
children: React.ReactNode; | ||
backgroundColor: string; | ||
}; | ||
export type BoxProps = HTMLAttributes<HTMLDivElement> & | ||
CssEditableProps & { | ||
children: React.ReactNode; | ||
backgroundColor: string; | ||
}; |
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
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
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 |
---|---|---|
@@ -1,36 +1,16 @@ | ||
import styled, { css } from "styled-components"; | ||
import tw from "twin.macro"; | ||
import { ContainerProps } from "./types"; | ||
import { calculateCssEditableProps } from "@/hooks/calculateCssEditableProps"; | ||
|
||
export const StyledContainer = styled.div<ContainerProps>` | ||
${({ | ||
theme, | ||
margin, | ||
marginTop, | ||
marginBottom, | ||
marginRight, | ||
marginLeft, | ||
padding, | ||
paddingTop, | ||
paddingBottom, | ||
paddingRight, | ||
paddingLeft, | ||
}) => { | ||
${({ theme, ...cssEditableProps }) => { | ||
return css` | ||
${tw`px-6 md:px-16`} | ||
box-sizing: border-box; | ||
width: 100%; | ||
max-width: 100rem; | ||
margin: ${margin}; | ||
margin-top: ${marginTop}; | ||
margin-bottom: ${marginBottom}; | ||
margin-right: ${marginRight}; | ||
margin-left: ${marginLeft}; | ||
padding: ${padding}; | ||
padding-top: ${paddingTop}; | ||
padding-bottom: ${paddingBottom}; | ||
padding-right: ${paddingRight}; | ||
padding-left: ${paddingLeft}; | ||
${calculateCssEditableProps(theme, cssEditableProps)} | ||
`; | ||
}} | ||
`; |
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
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,50 @@ | ||
import { Builder } from "@builder.io/react"; | ||
import { DEFAULT_PROPS } from "@/constants/builderProps"; | ||
import { ObjectImg } from "@aleph-front/core"; | ||
|
||
Builder.registerComponent(ObjectImg, { | ||
...DEFAULT_PROPS, | ||
name: "Object Image", | ||
inputs: [ | ||
...DEFAULT_PROPS.inputs, | ||
{ | ||
name: "id", | ||
type: "string", | ||
enum: [ | ||
"Object1", | ||
"Object2", | ||
"Object3", | ||
"Object4", | ||
"Object5", | ||
"Object6", | ||
"Object7", | ||
"Object8", | ||
"Object9", | ||
"Object10", | ||
"Object11", | ||
"Object12", | ||
"Object13", | ||
"Object14", | ||
"Object15", | ||
"Object16", | ||
"Object17", | ||
"Object18", | ||
"Object19", | ||
], | ||
defaultValue: "Object1", | ||
}, | ||
{ | ||
name: "size", | ||
type: "number", | ||
}, | ||
{ | ||
name: "color", | ||
type: "string", | ||
defaultValue: "main0", | ||
}, | ||
{ | ||
name: "color2", | ||
type: "string", | ||
}, | ||
], | ||
}); |
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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import { Builder, withChildren } from "@builder.io/react"; | ||
import { DEFAULT_PROPS } from "@/constants/builderProps"; | ||
import Section from "."; | ||
import { CSS_EDITABLE_INPUTS } from "@/constants/builderInputs"; | ||
import { EFFECTS } from "@/constants/builderEnums"; | ||
|
||
Builder.registerComponent(withChildren(Section), { | ||
...DEFAULT_PROPS, | ||
name: "Core:Section", | ||
override: true, | ||
canHaveChildren: true, | ||
inputs: [ | ||
...DEFAULT_PROPS.inputs, | ||
{ | ||
name: "effects", | ||
type: "string", | ||
enum: ["", "fx-grain-1", "fx-grain-2"], | ||
enum: EFFECTS, | ||
}, | ||
...CSS_EDITABLE_INPUTS, | ||
], | ||
}); |
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,9 @@ | ||
import styled, { css } from "styled-components"; | ||
import { SectionProps } from "./types"; | ||
import { calculateCssEditableProps } from "@/hooks/calculateCssEditableProps"; | ||
|
||
export const StyledSection = styled.div<SectionProps>` | ||
${({ theme, ...cssEditableProps }) => { | ||
return calculateCssEditableProps(theme, cssEditableProps); | ||
}} | ||
`; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { HTMLAttributes } from "react"; | ||
import { CssEditableProps } from "@/types/CssEditableProps"; | ||
|
||
export type SectionProps = HTMLAttributes<HTMLDivElement> & { | ||
export type SectionProps = CssEditableProps & { | ||
children: React.ReactNode; | ||
effects: string; | ||
effects?: string; | ||
}; |
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.