diff --git a/apps/builddao/widget/Aside.jsx b/apps/builddao/widget/Aside.jsx index 94fcfb53..c7cc4559 100644 --- a/apps/builddao/widget/Aside.jsx +++ b/apps/builddao/widget/Aside.jsx @@ -1,15 +1,16 @@ -const Container = styled.div` +const AsideContainer = styled.div` border-radius: 16px; border: 1px solid var(--Stroke-color, rgba(255, 255, 255, 0.2)); background: var(--bg-1, #0b0c14); width: 100%; - height: 100%; display: flex; padding: 24px 12px; flex-direction: column; align-items: flex-start; gap: 16px; + margin-bottom: 1rem; + height: calc(min(100vh - 64px, 100%)); @media screen and (max-width: 768px) { border: 0px; @@ -18,67 +19,26 @@ const Container = styled.div` } `; -const TabButton = styled.button` - all: unset; - display: flex; - flex-shrink: 0; - padding: 8px 12px; - align-items: center; - gap: 10px; - align-self: stretch; - - @media screen and (max-width: 768px) { - align-self: auto; - } - - border-radius: 8px; - border: 1px solid var(--Stroke-color, rgba(255, 255, 255, 0.2)); - - color: var(--white-50, rgba(255, 255, 255, 0.7)); - - /* Body/14px */ - font-size: 14px; - font-style: normal; - font-weight: 400; - line-height: 170%; /* 23.8px */ - - transition: all 300ms; - - &:hover, - &:active, - &.active { - border-radius: 8px; - background: var(--Yellow, #ffaf51) !important; - - color: var(--black-100, #000) !important; - cursor: pointer; - - /* Body/14px */ - font-size: 14px; - font-style: normal; - font-weight: 400; - line-height: 170%; /* 23.8px */ - - svg { - filter: invert(1); - } - } -`; - -const Aside = (props) => { - return ( - - {Object.keys(props.routes || {}).map((route) => ( - props.setActiveRoute(route)} - > - - {props.routes[route].label} - - ))} - - ); -}; - -return { Aside }; +const { Button } = + VM.require("buildhub.near/widget/components.Button") || (() => {}); + +const { routes, active, setActiveRoute } = props; + +return ( + + {Object.keys(routes || {}).map((route) => ( + + ))} + +); diff --git a/apps/builddao/widget/Compose.jsx b/apps/builddao/widget/Compose.jsx index 8fb6d1a8..5cc54a5b 100644 --- a/apps/builddao/widget/Compose.jsx +++ b/apps/builddao/widget/Compose.jsx @@ -1,3 +1,5 @@ +const { Avatar, Button } = VM.require("buildhub.near/widget/components"); + const draftKey = props.feed.name || "draft"; const draft = Storage.privateGet(draftKey); @@ -236,13 +238,18 @@ const TextareaWrapper = styled.div` `; const MarkdownEditor = ` + html { + background: #23242b; + } + * { border: none !important; } .rc-md-editor { background: #4f5055; - border-top: 1px solid #4f5055 !important; + border-top: 1px solid #4f5055 !important; + border-radius: 8px; } .editor-container { @@ -268,6 +275,7 @@ const MarkdownEditor = ` border: 1px solid #4f5055 !important; border-top: 0 !important; + border-radius: 0 0 8px 8px; } .rc-md-navigation { @@ -275,70 +283,91 @@ const MarkdownEditor = ` border: 1px solid #4f5055 !important; border-top: 0 !important; border-bottom: 0 !important; + border-radius: 8px 8px 0 0; i { color: #cdd0d5; } } + .editor-container { + border-radius: 0 0 8px 8px; + } + .rc-md-editor .editor-container .sec-md .input { overflow-y: auto; padding: 8px !important; line-height: normal; + border-radius: 0 0 8px 8px; } `; -const Button = styled.button` - all: unset; - display: flex; - padding: 10px 20px; - justify-content: center; - align-items: center; - gap: 4px; - - border-radius: 8px; - background: var(--Yellow, #ffaf51); - - color: var(--black-100, #000); - - /* Other/Button_text */ - font-size: 14px; - font-style: normal; - font-weight: 500; - line-height: normal; -`; - -const SecondaryButton = styled.button` - all: unset; - display: flex; - padding: 10px 20px; - justify-content: center; - align-items: center; - gap: 4px; - - border-radius: 8px; - border: 1px solid var(--white-100, #fff); - background: transparent; - color: var(--white-100, #fff); - - /* Other/Button_text */ - font-size: 14px; - font-style: normal; - font-weight: 500; - line-height: normal; +const MarkdownPreview = styled.div` + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: 16px !important; + } + @media (max-width: 767px) { + font-size: 15px !important; + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: 15px !important; + } + } - transition: all 300ms; + h1, + h2, + h3, + h4, + h5, + h6, + strong, + b { + font-weight: 500 !important; + } + ol, + ul, + dl { + margin-bottom: 0.5rem; + white-space: inherit; + } + p { + margin-bottom: 0.5rem; + } + hr { + display: none; + } + img { + border-radius: var(--bs-border-radius-lg); + max-height: 40em; + } + th { + min-width: 5em; + } - &:hover { - background: #fff; - color: #000; + .table > :not(caption) > * > * { + padding: 0.3rem; } -`; -const MarkdownPreview = styled.div` * { color: #b6b6b8 !important; } + + a { + color: #0d6efd !important; + + &:hover { + color: #0a58ca !important; + } + } `; const LabelSelect = styled.div` @@ -373,23 +402,10 @@ const LabelSelect = styled.div` return ( -
- -
-

{name}

-

@{context.accountId}

+
+ +
+

{context.accountId}

@@ -422,45 +438,11 @@ return ( )}
- {/* {view === "editor" && ( -
-
setHideAdvanced(!hideAdvanced)} - style={{ cursor: "pointer" }} - > -
Advanced
- -
- - - - -
- )} */} -
- setView(view === "editor" ? "preview" : "editor")} + style={{ fontSize: 14 }} > {view === "editor" ? ( <> @@ -471,8 +453,10 @@ return ( Edit )} - + + + +
+
+ + + +
+
+ + + +
+
+); + +const components = [ + { + name: "Button", + category: "Buttons/Navigation", + widgetSrc: "buildhub.near/widget/components", + description: + "Button component with three different variants, and icon support.", + requiredProps: { + children: "Button Text", + onClick: "Callback function to handle button click", + }, + optionalProps: { + id: "ID of the button", + variant: "Variant of the button (default, primary, outline)", + type: "Type of the button (normal, icon)", + className: "Additional classnames for button", + style: "Additional styles for button", + }, + preview: ButtonPreview, + embedCode: ` + const { Button } = VM.require("buildhub.near/widget/components"); + + return ( +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ );`, + }, + { + name: "Pagination", + category: "Buttons/Navigation", + widgetSrc: "buildhub.near/widget/components", + description: "Pagination component for page switching.", + requiredProps: { + totalPages: "Total pages", + selectedPage: "Selected page number", + onPageClick: "Callback function to handle button click", + }, + optionalProps: { + maxVisiblePages: "Max visible pages at once (default: 4)", + }, + preview: , + embedCode: ` + const { Pagination } = VM.require("buildhub.near/widget/components. + + return ( + + );`, + }, + { + name: "Progress State", + category: "Buttons/Navigation", + widgetSrc: "buildhub.near/widget/components", + description: "Progress state for step component.", + requiredProps: { + children: "Children to render", + status: "Status of the step (default, active, completed, error)", + }, + preview: ( + <> + {/*
+ 1 + 1 + 1 + 1 +
*/} + + ), + embedCode: ` + const { ProgressState } = VM.require("buildhub.near/widget/components"); + + return ( +
+ 1 + 1 + 1 + 1 +
+ );`, + }, + { + name: "Step", + category: "Buttons/Navigation", + widgetSrc: "buildhub.near/widget/components", + description: "Step component to show progress between steps.", + requiredProps: { + totalSteps: "Total number of steps", + currentStep: "Current step number", + }, + optionalProps: { + currentStatus: + "Status of the current step (default, active, completed, error)", + }, + preview: ( + <> +
+ + + +
+ + ), + embedCode: ` + const { Step } = VM.require("buildhub.near/widget/components"); + + return ( +
+ + + +
+ );`, + }, + { + name: "Input Field", + category: "Fields", + widgetSrc: "buildhub.near/widget/components", + description: "Input field for text input", + requiredProps: { + value: "Current Value of input", + onChange: "Callback function to handle input change", + }, + optionalProps: { + label: "Label for input", + type: "Type of input field", + key: "Key for input field", + placeholder: "Placeholder text", + maxWidth: "Max width for input field", + }, + preview: ( + <> +
+ + +
+ + ), + embedCode: ` + const { InputField } = VM.require("buildhub.near/widget/components"); + + const [value, setValue] = useState(""); + const [password, setPassword] = useState(""); + + return ( +
+ setValue(e. target.value)} + /> + setPassword(e.target.value)} + /> +
+ );`, + }, + { + name: "Checkbox", + category: "Fields", + widgetSrc: "buildhub.near/widget/components", + description: "Checkbox input for toggles", + requiredProps: { + value: "Current Value of checkbox", + onChange: "Callback function to handle input change", + }, + optionalProps: { + label: "Label for checkbox", + }, + preview: ( + <> +
+ +
+ + ), + embedCode: ` + const { Checkbox } = VM.require("buildhub.near/widget/components"); + + const [checked, setChecked] = useState(false); + + return ( +
+ setChecked(!checked)} + /> +
+ );`, + }, + { + name: "Textbox", + category: "Fields", + widgetSrc: "buildhub.near/widget/components", + description: "Textbox for text input", + requiredProps: { + value: "Current Value of text box", + onChange: "Callback function to handle input change", + }, + optionalProps: { + label: "Label for text box", + }, + preview: ( + <> + + + ), + embedCode: ` + const { TextBox } = VM.require("buildhub.near/widget/components"); + + const [value, setValue] = useState(""); + + return ( +
+ setValue(e.target.value)} + placeholder={"Placeholder"} + /> +
+ );`, + }, + { + name: "Text Editor", + category: "Fields", + widgetSrc: "buildhub.near/widget/components", + description: "Text editor for markdown input", + requiredProps: { + value: "Current Value of checkbox", + onChange: "Callback function to handle input change", + }, + optionalProps: { + maxWidth: "Max width of text editor", + }, + preview: ( + <> + + + ), + embedCode: ` + const { TextEditor } = VM.require("buildhub.near/widget/components"); + + const [value, setValue] = useState(""); + + return ( +
+ setValue(e.target.value)} + /> +
+ );`, + }, + { + name: "Upload Field", + category: "Fields", + widgetSrc: "buildhub.near/widget/components", + description: "Component for file uploads", + optionalProps: { + background: "Background color of upload filed (default true)", + }, + preview: ( +
+ + +
+ ), + embedCode: ` + const { UploadField } = VM.require("buildhub.near/widget/components"); + + return ( +
+ + +
+ );`, + }, + { + name: "Post", + category: "Modals", + widgetSrc: "buildhub.near/widget/components", + description: "Post preview component", + requiredProps: { + accountId: "AccountId of post creator", + blockHeight: "Block height of post", + }, + optionalProps: { + hideBorder: "Hide bottom border", + pinned: "Toggle pinned post", + hideMenu: "Hide menu", + hideButtons: "Hide bottom buttons", + content: "Content to be shown", + subscribe: "", + raw: "Show raw MD", + groupId: "Group ID for post", + indexKey: "Index key for post", + permissions: "Permissions for post", + fullPostLink: "Link to full post", + }, + preview: ( +
+ +
+ ), + embedCode: ` + const { Post } = VM.require("buildhub.near/widget/components"); + + return ( +
+ +
+ );`, + }, + { + name: "User", + category: "Avatars/Users", + widgetSrc: "buildhub.near/widget/components", + description: "User component for user profile", + requiredProps: { + accountId: "AccountId of post creator", + blockHeight: "Block height of post", + }, + optionalProps: { + variant: "Variant of user component (desktop, mobile)", + pinned: "Toggle pinned post", + hideMenu: "Hide menu", + postType: "Post type", + link: "Post link", + isPremium: "Show badge for premium users", + }, + preview: ( +
+ + +
+ ), + embedCode: ` + const { User } = VM.require("buildhub.near/widget/components"); + + return ( +
+ + +
+ );`, + }, + { + name: "Avatar", + category: "Avatars/Users", + widgetSrc: "buildhub.near/widget/components", + description: "Show user avatar", + requiredProps: { + accountId: "AccountId of post creator", + }, + optionalProps: { + variant: "Variant of user component (desktop, mobile)", + }, + preview: ( +
+ + +
+ ), + embedCode: ` + const { Avatar } = VM.require("buildhub.near/widget/components"); + + return ( +
+ + +
+ );`, + }, +]; + +const renderProps = (props, optional) => { + return Object.entries(props || {}).map(([key, desc]) => { + return ( + + + + {key} + + + + + + + ); + }); +}; + +const renderComponent = (component, index) => { + const id = component.name.toLowerCase().replace(" ", "-"); + return ( +
+
+ +

{component.name}

+
+

{component.description}

+

Preview

+ {component.preview} +

Component

+
+
+ +
+ +
+

Props

+ + + + + + + + + {renderProps(component.requiredProps)} + {renderProps(component.optionalProps, true)} + +
KeyDescription
+

Example

+
+ +
+ +
+
+
+
+ ); +}; + +const Wrapper = styled.div` + h2, + h3, + label, + p { + color: white; + } + + .component { + padding: 0.5em 12px; + padding-bottom: 0; + margin-bottom: 3em; + + &:hover { + background: rgba(0, 0, 0, 0.03); + } + + table, + th, + td { + background: #0b0c13; + color: #fff; + } + + label { + font-size: 20px; + } + + .code { + display: inline-flex; + line-height: normal; + border-radius: 0.3em; + padding: 0 4px; + border: 1px solid #ddd; + background: rgba(0, 0, 0, 0.03); + font-family: var(--bs-font-monospace); + } + .path { + } + .preview { + background-color: white; + padding: 12px; + border: 1px solid #eee; + border-radius: 12px; + pre { + margin-bottom: 0; + } + } + .props { + .prop-key { + background: #f7f7f7; + border: 1px solid #dddddd; + color: black; + border-radius: 8px; + padding: 2px 4px; + font-weight: 600; + + &.optional { + font-weight: 400; + } + } + .prop-desc { + p { + margin-bottom: 0; + color: white; + } + } + } + .embed-code { + position: relative; + + .embed-copy { + position: absolute; + top: 18px; + right: 10px; + } + } + } +`; + +const renderMenuItem = (c, i) => { + const prev = i ? components[i - 1] : null; + const res = []; + if (!prev || prev.category !== c.category) { + res.push( +
+ {c.category} +
+ ); + } + const id = c.name.toLowerCase().replaceAll(" ", "-"); + res.push( +
+ {c.name} +
+ ); + return res; +}; + +const Grid = styled.div` + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + + .main { + grid-column: span 4 / span 4; + } + + .aside { + grid-column: span 1 / span 1; + } + + @media screen and (max-width: 768px) { + display: flex; + flex-direction: column; + gap: 1rem; + } +`; + +return ( + +
+ {components.map((component, index) => renderMenuItem(component, index))} +
+ + {components.map((component, index) => renderComponent(component, index))} + +
+); diff --git a/apps/builddao/widget/components/Pagination.jsx b/apps/builddao/widget/components/Pagination.jsx new file mode 100644 index 00000000..4196eb2a --- /dev/null +++ b/apps/builddao/widget/components/Pagination.jsx @@ -0,0 +1,97 @@ +const totalPages = props.totalPages ?? 12; // Assume you have 12 pages +const maxVisiblePages = props.maxVisiblePages ?? 4; +const onPageClick = props.onPageClick + ? props.onPageClick + : () => console.log("clicked"); +const pagesToShow = Math.min(totalPages, maxVisiblePages); +const [selectedPage, setSelectedPage] = useState(props.selectedPage ?? 11); +const totalPageSets = Math.ceil(totalPages / maxVisiblePages); +const [currentPageSet, setCurrentPageSet] = useState(totalPageSets); + +const Pagination = styled.div` + display: flex; + gap: 12px; + + div { + display: flex; + height: 40px; + min-width: 40px; + padding: 12px; + justify-content: center; + align-items: center; + gap: 10px; + border-radius: 8px; + color: var(--White-100, #fff); + transition: all 300ms; + cursor: pointer; + + /* Other/Button_text */ + font-size: 14px; + font-style: normal; + font-weight: 500; + line-height: normal; + + &.selected, + &:hover { + background-color: #23242b; + } + + &.arrow { + border: 1px solid rgba(255, 255, 255, 0.2); + } + + &.disabled { + cursor: not-allowed; + } + } +`; + +const handlePageClick = (pageNumber) => { + onPageClick(pageNumber); +}; + +const handleArrowClick = (direction) => { + if (direction === "left") { + setCurrentPageSet(Math.max(currentPageSet - 1, 1)); + } else { + setCurrentPageSet( + Math.min(currentPageSet + 1, Math.ceil(totalPages / maxVisiblePages)) + ); + } +}; + +const getPageNumber = (index) => + (currentPageSet - 1) * maxVisiblePages + index + 1; + +return ( + +
handleArrowClick("left")} + > + +
+ {Array.from({ length: pagesToShow }).map((_, index) => { + const pageNumber = getPageNumber(index); + return ( +
handlePageClick(pageNumber)} + > + {pageNumber} +
+ ); + })} +
handleArrowClick("right")} + > + +
+
+); diff --git a/apps/builddao/widget/components/Post.jsx b/apps/builddao/widget/components/Post.jsx new file mode 100644 index 00000000..f8402f4c --- /dev/null +++ b/apps/builddao/widget/components/Post.jsx @@ -0,0 +1,408 @@ +const { User, BookmarkButton } = VM.require("buildhub.near/widget/components"); + +const StyledPost = styled.div` + margin-bottom: 1rem; + .post { + border-radius: 16px; + border: 1px solid var(--Stroke-color, rgba(255, 255, 255, 0.2)); + color: #b6b6b8; + padding: 24px !important; + background-color: #23242b; + transition: all 300ms; + + &:hover { + background-color: #1c1f33 !important; + .expand-post { + background-image: linear-gradient( + to bottom, + rgba(28, 31, 51, 0), + rgba(28, 31, 51, 1) 25% + ) !important; + } + } + + .post-header { + span, + .text-muted { + color: #fff !important; + } + } + + .buttons { + border-top: 1px solid #3c3d43; + padding: 0.5rem; + } + + .expand-post { + background-image: linear-gradient( + to bottom, + rgba(35, 36, 43, 0), + rgba(35, 36, 43, 1) 25% + ) !important; + } + } + + .dropdown-menu { + background-color: #0b0c14 !important; + color: #fff !important; + + li.dropdown-item { + color: #fff !important; + &:hover { + a { + color: #0b0c14 !important; + } + } + } + + .link-dark, + .dropdown-item { + color: #fff !important; + + &:hover { + color: #0b0c14 !important; + + span { + color: #0b0c14 !important; + } + } + } + } + + textarea { + color: #b6b6b8 !important; + } +`; + +const Wrapper = styled.div` + margin: 0 -12px; + line-height: normal; + + .post { + position: relative; + padding: 12px; + padding-bottom: 4px; + display: flex; + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: 16px !important; + } + @media (max-width: 767px) { + font-size: 15px !important; + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: 15px !important; + } + } + + h1, + h2, + h3, + h4, + h5, + h6, + strong, + b { + font-weight: 500 !important; + } + ol, + ul, + dl { + margin-bottom: 0.5rem; + white-space: inherit; + } + p { + margin-bottom: 0.5rem; + } + hr { + display: none; + } + img { + border-radius: var(--bs-border-radius-lg); + max-height: 40em; + } + th { + min-width: 5em; + } + + .table > :not(caption) > * > * { + padding: 0.3rem; + } + + &:hover { + background-color: rgba(0, 0, 0, 0.03); + .expand-post { + background-image: linear-gradient( + to bottom, + rgba(0, 0, 0, 0), + rgba(247.35, 247.35, 247.35, 1) 25% + ); + } + } + + .post-header { + margin: 4px 0; + } + } + + .post:not(:last-child):before { + content: ""; + position: absolute; + left: 30px; + top: 56px; + bottom: 0; + width: 2px; + background-color: #ddd; + z-index: -1; + } + + .post:not(:first-child):after { + content: ""; + position: absolute; + left: 30px; + top: 0; + width: 2px; + height: 8px; + background-color: #ddd; + z-index: -1; + } + + .left { + margin-right: 12px; + min-width: 40px; + width: 40px; + overflow: hidden; + } + .right { + margin-top: -4px; + flex-grow: 1; + min-width: 0; + } + + .buttons-placeholder { + padding-bottom: 10px; + } + + .buttons { + margin-top: 10px; + margin-bottom: 6px; + column-gap: 4px; + color: #888; + } + + .reposted { + padding-top: 30px; + } +`; + +const RepostWidgetDesktop = styled.div` + @media screen and (max-width: 768px) { + display: none; + } +`; + +const RepostWidgetMobile = styled.div` + display: none; + @media screen and (max-width: 768px) { + display: flex; + align-items: center; + gap: 4px; + } +`; +const accountId = props.accountId; +if (!accountId) { + return "No accountId"; +} +const blockHeight = + props.blockHeight === "now" ? "now" : parseInt(props.blockHeight); +const pinned = !!props.pinned; +const hideMenu = !!props.hideMenu; +const hideButtons = !!props.hideButtons; +const content = + props.content ?? + JSON.parse(Social.get(`${accountId}/post/main`, blockHeight) ?? "null"); +const subscribe = !!props.subscribe; +const raw = !!props.raw; +const groupId = props.groupId ?? content.groupId; +const indexKey = props.indexKey; +const permissions = props.permissions; +const fullPostLink = props.fullPostLink; + +const notifyAccountId = accountId; +const item = { + type: "social", + path: `${accountId}/post/main`, + blockHeight, +}; + +const link = + props.link ?? + props.fullPostLink ?? + `/mob.near/widget/MainPage.N.Post.Page?accountId=${accountId}&blockHeight=${blockHeight}`; + +const contentWidget = ( + <> + + } + src="buildhub.near/widget/components.post.Content" + props={{ + content, + raw, + truncateContent: props.truncateContent, + noEmbed: props.noEmbed, + }} + /> + + + Repost Feed + + +); + +return ( + + +
+
+ + {fullPostLink ? ( + + {contentWidget} + + ) : ( + contentWidget + )} + {props.customButtons ? ( + props.customButtons + ) : !pinned && !hideButtons && blockHeight !== "now" ? ( +
+ State.update({ showReply: !state.showReply }), + }} + /> + + + + + + +
+ ) : ( +
+ )} +
+
+ {state.showReply && ( +
+ State.update({ showReply: false }), + }} + /> +
+ )} + {props.customComments + ? props.customComments + : !props.hideComments && ( +
+ +
+ )} + + +); diff --git a/apps/builddao/widget/components/ProgressState.jsx b/apps/builddao/widget/components/ProgressState.jsx new file mode 100644 index 00000000..e96fe0ba --- /dev/null +++ b/apps/builddao/widget/components/ProgressState.jsx @@ -0,0 +1,69 @@ + +const Progress = styled.div` + display: flex; + width: 40px; + height: 40px; + padding: 12px; + justify-content: center; + align-items: center; + gap: 10px; + + border-radius: 50%; + border: ${(props) => { + switch (props.status) { + case "focused": + return "1px solid var(--Yellow, #FFAF51)"; + case "error": + return "1px solid var(--System-Red, #FD2A5C)"; + case "completed": + return "1px solid var(--Stroke-color, rgba(255, 255, 255, 0.20))"; + default: + return "1px solid var(--Stroke-color, rgba(255, 255, 255, 0.20))"; + } + }}; + + background: ${(props) => { + switch (props.status) { + case "focused": + return "#2f2619"; + case "error": + return "#2f101f"; + case "completed": + return "#FFAF51"; + default: + return "#23242B"; + } + }}; + + color: ${(props) => { + switch (props.status) { + case "focused": + return "#fff"; + case "error": + return "#FD2A5C"; + case "completed": + return "#000"; + default: + return "#fff"; + } + }}; +`; + +function ProgressState({ children, status }) { + return ( + + {status === "completed" ? ( + + ) : status === "error" ? ( + + ) : ( + children + )} + + ); +} + +return { ProgressState }; \ No newline at end of file diff --git a/apps/builddao/widget/components/Step.jsx b/apps/builddao/widget/components/Step.jsx new file mode 100644 index 00000000..fb2b59bb --- /dev/null +++ b/apps/builddao/widget/components/Step.jsx @@ -0,0 +1,55 @@ +const { ProgressState } = VM.require("buildhub.near/widget/components.ProgressState"); + +const StepContainer = styled.div` + position: relative; + + &::before { + content: ""; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background: #000; /* Change color as needed */ + background-image: repeating-linear-gradient( + 90deg, + #3c3d43, + #3c3d43 2px, + transparent 2px, + transparent 4px + ); + transform: translateY(-50%); + z-index: -1; + } + `; + +function Step(props) { + const totalSteps = props.totalSteps ?? 5; + const currentStep = props.currentStep ?? 3; + const currentStatus = props.currentStatus ? props.currentStatus : "focused"; + + return ( + + {Array.from({ length: totalSteps }).map((_, i) => ( + i + 1 + ? "completed" + : "default" + } + > + {i + 1} + + ))} + + ); +} + +return { Step }; \ No newline at end of file diff --git a/apps/builddao/widget/components/TextBox.jsx b/apps/builddao/widget/components/TextBox.jsx new file mode 100644 index 00000000..66113c3c --- /dev/null +++ b/apps/builddao/widget/components/TextBox.jsx @@ -0,0 +1,45 @@ +const Label = styled.label` + color: var(--White-100, #fff); + + /* Body/16px */ + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 170%; /* 27.2px */ +`; + + +const TextArea = styled.textarea` + display: flex; + min-height: 100px; + padding: 16px 12px; + align-items: flex-start; + gap: 10px; + align-self: stretch; + + border-radius: 8px; + border: 1px solid var(--Stroke-color, rgba(255, 255, 255, 0.2)); + background: var(--Bg-1, #0b0c14); + + color: var(--White-50, #fff); + + /* Body/16px */ + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 170%; /* 27.2px */ +`; + +function TextBox({ label, value, onChange, placeholder, maxWidth }) { + return ( +
+ +