From 0be7ed7ecf0be3a8a0f78e492a20a4fc93c8f7fb Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 09:05:55 -0400 Subject: [PATCH 01/57] docs: add operations section to README --- x/vault/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/vault/README.md b/x/vault/README.md index d4ea1153c..263c53a24 100644 --- a/x/vault/README.md +++ b/x/vault/README.md @@ -13,3 +13,7 @@ The Vault module is responsible for the management of IPFS deployed Decentralize | WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | | | WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | | | Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | | + +## Operations + +[View on Eraser![](https://app.eraser.io/workspace/ZFigXnzF1bkQR1VBq7Mz/preview?elements=_hAjUxIKPzF4ffIL4Ow_9w&type=embed)](https://app.eraser.io/workspace/ZFigXnzF1bkQR1VBq7Mz?elements=_hAjUxIKPzF4ffIL4Ow_9w) From a76d264a0c726001c26e59d4fb5268e00f59e15c Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 09:46:25 -0400 Subject: [PATCH 02/57] docs: add Eraser link to README --- x/vault/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/vault/README.md b/x/vault/README.md index 263c53a24..d79bf0e55 100644 --- a/x/vault/README.md +++ b/x/vault/README.md @@ -17,3 +17,5 @@ The Vault module is responsible for the management of IPFS deployed Decentralize ## Operations [View on Eraser![](https://app.eraser.io/workspace/ZFigXnzF1bkQR1VBq7Mz/preview?elements=_hAjUxIKPzF4ffIL4Ow_9w&type=embed)](https://app.eraser.io/workspace/ZFigXnzF1bkQR1VBq7Mz?elements=_hAjUxIKPzF4ffIL4Ow_9w) + +View on Eraser
From 9ebd80f74084736c09ce01627ddbc666561195ba Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 09:48:21 -0400 Subject: [PATCH 03/57] --- x/vault/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/x/vault/README.md b/x/vault/README.md index d79bf0e55..8bee0b21d 100644 --- a/x/vault/README.md +++ b/x/vault/README.md @@ -4,15 +4,15 @@ The Vault module is responsible for the management of IPFS deployed Decentralize ## Concepts -| Concept | Description | Reference | -| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. | | -| Decentralized Identifier (DID) | A unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. | | -| HTMX (Hypertext Markup Language eXtensions) | A set of extensions to HTML that allow for the creation of interactive web pages. It is used to enhance the user experience and provide additional functionality to web applications. | | -| IPFS (InterPlanetary File System) | A decentralized, peer-to-peer network for storing and sharing data. It is a distributed file system that allows for the creation and sharing of content across a network of nodes. | | -| WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | | -| WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | | -| Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | | +| Concept | Description | +| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. | +| Decentralized Identifier (DID) | A unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. | +| HTMX (Hypertext Markup Language eXtensions) | A set of extensions to HTML that allow for the creation of interactive web pages. It is used to enhance the user experience and provide additional functionality to web applications. | +| IPFS (InterPlanetary File System) | A decentralized, peer-to-peer network for storing and sharing data. It is a distributed file system that allows for the creation and sharing of content across a network of nodes. | +| WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | +| WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | +| Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | ## Operations From 0f2a5bf2b45d8a2aaff25a6b034a87d28de973f1 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 09:57:06 -0400 Subject: [PATCH 04/57] refactor: move view handlers to router package --- cmd/motr/motr.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/motr/motr.go b/cmd/motr/motr.go index 42bfbc180..328b44286 100644 --- a/cmd/motr/motr.go +++ b/cmd/motr/motr.go @@ -17,7 +17,7 @@ import ( "github.com/onsonr/sonr/cmd/motr/state" "github.com/onsonr/sonr/internal/session" - "github.com/onsonr/sonr/pkg/nebula/pages" + "github.com/onsonr/sonr/pkg/nebula/router" ) func main() { @@ -40,11 +40,11 @@ func registerState(e *echo.Echo) { } func registerViews(e *echo.Echo) { - e.GET("/home", pages.Home) - e.GET("/login", pages.Login) - e.GET("/register", pages.Register) - e.GET("/profile", pages.Profile) - e.GET("/authorize", pages.Authorize) + e.GET("/home", router.Home) + e.GET("/login", router.Login) + e.GET("/register", router.Register) + e.GET("/profile", router.Profile) + e.GET("/authorize", router.Authorize) } // Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. From bac98b5e3820310ad55e0754ce5a05474d8bf864 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:20:14 -0400 Subject: [PATCH 05/57] feat: implement new profile card component --- pkg/nebula/assets/css/styles.css | 592 +----------------- pkg/nebula/components/grant/view.templ | 12 +- pkg/nebula/components/grant/view_templ.go | 12 +- pkg/nebula/components/home/header.templ | 4 +- pkg/nebula/components/home/header_templ.go | 2 +- pkg/nebula/components/home/view.templ | 4 +- pkg/nebula/components/home/view_templ.go | 4 +- pkg/nebula/components/login/view.templ | 19 +- pkg/nebula/components/login/view_templ.go | 19 +- pkg/nebula/components/profile/view.templ | 9 +- pkg/nebula/components/profile/view_templ.go | 9 +- pkg/nebula/components/register/modal.templ | 7 +- pkg/nebula/components/register/modal_templ.go | 7 +- .../blocks => global/styles}/fonts.templ | 2 +- .../blocks => global/styles}/fonts_templ.go | 18 +- .../blocks => global/styles}/head.templ | 2 +- .../blocks => global/styles}/head_templ.go | 2 +- .../blocks => global/styles}/layout.templ | 2 +- .../blocks => global/styles}/layout_templ.go | 6 +- .../blocks => global/styles}/sizes.templ | 2 +- .../blocks => global/styles}/sizes_templ.go | 2 +- .../blocks => global/ui}/badge.templ | 2 +- .../blocks => global/ui}/badge_templ.go | 2 +- .../blocks => global/ui}/button.templ | 19 +- .../blocks => global/ui}/button_templ.go | 204 ++++-- .../blocks => global/ui}/card.templ | 6 +- .../blocks => global/ui}/card_templ.go | 8 +- .../blocks => global/ui}/icons.templ | 3 +- .../blocks => global/ui}/icons_templ.go | 2 +- .../blocks => global/ui}/panel.templ | 5 +- .../blocks => global/ui}/panel_templ.go | 8 +- 31 files changed, 276 insertions(+), 719 deletions(-) rename pkg/nebula/{components/blocks => global/styles}/fonts.templ (98%) rename pkg/nebula/{components/blocks => global/styles}/fonts_templ.go (96%) rename pkg/nebula/{components/blocks => global/styles}/head.templ (99%) rename pkg/nebula/{components/blocks => global/styles}/head_templ.go (99%) rename pkg/nebula/{components/blocks => global/styles}/layout.templ (99%) rename pkg/nebula/{components/blocks => global/styles}/layout_templ.go (98%) rename pkg/nebula/{components/blocks => global/styles}/sizes.templ (98%) rename pkg/nebula/{components/blocks => global/styles}/sizes_templ.go (98%) rename pkg/nebula/{components/blocks => global/ui}/badge.templ (99%) rename pkg/nebula/{components/blocks => global/ui}/badge_templ.go (99%) rename pkg/nebula/{components/blocks => global/ui}/button.templ (94%) rename pkg/nebula/{components/blocks => global/ui}/button_templ.go (74%) rename pkg/nebula/{components/blocks => global/ui}/card.templ (95%) rename pkg/nebula/{components/blocks => global/ui}/card_templ.go (97%) rename pkg/nebula/{components/blocks => global/ui}/icons.templ (99%) rename pkg/nebula/{components/blocks => global/ui}/icons_templ.go (99%) rename pkg/nebula/{components/blocks => global/ui}/panel.templ (97%) rename pkg/nebula/{components/blocks => global/ui}/panel_templ.go (98%) diff --git a/pkg/nebula/assets/css/styles.css b/pkg/nebula/assets/css/styles.css index 128f5f51d..2519f309e 100644 --- a/pkg/nebula/assets/css/styles.css +++ b/pkg/nebula/assets/css/styles.css @@ -992,10 +992,6 @@ select{ left: 0px; } -.left-1\/2{ - left: 50%; -} - .right-0{ right: 0px; } @@ -1028,10 +1024,6 @@ select{ z-index: 40; } -.z-50{ - z-index: 50; -} - .z-\[99\]{ z-index: 99; } @@ -1071,10 +1063,6 @@ select{ margin-bottom: 0.5rem; } -.mb-3{ - margin-bottom: 0.75rem; -} - .mb-4{ margin-bottom: 1rem; } @@ -1095,10 +1083,6 @@ select{ margin-left: 0.5rem; } -.mr-1{ - margin-right: 0.25rem; -} - .mr-2{ margin-right: 0.5rem; } @@ -1115,22 +1099,10 @@ select{ margin-right: 1.25rem; } -.mr-7{ - margin-right: 1.75rem; -} - .mt-1{ margin-top: 0.25rem; } -.mt-12{ - margin-top: 3rem; -} - -.mt-2{ - margin-top: 0.5rem; -} - .mt-24{ margin-top: 6rem; } @@ -1191,14 +1163,6 @@ select{ height: 5rem; } -.h-3{ - height: 0.75rem; -} - -.h-32{ - height: 8rem; -} - .h-4{ height: 1rem; } @@ -1207,18 +1171,10 @@ select{ height: 1.25rem; } -.h-6{ - height: 1.5rem; -} - .h-8{ height: 2rem; } -.h-9{ - height: 2.25rem; -} - .h-\[280px\]{ height: 280px; } @@ -1235,10 +1191,6 @@ select{ height: 100vh; } -.min-h-screen{ - min-height: 100vh; -} - .w-0{ width: 0px; } @@ -1247,22 +1199,10 @@ select{ width: 33.333333%; } -.w-14{ - width: 3.5rem; -} - -.w-16{ - width: 4rem; -} - .w-20{ width: 5rem; } -.w-3{ - width: 0.75rem; -} - .w-4{ width: 1rem; } @@ -1271,10 +1211,6 @@ select{ width: 1.25rem; } -.w-6{ - width: 1.5rem; -} - .w-8{ width: 2rem; } @@ -1283,27 +1219,14 @@ select{ width: 22rem; } -.w-\[365px\]{ - width: 365px; -} - .w-\[calc\(100\%\+1rem\)\]{ width: calc(100% + 1rem); } -.w-\[full\]{ - width: full; -} - .w-auto{ width: auto; } -.w-fit{ - width: -moz-fit-content; - width: fit-content; -} - .w-full{ width: 100%; } @@ -1312,10 +1235,6 @@ select{ width: 100vw; } -.max-w-2xl{ - max-width: 42rem; -} - .max-w-3xl{ max-width: 48rem; } @@ -1336,18 +1255,10 @@ select{ max-width: 94rem; } -.max-w-lg{ - max-width: 32rem; -} - .max-w-md{ max-width: 28rem; } -.max-w-screen-sm{ - max-width: 640px; -} - .max-w-sm{ max-width: 24rem; } @@ -1372,26 +1283,11 @@ select{ flex-grow: 1; } -.-translate-x-0{ - --tw-translate-x: -0px; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .-translate-x-1\/2{ --tw-translate-x: -50%; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.-translate-x-4{ - --tw-translate-x: -1rem; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.-translate-x-7{ - --tw-translate-x: -1.75rem; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .-translate-x-8{ --tw-translate-x: -2rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1402,11 +1298,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.-translate-y-0\.5{ - --tw-translate-y: -0.125rem; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .-translate-y-4{ --tw-translate-y: -1rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1437,16 +1328,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.translate-y-24{ - --tw-translate-y: 6rem; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.translate-y-3{ - --tw-translate-y: 0.75rem; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .translate-y-4{ --tw-translate-y: 1rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1506,10 +1387,6 @@ select{ animation: infinite-scroll-inverse 60s linear infinite; } -.cursor-default{ - cursor: default; -} - .cursor-pointer{ cursor: pointer; } @@ -1518,10 +1395,6 @@ select{ grid-template-columns: repeat(2, minmax(0, 1fr)); } -.flex-row{ - flex-direction: row; -} - .flex-col{ flex-direction: column; } @@ -1566,14 +1439,6 @@ select{ gap: 3rem; } -.gap-2{ - gap: 0.5rem; -} - -.gap-3{ - gap: 0.75rem; -} - .gap-4{ gap: 1rem; } @@ -1582,15 +1447,6 @@ select{ gap: 2rem; } -.gap-x-3{ - -moz-column-gap: 0.75rem; - column-gap: 0.75rem; -} - -.gap-y-3{ - row-gap: 0.75rem; -} - .space-x-1 > :not([hidden]) ~ :not([hidden]){ --tw-space-x-reverse: 0; margin-right: calc(0.25rem * var(--tw-space-x-reverse)); @@ -1678,10 +1534,6 @@ select{ border-width: 1px; } -.border-2{ - border-width: 2px; -} - .border-\[2px\]{ border-width: 2px; } @@ -1690,44 +1542,16 @@ select{ border-top-width: 1px; } -.border-blue-600{ - --tw-border-opacity: 1; - border-color: rgb(37 99 235 / var(--tw-border-opacity)); -} - -.border-green-600{ - --tw-border-opacity: 1; - border-color: rgb(22 163 74 / var(--tw-border-opacity)); -} - .border-neutral-200{ --tw-border-opacity: 1; border-color: rgb(229 229 229 / var(--tw-border-opacity)); } -.border-neutral-200\/60{ - border-color: rgb(229 229 229 / 0.6); -} - -.border-neutral-200\/70{ - border-color: rgb(229 229 229 / 0.7); -} - .border-neutral-300{ --tw-border-opacity: 1; border-color: rgb(212 212 212 / var(--tw-border-opacity)); } -.border-neutral-900{ - --tw-border-opacity: 1; - border-color: rgb(23 23 23 / var(--tw-border-opacity)); -} - -.border-red-600{ - --tw-border-opacity: 1; - border-color: rgb(220 38 38 / var(--tw-border-opacity)); -} - .border-transparent{ border-color: transparent; } @@ -1737,11 +1561,6 @@ select{ border-color: rgb(255 255 255 / var(--tw-border-opacity)); } -.border-yellow-500{ - --tw-border-opacity: 1; - border-color: rgb(234 179 8 / var(--tw-border-opacity)); -} - .border-zinc-200{ --tw-border-opacity: 1; border-color: rgb(228 228 231 / var(--tw-border-opacity)); @@ -1752,9 +1571,9 @@ select{ border-color: rgb(212 212 216 / var(--tw-border-opacity)); } -.bg-blue-50{ - --tw-bg-opacity: 1; - background-color: rgb(239 246 255 / var(--tw-bg-opacity)); +.border-zinc-600{ + --tw-border-opacity: 1; + border-color: rgb(82 82 91 / var(--tw-border-opacity)); } .bg-blue-600{ @@ -1762,41 +1581,11 @@ select{ background-color: rgb(37 99 235 / var(--tw-bg-opacity)); } -.bg-green-50{ - --tw-bg-opacity: 1; - background-color: rgb(240 253 244 / var(--tw-bg-opacity)); -} - -.bg-green-600{ - --tw-bg-opacity: 1; - background-color: rgb(22 163 74 / var(--tw-bg-opacity)); -} - -.bg-neutral-50{ - --tw-bg-opacity: 1; - background-color: rgb(250 250 250 / var(--tw-bg-opacity)); -} - -.bg-neutral-900{ - --tw-bg-opacity: 1; - background-color: rgb(23 23 23 / var(--tw-bg-opacity)); -} - .bg-neutral-950{ --tw-bg-opacity: 1; background-color: rgb(10 10 10 / var(--tw-bg-opacity)); } -.bg-red-50{ - --tw-bg-opacity: 1; - background-color: rgb(254 242 242 / var(--tw-bg-opacity)); -} - -.bg-red-600{ - --tw-bg-opacity: 1; - background-color: rgb(220 38 38 / var(--tw-bg-opacity)); -} - .bg-transparent{ background-color: transparent; } @@ -1806,16 +1595,6 @@ select{ background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } -.bg-yellow-50{ - --tw-bg-opacity: 1; - background-color: rgb(254 252 232 / var(--tw-bg-opacity)); -} - -.bg-yellow-600{ - --tw-bg-opacity: 1; - background-color: rgb(202 138 4 / var(--tw-bg-opacity)); -} - .bg-zinc-100{ --tw-bg-opacity: 1; background-color: rgb(244 244 245 / var(--tw-bg-opacity)); @@ -1914,10 +1693,6 @@ select{ object-position: left; } -.p-1{ - padding: 0.25rem; -} - .p-4{ padding: 1rem; } @@ -1930,10 +1705,6 @@ select{ padding: 1.5rem; } -.p-7{ - padding: 1.75rem; -} - .px-0\.5{ padding-left: 0.125rem; padding-right: 0.125rem; @@ -1944,31 +1715,16 @@ select{ padding-right: 0.5rem; } -.px-2\.5{ - padding-left: 0.625rem; - padding-right: 0.625rem; -} - .px-3{ padding-left: 0.75rem; padding-right: 0.75rem; } -.px-3\.5{ - padding-left: 0.875rem; - padding-right: 0.875rem; -} - .px-4{ padding-left: 1rem; padding-right: 1rem; } -.px-5{ - padding-left: 1.25rem; - padding-right: 1.25rem; -} - .px-6{ padding-left: 1.5rem; padding-right: 1.5rem; @@ -1989,11 +1745,6 @@ select{ padding-bottom: 0.125rem; } -.py-1{ - padding-top: 0.25rem; - padding-bottom: 0.25rem; -} - .py-12{ padding-top: 3rem; padding-bottom: 3rem; @@ -2029,18 +1780,10 @@ select{ padding-bottom: 1px; } -.pb-1{ - padding-bottom: 0.25rem; -} - .pb-12{ padding-bottom: 3rem; } -.pb-2{ - padding-bottom: 0.5rem; -} - .pb-3{ padding-bottom: 0.75rem; } @@ -2049,26 +1792,10 @@ select{ padding-bottom: 1rem; } -.pb-6{ - padding-bottom: 1.5rem; -} - .pb-8{ padding-bottom: 2rem; } -.pl-4{ - padding-left: 1rem; -} - -.pr-2{ - padding-right: 0.5rem; -} - -.pr-4{ - padding-right: 1rem; -} - .pt-0{ padding-top: 0px; } @@ -2077,10 +1804,6 @@ select{ padding-top: 3rem; } -.pt-2{ - padding-top: 0.5rem; -} - .pt-32{ padding-top: 8rem; } @@ -2089,10 +1812,6 @@ select{ padding-top: 1.5rem; } -.pt-8{ - padding-top: 2rem; -} - .text-left{ text-align: left; } @@ -2105,10 +1824,6 @@ select{ vertical-align: top; } -.font-inter{ - font-family: Inter, sans-serif; -} - .font-inter-tight{ font-family: Inter Tight, sans-serif; } @@ -2139,12 +1854,6 @@ select{ font-size: 0.6rem; } -.text-base{ - font-size: 1rem; - line-height: 1.5; - letter-spacing: -0.017em; -} - .text-lg{ font-size: 1.125rem; line-height: 1.5; @@ -2156,12 +1865,6 @@ select{ line-height: 1.5715; } -.text-xl{ - font-size: 1.25rem; - line-height: 1.5; - letter-spacing: -0.017em; -} - .text-xs{ font-size: 0.75rem; line-height: 1.5; @@ -2179,10 +1882,6 @@ select{ font-weight: 500; } -.font-normal{ - font-weight: 400; -} - .font-semibold{ font-weight: 600; } @@ -2216,50 +1915,11 @@ select{ letter-spacing: 0.025em; } -.text-blue-500{ - --tw-text-opacity: 1; - color: rgb(59 130 246 / var(--tw-text-opacity)); -} - .text-blue-600{ --tw-text-opacity: 1; color: rgb(37 99 235 / var(--tw-text-opacity)); } -.text-gray-400{ - --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); -} - -.text-gray-400\/70{ - color: rgb(156 163 175 / 0.7); -} - -.text-gray-500{ - --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); -} - -.text-gray-600{ - --tw-text-opacity: 1; - color: rgb(75 85 99 / var(--tw-text-opacity)); -} - -.text-green-500{ - --tw-text-opacity: 1; - color: rgb(34 197 94 / var(--tw-text-opacity)); -} - -.text-green-600{ - --tw-text-opacity: 1; - color: rgb(22 163 74 / var(--tw-text-opacity)); -} - -.text-neutral-100{ - --tw-text-opacity: 1; - color: rgb(245 245 245 / var(--tw-text-opacity)); -} - .text-neutral-500{ --tw-text-opacity: 1; color: rgb(115 115 115 / var(--tw-text-opacity)); @@ -2270,26 +1930,6 @@ select{ color: rgb(82 82 82 / var(--tw-text-opacity)); } -.text-neutral-800{ - --tw-text-opacity: 1; - color: rgb(38 38 38 / var(--tw-text-opacity)); -} - -.text-neutral-900{ - --tw-text-opacity: 1; - color: rgb(23 23 23 / var(--tw-text-opacity)); -} - -.text-red-500{ - --tw-text-opacity: 1; - color: rgb(239 68 68 / var(--tw-text-opacity)); -} - -.text-red-600{ - --tw-text-opacity: 1; - color: rgb(220 38 38 / var(--tw-text-opacity)); -} - .text-transparent{ color: transparent; } @@ -2299,11 +1939,6 @@ select{ color: rgb(255 255 255 / var(--tw-text-opacity)); } -.text-yellow-600{ - --tw-text-opacity: 1; - color: rgb(202 138 4 / var(--tw-text-opacity)); -} - .text-zinc-100{ --tw-text-opacity: 1; color: rgb(244 244 245 / var(--tw-text-opacity)); @@ -2356,11 +1991,6 @@ select{ text-underline-offset: 4px; } -.antialiased{ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - .opacity-0{ opacity: 0; } @@ -2439,10 +2069,6 @@ select{ transition-duration: 150ms; } -.duration-100{ - transition-duration: 100ms; -} - .duration-200{ transition-duration: 200ms; } @@ -3092,81 +2718,16 @@ input[type="search"]::-webkit-search-results-decoration { display: none; } -.hover\:bg-blue-100:hover{ - --tw-bg-opacity: 1; - background-color: rgb(219 234 254 / var(--tw-bg-opacity)); -} - -.hover\:bg-blue-600:hover{ - --tw-bg-opacity: 1; - background-color: rgb(37 99 235 / var(--tw-bg-opacity)); -} - -.hover\:bg-blue-700:hover{ - --tw-bg-opacity: 1; - background-color: rgb(29 78 216 / var(--tw-bg-opacity)); -} - -.hover\:bg-green-100:hover{ - --tw-bg-opacity: 1; - background-color: rgb(220 252 231 / var(--tw-bg-opacity)); -} - -.hover\:bg-green-600:hover{ - --tw-bg-opacity: 1; - background-color: rgb(22 163 74 / var(--tw-bg-opacity)); -} - -.hover\:bg-green-700:hover{ - --tw-bg-opacity: 1; - background-color: rgb(21 128 61 / var(--tw-bg-opacity)); -} - .hover\:bg-neutral-100:hover{ --tw-bg-opacity: 1; background-color: rgb(245 245 245 / var(--tw-bg-opacity)); } -.hover\:bg-neutral-800:hover{ - --tw-bg-opacity: 1; - background-color: rgb(38 38 38 / var(--tw-bg-opacity)); -} - .hover\:bg-neutral-900:hover{ --tw-bg-opacity: 1; background-color: rgb(23 23 23 / var(--tw-bg-opacity)); } -.hover\:bg-red-100:hover{ - --tw-bg-opacity: 1; - background-color: rgb(254 226 226 / var(--tw-bg-opacity)); -} - -.hover\:bg-red-600:hover{ - --tw-bg-opacity: 1; - background-color: rgb(220 38 38 / var(--tw-bg-opacity)); -} - -.hover\:bg-red-700:hover{ - --tw-bg-opacity: 1; - background-color: rgb(185 28 28 / var(--tw-bg-opacity)); -} - -.hover\:bg-yellow-100:hover{ - --tw-bg-opacity: 1; - background-color: rgb(254 249 195 / var(--tw-bg-opacity)); -} - -.hover\:bg-yellow-500:hover{ - --tw-bg-opacity: 1; - background-color: rgb(234 179 8 / var(--tw-bg-opacity)); -} - -.hover\:bg-yellow-700:hover{ - --tw-bg-opacity: 1; - background-color: rgb(161 98 7 / var(--tw-bg-opacity)); -} - .hover\:bg-zinc-50:hover{ --tw-bg-opacity: 1; background-color: rgb(250 250 250 / var(--tw-bg-opacity)); @@ -3177,46 +2738,6 @@ input[type="search"]::-webkit-search-results-decoration { background-color: rgb(39 39 42 / var(--tw-bg-opacity)); } -.hover\:text-blue-600:hover{ - --tw-text-opacity: 1; - color: rgb(37 99 235 / var(--tw-text-opacity)); -} - -.hover\:text-green-600:hover{ - --tw-text-opacity: 1; - color: rgb(22 163 74 / var(--tw-text-opacity)); -} - -.hover\:text-neutral-600:hover{ - --tw-text-opacity: 1; - color: rgb(82 82 82 / var(--tw-text-opacity)); -} - -.hover\:text-neutral-700:hover{ - --tw-text-opacity: 1; - color: rgb(64 64 64 / var(--tw-text-opacity)); -} - -.hover\:text-neutral-900:hover{ - --tw-text-opacity: 1; - color: rgb(23 23 23 / var(--tw-text-opacity)); -} - -.hover\:text-red-600:hover{ - --tw-text-opacity: 1; - color: rgb(220 38 38 / var(--tw-text-opacity)); -} - -.hover\:text-white:hover{ - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); -} - -.hover\:text-yellow-700:hover{ - --tw-text-opacity: 1; - color: rgb(161 98 7 / var(--tw-text-opacity)); -} - .hover\:text-zinc-300:hover{ --tw-text-opacity: 1; color: rgb(212 212 216 / var(--tw-text-opacity)); @@ -3232,10 +2753,6 @@ input[type="search"]::-webkit-search-results-decoration { color: rgb(24 24 27 / var(--tw-text-opacity)); } -.hover\:underline:hover{ - text-decoration-line: underline; -} - .hover\:opacity-100:hover{ opacity: 1; } @@ -3250,11 +2767,6 @@ input[type="search"]::-webkit-search-results-decoration { border-color: rgb(212 212 216 / var(--tw-border-opacity)); } -.focus\:bg-white:focus{ - --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); -} - .focus\:no-underline:focus{ text-decoration-line: none; } @@ -3270,35 +2782,11 @@ input[type="search"]::-webkit-search-results-decoration { box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); } -.focus\:ring-blue-100:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(219 234 254 / var(--tw-ring-opacity)); -} - -.focus\:ring-blue-700:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(29 78 216 / var(--tw-ring-opacity)); -} - -.focus\:ring-green-100:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(220 252 231 / var(--tw-ring-opacity)); -} - -.focus\:ring-green-700:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(21 128 61 / var(--tw-ring-opacity)); -} - .focus\:ring-neutral-100:focus{ --tw-ring-opacity: 1; --tw-ring-color: rgb(245 245 245 / var(--tw-ring-opacity)); } -.focus\:ring-neutral-200\/60:focus{ - --tw-ring-color: rgb(229 229 229 / 0.6); -} - .focus\:ring-neutral-400:focus{ --tw-ring-opacity: 1; --tw-ring-color: rgb(163 163 163 / var(--tw-ring-opacity)); @@ -3309,26 +2797,6 @@ input[type="search"]::-webkit-search-results-decoration { --tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity)); } -.focus\:ring-red-100:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(254 226 226 / var(--tw-ring-opacity)); -} - -.focus\:ring-red-700:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(185 28 28 / var(--tw-ring-opacity)); -} - -.focus\:ring-yellow-100:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(254 249 195 / var(--tw-ring-opacity)); -} - -.focus\:ring-yellow-700:focus{ - --tw-ring-opacity: 1; - --tw-ring-color: rgb(161 98 7 / var(--tw-ring-opacity)); -} - .focus\:ring-offset-2:focus{ --tw-ring-offset-width: 2px; } @@ -3348,11 +2816,6 @@ input[type="search"]::-webkit-search-results-decoration { --tw-ring-offset-width: 2px; } -.active\:bg-white:active{ - --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); -} - .disabled\:pointer-events-none:disabled{ pointer-events: none; } @@ -3396,12 +2859,6 @@ input[type="search"]::-webkit-search-results-decoration { opacity: 0.7; } -@supports (overflow:clip){ - .supports-\[overflow\:clip\]\:overflow-clip{ - overflow: clip; - } -} - @media not all and (min-width: 1024px){ .max-lg\:w-32{ width: 8rem; @@ -3428,10 +2885,6 @@ input[type="search"]::-webkit-search-results-decoration { grid-column: span 6 / span 6; } - .sm\:mb-0{ - margin-bottom: 0px; - } - .sm\:inline-flex{ display: inline-flex; } @@ -3535,10 +2988,6 @@ input[type="search"]::-webkit-search-results-decoration { grid-template-columns: repeat(4, minmax(0, 1fr)); } - .md\:flex-row{ - flex-direction: row; - } - .md\:justify-start{ justify-content: flex-start; } @@ -3547,10 +2996,6 @@ input[type="search"]::-webkit-search-results-decoration { gap: 0px; } - .md\:gap-4{ - gap: 1rem; - } - .md\:gap-6{ gap: 1.5rem; } @@ -3683,33 +3128,11 @@ input[type="search"]::-webkit-search-results-decoration { background-color: rgb(0 0 0 / 0.1); } - .lg\:p-24{ - padding: 6rem; - } - .lg\:px-5{ padding-left: 1.25rem; padding-right: 1.25rem; } - .lg\:text-2xl{ - font-size: 1.5rem; - line-height: 1.415; - letter-spacing: -0.017em; - } - - .lg\:text-3xl{ - font-size: 2rem; - line-height: 1.3125; - letter-spacing: -0.017em; - } - - .lg\:text-xl{ - font-size: 1.25rem; - line-height: 1.5; - letter-spacing: -0.017em; - } - .lg\:text-white{ --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); @@ -3732,12 +3155,3 @@ input[type="search"]::-webkit-search-results-decoration { margin-left: 0.75rem; margin-right: 0.75rem; } - -.\[\&_\.active-breadcrumb\]\:font-medium .active-breadcrumb{ - font-weight: 500; -} - -.\[\&_\.active-breadcrumb\]\:text-neutral-600 .active-breadcrumb{ - --tw-text-opacity: 1; - color: rgb(82 82 82 / var(--tw-text-opacity)); -} diff --git a/pkg/nebula/components/grant/view.templ b/pkg/nebula/components/grant/view.templ index 12eefcc79..56c844581 100644 --- a/pkg/nebula/components/grant/view.templ +++ b/pkg/nebula/components/grant/view.templ @@ -2,14 +2,16 @@ package grant import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) templ View(c echo.Context) { - @blocks.Layout("Sonr.ID", true) { - @blocks.Card("authorize-view", blocks.SizeMedium) { - @blocks.H1("Sonr.ID") - @blocks.Text("Neo-tree is a file manager for NeoFS.") + @styles.Layout("Sonr.ID", true) { + @ui.Card("authorize-view", styles.SizeMedium) { + @styles.H1("Sonr.ID") + @styles.Text("Neo-tree is a file manager for NeoFS.") } } } diff --git a/pkg/nebula/components/grant/view_templ.go b/pkg/nebula/components/grant/view_templ.go index fc3ee4105..13bb0d7ee 100644 --- a/pkg/nebula/components/grant/view_templ.go +++ b/pkg/nebula/components/grant/view_templ.go @@ -10,7 +10,9 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) func View(c echo.Context) templ.Component { @@ -58,7 +60,7 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -66,19 +68,19 @@ func View(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = blocks.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Card("authorize-view", blocks.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.Card("authorize-view", styles.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/header.templ b/pkg/nebula/components/home/header.templ index 9dd0ec4d6..5e6e101cc 100644 --- a/pkg/nebula/components/home/header.templ +++ b/pkg/nebula/components/home/header.templ @@ -9,8 +9,8 @@ templ Header() { diff --git a/pkg/nebula/components/home/header_templ.go b/pkg/nebula/components/home/header_templ.go index 57d740b52..029da6a57 100644 --- a/pkg/nebula/components/home/header_templ.go +++ b/pkg/nebula/components/home/header_templ.go @@ -29,7 +29,7 @@ func Header() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/view.templ b/pkg/nebula/components/home/view.templ index 1d83c9808..dddf771aa 100644 --- a/pkg/nebula/components/home/view.templ +++ b/pkg/nebula/components/home/view.templ @@ -1,12 +1,12 @@ package home import ( - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" "github.com/onsonr/sonr/pkg/nebula/models" ) templ View(home *models.Home) { - @blocks.LayoutNoBody("Sonr.ID", true) { + @styles.LayoutNoBody("Sonr.ID", true) { @Header() @SectionHero(home.Hero) @Highlights() diff --git a/pkg/nebula/components/home/view_templ.go b/pkg/nebula/components/home/view_templ.go index 93fd6732e..e0f84500b 100644 --- a/pkg/nebula/components/home/view_templ.go +++ b/pkg/nebula/components/home/view_templ.go @@ -9,7 +9,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" "github.com/onsonr/sonr/pkg/nebula/models" ) @@ -108,7 +108,7 @@ func View(home *models.Home) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/login/view.templ b/pkg/nebula/components/login/view.templ index ed720f996..67642100e 100644 --- a/pkg/nebula/components/login/view.templ +++ b/pkg/nebula/components/login/view.templ @@ -2,18 +2,19 @@ package login import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) templ View(c echo.Context) { - @blocks.Layout("Sonr.ID", true) { - @blocks.Card("login-view", blocks.SizeLarge) { - @blocks.H1("Sonr.ID") - @blocks.Text("Neo-tree is a file manager for NeoFS.") - @blocks.Spacer() - @blocks.Spacer() - @blocks.Button(blocks.GET("/", "#login-view")) { - @blocks.Text("Cancel") + @styles.Layout("Sonr.ID", true) { + @ui.Card("login-view", styles.SizeLarge) { + @styles.H1("Sonr.ID") + @styles.Text("Neo-tree is a file manager for NeoFS.") + @styles.Spacer() + @styles.Spacer() + @ui.Button(ui.GET("/", "#login-view")) { + @styles.Text("Cancel") } } } diff --git a/pkg/nebula/components/login/view_templ.go b/pkg/nebula/components/login/view_templ.go index 64d3aa668..e55aafdf0 100644 --- a/pkg/nebula/components/login/view_templ.go +++ b/pkg/nebula/components/login/view_templ.go @@ -10,7 +10,8 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) func View(c echo.Context) templ.Component { @@ -58,7 +59,7 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -66,7 +67,7 @@ func View(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = blocks.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -74,7 +75,7 @@ func View(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -82,7 +83,7 @@ func View(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -102,25 +103,25 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Button(blocks.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.Button(ui.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Card("login-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.Card("login-view", styles.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/profile/view.templ b/pkg/nebula/components/profile/view.templ index 314eb890a..103fde545 100644 --- a/pkg/nebula/components/profile/view.templ +++ b/pkg/nebula/components/profile/view.templ @@ -2,13 +2,14 @@ package profile import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) templ View(c echo.Context) { - @blocks.Layout("Sonr.ID", true) { - @blocks.Card("profile-view", blocks.SizeLarge) { - @blocks.ProfileCard() + @styles.Layout("Sonr.ID", true) { + @ui.Card("profile-view", styles.SizeLarge) { + @ui.ProfileCard() } } } diff --git a/pkg/nebula/components/profile/view_templ.go b/pkg/nebula/components/profile/view_templ.go index a06107e70..e7a54b9bb 100644 --- a/pkg/nebula/components/profile/view_templ.go +++ b/pkg/nebula/components/profile/view_templ.go @@ -10,7 +10,8 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) func View(c echo.Context) templ.Component { @@ -58,19 +59,19 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.ProfileCard().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.ProfileCard().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Card("profile-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.Card("profile-view", styles.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/register/modal.templ b/pkg/nebula/components/register/modal.templ index e21a74cf9..557fd3aa5 100644 --- a/pkg/nebula/components/register/modal.templ +++ b/pkg/nebula/components/register/modal.templ @@ -2,7 +2,8 @@ package register import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) templ Modal(c echo.Context) { @@ -45,9 +46,9 @@ templ Modal(c echo.Context) {

Enter your account information below to create your account.

- @blocks.Breadcrumbs() + @ui.Breadcrumbs() @basicInfoForm() - @blocks.Spacer() + @styles.Spacer()
diff --git a/pkg/nebula/components/register/modal_templ.go b/pkg/nebula/components/register/modal_templ.go index 04386e445..9cd7c8aed 100644 --- a/pkg/nebula/components/register/modal_templ.go +++ b/pkg/nebula/components/register/modal_templ.go @@ -10,7 +10,8 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/global/ui" ) func Modal(c echo.Context) templ.Component { @@ -38,7 +39,7 @@ func Modal(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = blocks.Breadcrumbs().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.Breadcrumbs().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -46,7 +47,7 @@ func Modal(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/blocks/fonts.templ b/pkg/nebula/global/styles/fonts.templ similarity index 98% rename from pkg/nebula/components/blocks/fonts.templ rename to pkg/nebula/global/styles/fonts.templ index bbd2d6e36..f75c3e699 100644 --- a/pkg/nebula/components/blocks/fonts.templ +++ b/pkg/nebula/global/styles/fonts.templ @@ -1,4 +1,4 @@ -package blocks +package styles func H1(content string) templ.Component { return renderText(1, content) diff --git a/pkg/nebula/components/blocks/fonts_templ.go b/pkg/nebula/global/styles/fonts_templ.go similarity index 96% rename from pkg/nebula/components/blocks/fonts_templ.go rename to pkg/nebula/global/styles/fonts_templ.go index 564baf691..3f6bb6eee 100644 --- a/pkg/nebula/components/blocks/fonts_templ.go +++ b/pkg/nebula/global/styles/fonts_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -54,7 +54,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 23, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 23, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -72,7 +72,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 27, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 27, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -90,7 +90,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 31, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 31, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -108,7 +108,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 35, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 35, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -159,7 +159,7 @@ func renderLink(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 42, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 42, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -209,7 +209,7 @@ func renderStrong(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 48, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 48, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -259,7 +259,7 @@ func renderEmphasis(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 54, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 54, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -309,7 +309,7 @@ func renderCode(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 60, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/fonts.templ`, Line: 60, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/components/blocks/head.templ b/pkg/nebula/global/styles/head.templ similarity index 99% rename from pkg/nebula/components/blocks/head.templ rename to pkg/nebula/global/styles/head.templ index 48e27108b..40083fadc 100644 --- a/pkg/nebula/components/blocks/head.templ +++ b/pkg/nebula/global/styles/head.templ @@ -1,4 +1,4 @@ -package blocks +package styles import "strings" diff --git a/pkg/nebula/components/blocks/head_templ.go b/pkg/nebula/global/styles/head_templ.go similarity index 99% rename from pkg/nebula/components/blocks/head_templ.go rename to pkg/nebula/global/styles/head_templ.go index 51f9e2f27..935f8ca1b 100644 --- a/pkg/nebula/components/blocks/head_templ.go +++ b/pkg/nebula/global/styles/head_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/blocks/layout.templ b/pkg/nebula/global/styles/layout.templ similarity index 99% rename from pkg/nebula/components/blocks/layout.templ rename to pkg/nebula/global/styles/layout.templ index 40c283d67..016443807 100644 --- a/pkg/nebula/components/blocks/layout.templ +++ b/pkg/nebula/global/styles/layout.templ @@ -1,4 +1,4 @@ -package blocks +package styles templ Layout(title string, remote bool) { diff --git a/pkg/nebula/components/blocks/layout_templ.go b/pkg/nebula/global/styles/layout_templ.go similarity index 98% rename from pkg/nebula/components/blocks/layout_templ.go rename to pkg/nebula/global/styles/layout_templ.go index 171a596e1..2e67402b4 100644 --- a/pkg/nebula/components/blocks/layout_templ.go +++ b/pkg/nebula/global/styles/layout_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -52,7 +52,7 @@ func Layout(title string, remote bool) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/layout.templ`, Line: 13, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 13, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -118,7 +118,7 @@ func LayoutNoBody(title string, remote bool) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/layout.templ`, Line: 37, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 37, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/components/blocks/sizes.templ b/pkg/nebula/global/styles/sizes.templ similarity index 98% rename from pkg/nebula/components/blocks/sizes.templ rename to pkg/nebula/global/styles/sizes.templ index a36727643..1059a817c 100644 --- a/pkg/nebula/components/blocks/sizes.templ +++ b/pkg/nebula/global/styles/sizes.templ @@ -1,4 +1,4 @@ -package blocks +package styles type Size int diff --git a/pkg/nebula/components/blocks/sizes_templ.go b/pkg/nebula/global/styles/sizes_templ.go similarity index 98% rename from pkg/nebula/components/blocks/sizes_templ.go rename to pkg/nebula/global/styles/sizes_templ.go index 3a6e40584..4e9555a0c 100644 --- a/pkg/nebula/components/blocks/sizes_templ.go +++ b/pkg/nebula/global/styles/sizes_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/blocks/badge.templ b/pkg/nebula/global/ui/badge.templ similarity index 99% rename from pkg/nebula/components/blocks/badge.templ rename to pkg/nebula/global/ui/badge.templ index a8ac1584e..266d6fbf7 100644 --- a/pkg/nebula/components/blocks/badge.templ +++ b/pkg/nebula/global/ui/badge.templ @@ -1,4 +1,4 @@ -package blocks +package ui templ PoweredBySonr() {
diff --git a/pkg/nebula/components/blocks/badge_templ.go b/pkg/nebula/global/ui/badge_templ.go similarity index 99% rename from pkg/nebula/components/blocks/badge_templ.go rename to pkg/nebula/global/ui/badge_templ.go index 202f7ab97..606c77c21 100644 --- a/pkg/nebula/components/blocks/badge_templ.go +++ b/pkg/nebula/global/ui/badge_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package ui //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/blocks/button.templ b/pkg/nebula/global/ui/button.templ similarity index 94% rename from pkg/nebula/components/blocks/button.templ rename to pkg/nebula/global/ui/button.templ index 6f05f6b4e..81e240a43 100644 --- a/pkg/nebula/components/blocks/button.templ +++ b/pkg/nebula/global/ui/button.templ @@ -1,7 +1,22 @@ -package blocks +package ui + +import "github.com/onsonr/sonr/pkg/nebula/global/styles" + +templ PrimaryButton(href string, text string) { +
+
{ text }
+
+} + +templ SecondaryButton(href string, text string) { +
+
{ text }
+
+} + type button struct { - variant Variant + variant styles.Variant hxGet string hxPost string hxTarget string diff --git a/pkg/nebula/components/blocks/button_templ.go b/pkg/nebula/global/ui/button_templ.go similarity index 74% rename from pkg/nebula/components/blocks/button_templ.go rename to pkg/nebula/global/ui/button_templ.go index b7a09278a..315dc1fce 100644 --- a/pkg/nebula/components/blocks/button_templ.go +++ b/pkg/nebula/global/ui/button_templ.go @@ -1,15 +1,127 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package ui //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" +import "github.com/onsonr/sonr/pkg/nebula/global/styles" + +func PrimaryButton(href string, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/ui/button.templ`, Line: 7, Col: 133} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func SecondaryButton(href string, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/ui/button.templ`, Line: 13, Col: 132} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + type button struct { - variant Variant + variant styles.Variant hxGet string hxPost string hxTarget string @@ -100,9 +212,9 @@ func renderButton(attrs templ.Attributes) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" + diff --git a/pkg/nebula/components/blocks/panel_templ.go b/pkg/nebula/global/ui/panel_templ.go similarity index 98% rename from pkg/nebula/components/blocks/panel_templ.go rename to pkg/nebula/global/ui/panel_templ.go index 420409a2c..ce84cd57b 100644 --- a/pkg/nebula/components/blocks/panel_templ.go +++ b/pkg/nebula/global/ui/panel_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package ui //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -100,7 +100,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/panel.templ`, Line: 25, Col: 126} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/ui/panel.templ`, Line: 26, Col: 126} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -118,7 +118,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/panel.templ`, Line: 27, Col: 118} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/ui/panel.templ`, Line: 28, Col: 118} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -154,7 +154,7 @@ func breadcrumbIcon() templ.Component { templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } From bda8171af419833c98362e7f9547e78e463faaf7 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:21:07 -0400 Subject: [PATCH 06/57] feat: add tailwind utility classes --- pkg/nebula/assets/css/styles.css | 591 +++++++++++++++++++++++++++++++ pkg/nebula/tailwind.config.js | 2 +- 2 files changed, 592 insertions(+), 1 deletion(-) diff --git a/pkg/nebula/assets/css/styles.css b/pkg/nebula/assets/css/styles.css index 2519f309e..8db54c9f3 100644 --- a/pkg/nebula/assets/css/styles.css +++ b/pkg/nebula/assets/css/styles.css @@ -992,6 +992,10 @@ select{ left: 0px; } +.left-1\/2{ + left: 50%; +} + .right-0{ right: 0px; } @@ -1024,6 +1028,10 @@ select{ z-index: 40; } +.z-50{ + z-index: 50; +} + .z-\[99\]{ z-index: 99; } @@ -1063,6 +1071,10 @@ select{ margin-bottom: 0.5rem; } +.mb-3{ + margin-bottom: 0.75rem; +} + .mb-4{ margin-bottom: 1rem; } @@ -1083,6 +1095,10 @@ select{ margin-left: 0.5rem; } +.mr-1{ + margin-right: 0.25rem; +} + .mr-2{ margin-right: 0.5rem; } @@ -1099,10 +1115,22 @@ select{ margin-right: 1.25rem; } +.mr-7{ + margin-right: 1.75rem; +} + .mt-1{ margin-top: 0.25rem; } +.mt-12{ + margin-top: 3rem; +} + +.mt-2{ + margin-top: 0.5rem; +} + .mt-24{ margin-top: 6rem; } @@ -1163,6 +1191,14 @@ select{ height: 5rem; } +.h-3{ + height: 0.75rem; +} + +.h-32{ + height: 8rem; +} + .h-4{ height: 1rem; } @@ -1171,10 +1207,18 @@ select{ height: 1.25rem; } +.h-6{ + height: 1.5rem; +} + .h-8{ height: 2rem; } +.h-9{ + height: 2.25rem; +} + .h-\[280px\]{ height: 280px; } @@ -1191,6 +1235,10 @@ select{ height: 100vh; } +.min-h-screen{ + min-height: 100vh; +} + .w-0{ width: 0px; } @@ -1199,10 +1247,22 @@ select{ width: 33.333333%; } +.w-14{ + width: 3.5rem; +} + +.w-16{ + width: 4rem; +} + .w-20{ width: 5rem; } +.w-3{ + width: 0.75rem; +} + .w-4{ width: 1rem; } @@ -1211,6 +1271,10 @@ select{ width: 1.25rem; } +.w-6{ + width: 1.5rem; +} + .w-8{ width: 2rem; } @@ -1219,14 +1283,27 @@ select{ width: 22rem; } +.w-\[365px\]{ + width: 365px; +} + .w-\[calc\(100\%\+1rem\)\]{ width: calc(100% + 1rem); } +.w-\[full\]{ + width: full; +} + .w-auto{ width: auto; } +.w-fit{ + width: -moz-fit-content; + width: fit-content; +} + .w-full{ width: 100%; } @@ -1235,6 +1312,10 @@ select{ width: 100vw; } +.max-w-2xl{ + max-width: 42rem; +} + .max-w-3xl{ max-width: 48rem; } @@ -1255,10 +1336,18 @@ select{ max-width: 94rem; } +.max-w-lg{ + max-width: 32rem; +} + .max-w-md{ max-width: 28rem; } +.max-w-screen-sm{ + max-width: 640px; +} + .max-w-sm{ max-width: 24rem; } @@ -1283,11 +1372,26 @@ select{ flex-grow: 1; } +.-translate-x-0{ + --tw-translate-x: -0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .-translate-x-1\/2{ --tw-translate-x: -50%; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.-translate-x-4{ + --tw-translate-x: -1rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.-translate-x-7{ + --tw-translate-x: -1.75rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .-translate-x-8{ --tw-translate-x: -2rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1298,6 +1402,11 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.-translate-y-0\.5{ + --tw-translate-y: -0.125rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .-translate-y-4{ --tw-translate-y: -1rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1328,6 +1437,16 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.translate-y-24{ + --tw-translate-y: 6rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.translate-y-3{ + --tw-translate-y: 0.75rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .translate-y-4{ --tw-translate-y: 1rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1387,6 +1506,10 @@ select{ animation: infinite-scroll-inverse 60s linear infinite; } +.cursor-default{ + cursor: default; +} + .cursor-pointer{ cursor: pointer; } @@ -1395,6 +1518,10 @@ select{ grid-template-columns: repeat(2, minmax(0, 1fr)); } +.flex-row{ + flex-direction: row; +} + .flex-col{ flex-direction: column; } @@ -1439,6 +1566,14 @@ select{ gap: 3rem; } +.gap-2{ + gap: 0.5rem; +} + +.gap-3{ + gap: 0.75rem; +} + .gap-4{ gap: 1rem; } @@ -1447,6 +1582,15 @@ select{ gap: 2rem; } +.gap-x-3{ + -moz-column-gap: 0.75rem; + column-gap: 0.75rem; +} + +.gap-y-3{ + row-gap: 0.75rem; +} + .space-x-1 > :not([hidden]) ~ :not([hidden]){ --tw-space-x-reverse: 0; margin-right: calc(0.25rem * var(--tw-space-x-reverse)); @@ -1534,6 +1678,10 @@ select{ border-width: 1px; } +.border-2{ + border-width: 2px; +} + .border-\[2px\]{ border-width: 2px; } @@ -1542,16 +1690,44 @@ select{ border-top-width: 1px; } +.border-blue-600{ + --tw-border-opacity: 1; + border-color: rgb(37 99 235 / var(--tw-border-opacity)); +} + +.border-green-600{ + --tw-border-opacity: 1; + border-color: rgb(22 163 74 / var(--tw-border-opacity)); +} + .border-neutral-200{ --tw-border-opacity: 1; border-color: rgb(229 229 229 / var(--tw-border-opacity)); } +.border-neutral-200\/60{ + border-color: rgb(229 229 229 / 0.6); +} + +.border-neutral-200\/70{ + border-color: rgb(229 229 229 / 0.7); +} + .border-neutral-300{ --tw-border-opacity: 1; border-color: rgb(212 212 212 / var(--tw-border-opacity)); } +.border-neutral-900{ + --tw-border-opacity: 1; + border-color: rgb(23 23 23 / var(--tw-border-opacity)); +} + +.border-red-600{ + --tw-border-opacity: 1; + border-color: rgb(220 38 38 / var(--tw-border-opacity)); +} + .border-transparent{ border-color: transparent; } @@ -1561,6 +1737,11 @@ select{ border-color: rgb(255 255 255 / var(--tw-border-opacity)); } +.border-yellow-500{ + --tw-border-opacity: 1; + border-color: rgb(234 179 8 / var(--tw-border-opacity)); +} + .border-zinc-200{ --tw-border-opacity: 1; border-color: rgb(228 228 231 / var(--tw-border-opacity)); @@ -1576,16 +1757,51 @@ select{ border-color: rgb(82 82 91 / var(--tw-border-opacity)); } +.bg-blue-50{ + --tw-bg-opacity: 1; + background-color: rgb(239 246 255 / var(--tw-bg-opacity)); +} + .bg-blue-600{ --tw-bg-opacity: 1; background-color: rgb(37 99 235 / var(--tw-bg-opacity)); } +.bg-green-50{ + --tw-bg-opacity: 1; + background-color: rgb(240 253 244 / var(--tw-bg-opacity)); +} + +.bg-green-600{ + --tw-bg-opacity: 1; + background-color: rgb(22 163 74 / var(--tw-bg-opacity)); +} + +.bg-neutral-50{ + --tw-bg-opacity: 1; + background-color: rgb(250 250 250 / var(--tw-bg-opacity)); +} + +.bg-neutral-900{ + --tw-bg-opacity: 1; + background-color: rgb(23 23 23 / var(--tw-bg-opacity)); +} + .bg-neutral-950{ --tw-bg-opacity: 1; background-color: rgb(10 10 10 / var(--tw-bg-opacity)); } +.bg-red-50{ + --tw-bg-opacity: 1; + background-color: rgb(254 242 242 / var(--tw-bg-opacity)); +} + +.bg-red-600{ + --tw-bg-opacity: 1; + background-color: rgb(220 38 38 / var(--tw-bg-opacity)); +} + .bg-transparent{ background-color: transparent; } @@ -1595,6 +1811,16 @@ select{ background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } +.bg-yellow-50{ + --tw-bg-opacity: 1; + background-color: rgb(254 252 232 / var(--tw-bg-opacity)); +} + +.bg-yellow-600{ + --tw-bg-opacity: 1; + background-color: rgb(202 138 4 / var(--tw-bg-opacity)); +} + .bg-zinc-100{ --tw-bg-opacity: 1; background-color: rgb(244 244 245 / var(--tw-bg-opacity)); @@ -1693,6 +1919,10 @@ select{ object-position: left; } +.p-1{ + padding: 0.25rem; +} + .p-4{ padding: 1rem; } @@ -1705,6 +1935,10 @@ select{ padding: 1.5rem; } +.p-7{ + padding: 1.75rem; +} + .px-0\.5{ padding-left: 0.125rem; padding-right: 0.125rem; @@ -1715,16 +1949,31 @@ select{ padding-right: 0.5rem; } +.px-2\.5{ + padding-left: 0.625rem; + padding-right: 0.625rem; +} + .px-3{ padding-left: 0.75rem; padding-right: 0.75rem; } +.px-3\.5{ + padding-left: 0.875rem; + padding-right: 0.875rem; +} + .px-4{ padding-left: 1rem; padding-right: 1rem; } +.px-5{ + padding-left: 1.25rem; + padding-right: 1.25rem; +} + .px-6{ padding-left: 1.5rem; padding-right: 1.5rem; @@ -1745,6 +1994,11 @@ select{ padding-bottom: 0.125rem; } +.py-1{ + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + .py-12{ padding-top: 3rem; padding-bottom: 3rem; @@ -1780,10 +2034,18 @@ select{ padding-bottom: 1px; } +.pb-1{ + padding-bottom: 0.25rem; +} + .pb-12{ padding-bottom: 3rem; } +.pb-2{ + padding-bottom: 0.5rem; +} + .pb-3{ padding-bottom: 0.75rem; } @@ -1792,10 +2054,26 @@ select{ padding-bottom: 1rem; } +.pb-6{ + padding-bottom: 1.5rem; +} + .pb-8{ padding-bottom: 2rem; } +.pl-4{ + padding-left: 1rem; +} + +.pr-2{ + padding-right: 0.5rem; +} + +.pr-4{ + padding-right: 1rem; +} + .pt-0{ padding-top: 0px; } @@ -1804,6 +2082,10 @@ select{ padding-top: 3rem; } +.pt-2{ + padding-top: 0.5rem; +} + .pt-32{ padding-top: 8rem; } @@ -1812,6 +2094,10 @@ select{ padding-top: 1.5rem; } +.pt-8{ + padding-top: 2rem; +} + .text-left{ text-align: left; } @@ -1824,6 +2110,10 @@ select{ vertical-align: top; } +.font-inter{ + font-family: Inter, sans-serif; +} + .font-inter-tight{ font-family: Inter Tight, sans-serif; } @@ -1854,6 +2144,12 @@ select{ font-size: 0.6rem; } +.text-base{ + font-size: 1rem; + line-height: 1.5; + letter-spacing: -0.017em; +} + .text-lg{ font-size: 1.125rem; line-height: 1.5; @@ -1865,6 +2161,12 @@ select{ line-height: 1.5715; } +.text-xl{ + font-size: 1.25rem; + line-height: 1.5; + letter-spacing: -0.017em; +} + .text-xs{ font-size: 0.75rem; line-height: 1.5; @@ -1882,6 +2184,10 @@ select{ font-weight: 500; } +.font-normal{ + font-weight: 400; +} + .font-semibold{ font-weight: 600; } @@ -1915,11 +2221,50 @@ select{ letter-spacing: 0.025em; } +.text-blue-500{ + --tw-text-opacity: 1; + color: rgb(59 130 246 / var(--tw-text-opacity)); +} + .text-blue-600{ --tw-text-opacity: 1; color: rgb(37 99 235 / var(--tw-text-opacity)); } +.text-gray-400{ + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + +.text-gray-400\/70{ + color: rgb(156 163 175 / 0.7); +} + +.text-gray-500{ + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} + +.text-gray-600{ + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} + +.text-green-500{ + --tw-text-opacity: 1; + color: rgb(34 197 94 / var(--tw-text-opacity)); +} + +.text-green-600{ + --tw-text-opacity: 1; + color: rgb(22 163 74 / var(--tw-text-opacity)); +} + +.text-neutral-100{ + --tw-text-opacity: 1; + color: rgb(245 245 245 / var(--tw-text-opacity)); +} + .text-neutral-500{ --tw-text-opacity: 1; color: rgb(115 115 115 / var(--tw-text-opacity)); @@ -1930,6 +2275,26 @@ select{ color: rgb(82 82 82 / var(--tw-text-opacity)); } +.text-neutral-800{ + --tw-text-opacity: 1; + color: rgb(38 38 38 / var(--tw-text-opacity)); +} + +.text-neutral-900{ + --tw-text-opacity: 1; + color: rgb(23 23 23 / var(--tw-text-opacity)); +} + +.text-red-500{ + --tw-text-opacity: 1; + color: rgb(239 68 68 / var(--tw-text-opacity)); +} + +.text-red-600{ + --tw-text-opacity: 1; + color: rgb(220 38 38 / var(--tw-text-opacity)); +} + .text-transparent{ color: transparent; } @@ -1939,6 +2304,11 @@ select{ color: rgb(255 255 255 / var(--tw-text-opacity)); } +.text-yellow-600{ + --tw-text-opacity: 1; + color: rgb(202 138 4 / var(--tw-text-opacity)); +} + .text-zinc-100{ --tw-text-opacity: 1; color: rgb(244 244 245 / var(--tw-text-opacity)); @@ -1991,6 +2361,11 @@ select{ text-underline-offset: 4px; } +.antialiased{ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + .opacity-0{ opacity: 0; } @@ -2069,6 +2444,10 @@ select{ transition-duration: 150ms; } +.duration-100{ + transition-duration: 100ms; +} + .duration-200{ transition-duration: 200ms; } @@ -2718,16 +3097,81 @@ input[type="search"]::-webkit-search-results-decoration { display: none; } +.hover\:bg-blue-100:hover{ + --tw-bg-opacity: 1; + background-color: rgb(219 234 254 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-600:hover{ + --tw-bg-opacity: 1; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-700:hover{ + --tw-bg-opacity: 1; + background-color: rgb(29 78 216 / var(--tw-bg-opacity)); +} + +.hover\:bg-green-100:hover{ + --tw-bg-opacity: 1; + background-color: rgb(220 252 231 / var(--tw-bg-opacity)); +} + +.hover\:bg-green-600:hover{ + --tw-bg-opacity: 1; + background-color: rgb(22 163 74 / var(--tw-bg-opacity)); +} + +.hover\:bg-green-700:hover{ + --tw-bg-opacity: 1; + background-color: rgb(21 128 61 / var(--tw-bg-opacity)); +} + .hover\:bg-neutral-100:hover{ --tw-bg-opacity: 1; background-color: rgb(245 245 245 / var(--tw-bg-opacity)); } +.hover\:bg-neutral-800:hover{ + --tw-bg-opacity: 1; + background-color: rgb(38 38 38 / var(--tw-bg-opacity)); +} + .hover\:bg-neutral-900:hover{ --tw-bg-opacity: 1; background-color: rgb(23 23 23 / var(--tw-bg-opacity)); } +.hover\:bg-red-100:hover{ + --tw-bg-opacity: 1; + background-color: rgb(254 226 226 / var(--tw-bg-opacity)); +} + +.hover\:bg-red-600:hover{ + --tw-bg-opacity: 1; + background-color: rgb(220 38 38 / var(--tw-bg-opacity)); +} + +.hover\:bg-red-700:hover{ + --tw-bg-opacity: 1; + background-color: rgb(185 28 28 / var(--tw-bg-opacity)); +} + +.hover\:bg-yellow-100:hover{ + --tw-bg-opacity: 1; + background-color: rgb(254 249 195 / var(--tw-bg-opacity)); +} + +.hover\:bg-yellow-500:hover{ + --tw-bg-opacity: 1; + background-color: rgb(234 179 8 / var(--tw-bg-opacity)); +} + +.hover\:bg-yellow-700:hover{ + --tw-bg-opacity: 1; + background-color: rgb(161 98 7 / var(--tw-bg-opacity)); +} + .hover\:bg-zinc-50:hover{ --tw-bg-opacity: 1; background-color: rgb(250 250 250 / var(--tw-bg-opacity)); @@ -2738,6 +3182,46 @@ input[type="search"]::-webkit-search-results-decoration { background-color: rgb(39 39 42 / var(--tw-bg-opacity)); } +.hover\:text-blue-600:hover{ + --tw-text-opacity: 1; + color: rgb(37 99 235 / var(--tw-text-opacity)); +} + +.hover\:text-green-600:hover{ + --tw-text-opacity: 1; + color: rgb(22 163 74 / var(--tw-text-opacity)); +} + +.hover\:text-neutral-600:hover{ + --tw-text-opacity: 1; + color: rgb(82 82 82 / var(--tw-text-opacity)); +} + +.hover\:text-neutral-700:hover{ + --tw-text-opacity: 1; + color: rgb(64 64 64 / var(--tw-text-opacity)); +} + +.hover\:text-neutral-900:hover{ + --tw-text-opacity: 1; + color: rgb(23 23 23 / var(--tw-text-opacity)); +} + +.hover\:text-red-600:hover{ + --tw-text-opacity: 1; + color: rgb(220 38 38 / var(--tw-text-opacity)); +} + +.hover\:text-white:hover{ + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.hover\:text-yellow-700:hover{ + --tw-text-opacity: 1; + color: rgb(161 98 7 / var(--tw-text-opacity)); +} + .hover\:text-zinc-300:hover{ --tw-text-opacity: 1; color: rgb(212 212 216 / var(--tw-text-opacity)); @@ -2753,6 +3237,10 @@ input[type="search"]::-webkit-search-results-decoration { color: rgb(24 24 27 / var(--tw-text-opacity)); } +.hover\:underline:hover{ + text-decoration-line: underline; +} + .hover\:opacity-100:hover{ opacity: 1; } @@ -2767,6 +3255,11 @@ input[type="search"]::-webkit-search-results-decoration { border-color: rgb(212 212 216 / var(--tw-border-opacity)); } +.focus\:bg-white:focus{ + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + .focus\:no-underline:focus{ text-decoration-line: none; } @@ -2782,11 +3275,35 @@ input[type="search"]::-webkit-search-results-decoration { box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); } +.focus\:ring-blue-100:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(219 234 254 / var(--tw-ring-opacity)); +} + +.focus\:ring-blue-700:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(29 78 216 / var(--tw-ring-opacity)); +} + +.focus\:ring-green-100:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(220 252 231 / var(--tw-ring-opacity)); +} + +.focus\:ring-green-700:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(21 128 61 / var(--tw-ring-opacity)); +} + .focus\:ring-neutral-100:focus{ --tw-ring-opacity: 1; --tw-ring-color: rgb(245 245 245 / var(--tw-ring-opacity)); } +.focus\:ring-neutral-200\/60:focus{ + --tw-ring-color: rgb(229 229 229 / 0.6); +} + .focus\:ring-neutral-400:focus{ --tw-ring-opacity: 1; --tw-ring-color: rgb(163 163 163 / var(--tw-ring-opacity)); @@ -2797,6 +3314,26 @@ input[type="search"]::-webkit-search-results-decoration { --tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity)); } +.focus\:ring-red-100:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(254 226 226 / var(--tw-ring-opacity)); +} + +.focus\:ring-red-700:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(185 28 28 / var(--tw-ring-opacity)); +} + +.focus\:ring-yellow-100:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(254 249 195 / var(--tw-ring-opacity)); +} + +.focus\:ring-yellow-700:focus{ + --tw-ring-opacity: 1; + --tw-ring-color: rgb(161 98 7 / var(--tw-ring-opacity)); +} + .focus\:ring-offset-2:focus{ --tw-ring-offset-width: 2px; } @@ -2816,6 +3353,11 @@ input[type="search"]::-webkit-search-results-decoration { --tw-ring-offset-width: 2px; } +.active\:bg-white:active{ + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + .disabled\:pointer-events-none:disabled{ pointer-events: none; } @@ -2859,6 +3401,12 @@ input[type="search"]::-webkit-search-results-decoration { opacity: 0.7; } +@supports (overflow:clip){ + .supports-\[overflow\:clip\]\:overflow-clip{ + overflow: clip; + } +} + @media not all and (min-width: 1024px){ .max-lg\:w-32{ width: 8rem; @@ -2885,6 +3433,10 @@ input[type="search"]::-webkit-search-results-decoration { grid-column: span 6 / span 6; } + .sm\:mb-0{ + margin-bottom: 0px; + } + .sm\:inline-flex{ display: inline-flex; } @@ -2988,6 +3540,10 @@ input[type="search"]::-webkit-search-results-decoration { grid-template-columns: repeat(4, minmax(0, 1fr)); } + .md\:flex-row{ + flex-direction: row; + } + .md\:justify-start{ justify-content: flex-start; } @@ -2996,6 +3552,10 @@ input[type="search"]::-webkit-search-results-decoration { gap: 0px; } + .md\:gap-4{ + gap: 1rem; + } + .md\:gap-6{ gap: 1.5rem; } @@ -3128,11 +3688,33 @@ input[type="search"]::-webkit-search-results-decoration { background-color: rgb(0 0 0 / 0.1); } + .lg\:p-24{ + padding: 6rem; + } + .lg\:px-5{ padding-left: 1.25rem; padding-right: 1.25rem; } + .lg\:text-2xl{ + font-size: 1.5rem; + line-height: 1.415; + letter-spacing: -0.017em; + } + + .lg\:text-3xl{ + font-size: 2rem; + line-height: 1.3125; + letter-spacing: -0.017em; + } + + .lg\:text-xl{ + font-size: 1.25rem; + line-height: 1.5; + letter-spacing: -0.017em; + } + .lg\:text-white{ --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); @@ -3155,3 +3737,12 @@ input[type="search"]::-webkit-search-results-decoration { margin-left: 0.75rem; margin-right: 0.75rem; } + +.\[\&_\.active-breadcrumb\]\:font-medium .active-breadcrumb{ + font-weight: 500; +} + +.\[\&_\.active-breadcrumb\]\:text-neutral-600 .active-breadcrumb{ + --tw-text-opacity: 1; + color: rgb(82 82 82 / var(--tw-text-opacity)); +} diff --git a/pkg/nebula/tailwind.config.js b/pkg/nebula/tailwind.config.js index 6e753ae17..d8ee80a8b 100644 --- a/pkg/nebula/tailwind.config.js +++ b/pkg/nebula/tailwind.config.js @@ -2,7 +2,7 @@ module.exports = { content: [ "./components/**/*.{templ,html}", - "./pages/**/*.{templ,html}", + "./global/**/*.{templ,html}", "./src/**/*.ts", ], theme: { From b68b47ab32760e548e9f040bfe0da23c7fe46e2b Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:22:13 -0400 Subject: [PATCH 07/57] fix: fix broken logo image path --- pkg/nebula/components/home/cta.templ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nebula/components/home/cta.templ b/pkg/nebula/components/home/cta.templ index 00c950a3d..e94973686 100644 --- a/pkg/nebula/components/home/cta.templ +++ b/pkg/nebula/components/home/cta.templ @@ -7,7 +7,7 @@ templ CallToAction() {

From e424faaba2e91a60c60a8ab64b858fa13ae7d297 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:22:24 -0400 Subject: [PATCH 08/57] feat: add client logos to homepage --- pkg/nebula/components/home/cta_templ.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nebula/components/home/cta_templ.go b/pkg/nebula/components/home/cta_templ.go index 7879e688f..44d5e0a6f 100644 --- a/pkg/nebula/components/home/cta_templ.go +++ b/pkg/nebula/components/home/cta_templ.go @@ -29,7 +29,7 @@ func CallToAction() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"

Take control of your Identity today

Sonr removes creative distances by connecting beginners, pros, and every team in between. Are you ready to start your journey?

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"

Take control of your Identity today

Sonr removes creative distances by connecting beginners, pros, and every team in between. Are you ready to start your journey?

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } From ab476712afa422b3c9bca37d1d0dc61097ca1ea7 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:24:30 -0400 Subject: [PATCH 09/57] feat(vault): introduce assembly of the initial vault --- Makefile | 2 +- x/vault/keeper/assembly.go | 55 ++++++++++++++++++++++++++++++++++++++ x/vault/keeper/keeper.go | 50 ---------------------------------- 3 files changed, 56 insertions(+), 51 deletions(-) create mode 100644 x/vault/keeper/assembly.go diff --git a/Makefile b/Makefile index bb4480d55..f795d0b29 100644 --- a/Makefile +++ b/Makefile @@ -299,7 +299,6 @@ sh-testnet: mod-tidy hway: @echo "(motr) Building Highway gateway" - templ generate go build -o ./build/hway ./cmd/hway motr: @@ -313,6 +312,7 @@ templ: nebula: @echo "(nebula) Building nebula" cd pkg/nebula && bun run build + templ generate pkl: @echo "(pkl) Building PKL" diff --git a/x/vault/keeper/assembly.go b/x/vault/keeper/assembly.go new file mode 100644 index 000000000..5df017f35 --- /dev/null +++ b/x/vault/keeper/assembly.go @@ -0,0 +1,55 @@ +package keeper + +import ( + "context" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onsonr/sonr/pkg/dwn" + "github.com/onsonr/sonr/x/vault/types" +) + +// assembleVault assembles the initial vault +func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) { + _, con, err := k.DIDKeeper.NewController(ctx) + if err != nil { + return "", 0, err + } + usrKs, err := con.ExportUserKs() + if err != nil { + return "", 0, err + } + sch, err := k.CurrentSchema(ctx) + if err != nil { + return "", 0, err + } + v, err := types.NewVault(usrKs, con.SonrAddress(), con.ChainID(), sch) + if err != nil { + return "", 0, err + } + cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) + if err != nil { + return "", 0, err + } + return cid.String(), k.CalculateExpiration(ctx, time.Second*15), nil +} + +// currentSchema returns the current schema +func (k Keeper) CurrentSchema(ctx sdk.Context) (*dwn.Schema, error) { + p, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + schema := p.Schema + return &dwn.Schema{ + Version: int(schema.Version), + Account: schema.Account, + Asset: schema.Asset, + Chain: schema.Chain, + Credential: schema.Credential, + Jwk: schema.Jwk, + Grant: schema.Grant, + Keyshare: schema.Keyshare, + Profile: schema.Profile, + }, nil +} diff --git a/x/vault/keeper/keeper.go b/x/vault/keeper/keeper.go index d526523af..d4cb77e35 100644 --- a/x/vault/keeper/keeper.go +++ b/x/vault/keeper/keeper.go @@ -1,22 +1,17 @@ package keeper import ( - "context" - "time" - "cosmossdk.io/collections" storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/orm/model/ormdb" "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ipfs/kubo/client/rpc" apiv1 "github.com/onsonr/sonr/api/vault/v1" - "github.com/onsonr/sonr/pkg/dwn" didkeeper "github.com/onsonr/sonr/x/did/keeper" "github.com/onsonr/sonr/x/vault/types" ) @@ -88,48 +83,3 @@ func NewKeeper( return k } - -// currentSchema returns the current schema -func (k Keeper) CurrentSchema(ctx sdk.Context) (*dwn.Schema, error) { - p, err := k.Params.Get(ctx) - if err != nil { - return nil, err - } - schema := p.Schema - return &dwn.Schema{ - Version: int(schema.Version), - Account: schema.Account, - Asset: schema.Asset, - Chain: schema.Chain, - Credential: schema.Credential, - Jwk: schema.Jwk, - Grant: schema.Grant, - Keyshare: schema.Keyshare, - Profile: schema.Profile, - }, nil -} - -// assembleVault assembles the initial vault -func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) { - _, con, err := k.DIDKeeper.NewController(ctx) - if err != nil { - return "", 0, err - } - usrKs, err := con.ExportUserKs() - if err != nil { - return "", 0, err - } - sch, err := k.CurrentSchema(ctx) - if err != nil { - return "", 0, err - } - v, err := types.NewVault(usrKs, con.SonrAddress(), con.ChainID(), sch) - if err != nil { - return "", 0, err - } - cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) - if err != nil { - return "", 0, err - } - return cid.String(), k.CalculateExpiration(ctx, time.Second*15), nil -} From c35d3bb1ae675c62ec2362ba8fb7d6b1093ee16a Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:31:39 -0400 Subject: [PATCH 10/57] refactor: move ui components to global --- pkg/nebula/components/home/footer.templ | 2 +- pkg/nebula/components/home/footer_templ.go | 2 +- pkg/nebula/components/home/hero.templ | 2 +- pkg/nebula/components/home/hero_templ.go | 2 +- pkg/nebula/components/ui/button.templ | 13 --- pkg/nebula/components/ui/button_templ.go | 121 --------------------- 6 files changed, 4 insertions(+), 138 deletions(-) delete mode 100644 pkg/nebula/components/ui/button.templ delete mode 100644 pkg/nebula/components/ui/button_templ.go diff --git a/pkg/nebula/components/home/footer.templ b/pkg/nebula/components/home/footer.templ index 94c68ba79..3c7aae22c 100644 --- a/pkg/nebula/components/home/footer.templ +++ b/pkg/nebula/components/home/footer.templ @@ -11,7 +11,7 @@ templ Footer() {
© diDAO DUNA. All rights reserved.
diff --git a/pkg/nebula/components/home/footer_templ.go b/pkg/nebula/components/home/footer_templ.go index b036f4ece..e0ec437ee 100644 --- a/pkg/nebula/components/home/footer_templ.go +++ b/pkg/nebula/components/home/footer_templ.go @@ -29,7 +29,7 @@ func Footer() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/hero.templ b/pkg/nebula/components/home/hero.templ index 9eda2d7e1..af7fa387f 100644 --- a/pkg/nebula/components/home/hero.templ +++ b/pkg/nebula/components/home/hero.templ @@ -1,7 +1,7 @@ package home import ( - "github.com/onsonr/sonr/pkg/nebula/components/ui" + "github.com/onsonr/sonr/pkg/nebula/global/ui" "github.com/onsonr/sonr/pkg/nebula/models" ) diff --git a/pkg/nebula/components/home/hero_templ.go b/pkg/nebula/components/home/hero_templ.go index 84de2bf4f..c49cc83fd 100644 --- a/pkg/nebula/components/home/hero_templ.go +++ b/pkg/nebula/components/home/hero_templ.go @@ -9,7 +9,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/nebula/components/ui" + "github.com/onsonr/sonr/pkg/nebula/global/ui" "github.com/onsonr/sonr/pkg/nebula/models" ) diff --git a/pkg/nebula/components/ui/button.templ b/pkg/nebula/components/ui/button.templ deleted file mode 100644 index 3d488ea97..000000000 --- a/pkg/nebula/components/ui/button.templ +++ /dev/null @@ -1,13 +0,0 @@ -package ui - -templ PrimaryButton(href string, text string) { -
-
{ text }
-
-} - -templ SecondaryButton(href string, text string) { -
-
{ text }
-
-} diff --git a/pkg/nebula/components/ui/button_templ.go b/pkg/nebula/components/ui/button_templ.go deleted file mode 100644 index 86b8787f9..000000000 --- a/pkg/nebula/components/ui/button_templ.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package ui - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func PrimaryButton(href string, text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/ui/button.templ`, Line: 5, Col: 133} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func SecondaryButton(href string, text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/ui/button.templ`, Line: 11, Col: 132} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate From 37fb0b3aca493ac0865e8268cbfb257bbdd06218 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:39:50 -0400 Subject: [PATCH 11/57] refactor: remove unused component templates --- app/proxy/proxycmd.go | 56 ------------ cmd/hway/server/server.go | 4 +- cmd/sonrd/main.go | 2 - pkg/nebula/components/grant/view.templ | 17 ---- pkg/nebula/components/grant/view_templ.go | 91 ------------------- .../home/{ => sections}/bento.templ | 2 +- .../home/{ => sections}/bento_templ.go | 2 +- .../components/home/{ => sections}/cta.templ | 3 +- .../home/{ => sections}/cta_templ.go | 2 +- .../home/{ => sections}/features.templ | 3 +- .../home/{ => sections}/features_templ.go | 2 +- .../home/{ => sections}/footer.templ | 2 +- .../home/{ => sections}/footer_templ.go | 2 +- .../home/{ => sections}/header.templ | 2 +- .../home/{ => sections}/header_templ.go | 2 +- .../components/home/{ => sections}/hero.templ | 2 +- .../home/{ => sections}/hero_templ.go | 16 ++-- .../home/{ => sections}/highlights.templ | 2 +- .../home/{ => sections}/highlights_templ.go | 2 +- .../home/{ => sections}/lowlights.templ | 2 +- .../home/{ => sections}/lowlights_templ.go | 2 +- pkg/nebula/components/home/view.templ | 17 ++-- pkg/nebula/components/home/view_templ.go | 17 ++-- pkg/nebula/components/profile/view.templ | 15 --- pkg/nebula/components/profile/view_templ.go | 82 ----------------- pkg/nebula/global/styles/layout.templ | 48 ++++++++++ pkg/nebula/global/styles/layout_templ.go | 63 +++++++++++++ pkg/nebula/router/router.go | 9 -- 28 files changed, 156 insertions(+), 313 deletions(-) delete mode 100644 app/proxy/proxycmd.go delete mode 100644 pkg/nebula/components/grant/view.templ delete mode 100644 pkg/nebula/components/grant/view_templ.go rename pkg/nebula/components/home/{ => sections}/bento.templ (99%) rename pkg/nebula/components/home/{ => sections}/bento_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/cta.templ (99%) rename pkg/nebula/components/home/{ => sections}/cta_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/features.templ (99%) rename pkg/nebula/components/home/{ => sections}/features_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/footer.templ (99%) rename pkg/nebula/components/home/{ => sections}/footer_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/header.templ (98%) rename pkg/nebula/components/home/{ => sections}/header_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/hero.templ (99%) rename pkg/nebula/components/home/{ => sections}/hero_templ.go (97%) rename pkg/nebula/components/home/{ => sections}/highlights.templ (99%) rename pkg/nebula/components/home/{ => sections}/highlights_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/lowlights.templ (99%) rename pkg/nebula/components/home/{ => sections}/lowlights_templ.go (99%) delete mode 100644 pkg/nebula/components/profile/view.templ delete mode 100644 pkg/nebula/components/profile/view_templ.go diff --git a/app/proxy/proxycmd.go b/app/proxy/proxycmd.go deleted file mode 100644 index f50d39b75..000000000 --- a/app/proxy/proxycmd.go +++ /dev/null @@ -1,56 +0,0 @@ -package proxy - -import ( - "context" - "net/http" - "os" - "os/signal" - "time" - - "github.com/labstack/echo/v4" - "github.com/labstack/gommon/log" - "github.com/spf13/cobra" - - "github.com/onsonr/sonr/pkg/nebula" - "github.com/onsonr/sonr/pkg/nebula/router" -) - -func NewProxyCmd() *cobra.Command { - return &cobra.Command{ - Use: "dwn-proxy", - Short: "Starts the DWN proxy server for the local IPFS node", - Run: func(cmd *cobra.Command, args []string) { - // Echo instance - e := echo.New() - e.Logger.SetLevel(log.INFO) - - // Configure the server - if err := nebula.UseAssets(e); err != nil { - e.Logger.Fatal(err) - } - - e.GET("/", router.Home) - e.GET("/allocate", router.Profile) - - // Start server - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) - defer stop() - // Start server - go func() { - if err := e.Start(":1323"); err != nil && err != http.ErrServerClosed { - e.Logger.Fatal("shutting down the server") - } - }() - - // Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds. - <-ctx.Done() - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - // Shutdown the server with 10 seconds timeout. - if err := e.Shutdown(ctx); err != nil { - e.Logger.Fatal(err) - } - }, - } -} diff --git a/cmd/hway/server/server.go b/cmd/hway/server/server.go index 9feba1d47..bb8dc3bdb 100644 --- a/cmd/hway/server/server.go +++ b/cmd/hway/server/server.go @@ -28,8 +28,8 @@ func New() *Server { s.GET("/", router.Home) s.GET("/login", router.Login) s.GET("/register", router.Register) - s.GET("/profile", router.Profile) - s.GET("/authorize", router.Authorize) + // s.GET("/profile", router.Profile) + // s.GET("/authorize", router.Authorize) return s } diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 79fc87b98..d3f50eab5 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -9,14 +9,12 @@ import ( "github.com/onsonr/sonr/app" "github.com/onsonr/sonr/app/cli" - "github.com/onsonr/sonr/app/proxy" ) func main() { rootCmd := NewRootCmd() rootCmd.AddCommand(cli.NewBuildTxnTUICmd()) rootCmd.AddCommand(cli.NewExplorerTUICmd()) - rootCmd.AddCommand(proxy.NewProxyCmd()) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) diff --git a/pkg/nebula/components/grant/view.templ b/pkg/nebula/components/grant/view.templ deleted file mode 100644 index 56c844581..000000000 --- a/pkg/nebula/components/grant/view.templ +++ /dev/null @@ -1,17 +0,0 @@ -package grant - -import ( - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -templ View(c echo.Context) { - @styles.Layout("Sonr.ID", true) { - @ui.Card("authorize-view", styles.SizeMedium) { - @styles.H1("Sonr.ID") - @styles.Text("Neo-tree is a file manager for NeoFS.") - } - } -} diff --git a/pkg/nebula/components/grant/view_templ.go b/pkg/nebula/components/grant/view_templ.go deleted file mode 100644 index 13bb0d7ee..000000000 --- a/pkg/nebula/components/grant/view_templ.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package grant - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -func View(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = styles.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = styles.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = ui.Card("authorize-view", styles.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/bento.templ b/pkg/nebula/components/home/sections/bento.templ similarity index 99% rename from pkg/nebula/components/home/bento.templ rename to pkg/nebula/components/home/sections/bento.templ index d28941aad..51ce476df 100644 --- a/pkg/nebula/components/home/bento.templ +++ b/pkg/nebula/components/home/sections/bento.templ @@ -1,4 +1,4 @@ -package home +package sections templ Bento() { diff --git a/pkg/nebula/components/home/bento_templ.go b/pkg/nebula/components/home/sections/bento_templ.go similarity index 99% rename from pkg/nebula/components/home/bento_templ.go rename to pkg/nebula/components/home/sections/bento_templ.go index 2c25e5b85..2c33d796e 100644 --- a/pkg/nebula/components/home/bento_templ.go +++ b/pkg/nebula/components/home/sections/bento_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/cta.templ b/pkg/nebula/components/home/sections/cta.templ similarity index 99% rename from pkg/nebula/components/home/cta.templ rename to pkg/nebula/components/home/sections/cta.templ index e94973686..c3dc9fa0e 100644 --- a/pkg/nebula/components/home/cta.templ +++ b/pkg/nebula/components/home/sections/cta.templ @@ -1,4 +1,5 @@ -package home +package sections + templ CallToAction() {
diff --git a/pkg/nebula/components/home/cta_templ.go b/pkg/nebula/components/home/sections/cta_templ.go similarity index 99% rename from pkg/nebula/components/home/cta_templ.go rename to pkg/nebula/components/home/sections/cta_templ.go index 44d5e0a6f..31de9ca2f 100644 --- a/pkg/nebula/components/home/cta_templ.go +++ b/pkg/nebula/components/home/sections/cta_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/features.templ b/pkg/nebula/components/home/sections/features.templ similarity index 99% rename from pkg/nebula/components/home/features.templ rename to pkg/nebula/components/home/sections/features.templ index a7c1d09e9..0a4828fcb 100644 --- a/pkg/nebula/components/home/features.templ +++ b/pkg/nebula/components/home/sections/features.templ @@ -1,4 +1,5 @@ -package home +package sections + templ Features() { diff --git a/pkg/nebula/components/home/features_templ.go b/pkg/nebula/components/home/sections/features_templ.go similarity index 99% rename from pkg/nebula/components/home/features_templ.go rename to pkg/nebula/components/home/sections/features_templ.go index b7edd8a4e..679e0ac08 100644 --- a/pkg/nebula/components/home/features_templ.go +++ b/pkg/nebula/components/home/sections/features_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/footer.templ b/pkg/nebula/components/home/sections/footer.templ similarity index 99% rename from pkg/nebula/components/home/footer.templ rename to pkg/nebula/components/home/sections/footer.templ index 3c7aae22c..9afbb64c7 100644 --- a/pkg/nebula/components/home/footer.templ +++ b/pkg/nebula/components/home/sections/footer.templ @@ -1,4 +1,4 @@ -package home +package sections templ Footer() { diff --git a/pkg/nebula/components/home/footer_templ.go b/pkg/nebula/components/home/sections/footer_templ.go similarity index 99% rename from pkg/nebula/components/home/footer_templ.go rename to pkg/nebula/components/home/sections/footer_templ.go index e0ec437ee..7dc321650 100644 --- a/pkg/nebula/components/home/footer_templ.go +++ b/pkg/nebula/components/home/sections/footer_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/header.templ b/pkg/nebula/components/home/sections/header.templ similarity index 98% rename from pkg/nebula/components/home/header.templ rename to pkg/nebula/components/home/sections/header.templ index 5e6e101cc..e5ff3b986 100644 --- a/pkg/nebula/components/home/header.templ +++ b/pkg/nebula/components/home/sections/header.templ @@ -1,4 +1,4 @@ -package home +package sections templ Header() { diff --git a/pkg/nebula/components/home/header_templ.go b/pkg/nebula/components/home/sections/header_templ.go similarity index 99% rename from pkg/nebula/components/home/header_templ.go rename to pkg/nebula/components/home/sections/header_templ.go index 029da6a57..b40a38a4e 100644 --- a/pkg/nebula/components/home/header_templ.go +++ b/pkg/nebula/components/home/sections/header_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/hero.templ b/pkg/nebula/components/home/sections/hero.templ similarity index 99% rename from pkg/nebula/components/home/hero.templ rename to pkg/nebula/components/home/sections/hero.templ index af7fa387f..c97da18f7 100644 --- a/pkg/nebula/components/home/hero.templ +++ b/pkg/nebula/components/home/sections/hero.templ @@ -1,4 +1,4 @@ -package home +package sections import ( "github.com/onsonr/sonr/pkg/nebula/global/ui" diff --git a/pkg/nebula/components/home/hero_templ.go b/pkg/nebula/components/home/sections/hero_templ.go similarity index 97% rename from pkg/nebula/components/home/hero_templ.go rename to pkg/nebula/components/home/sections/hero_templ.go index c49cc83fd..e8b3c0ca6 100644 --- a/pkg/nebula/components/home/hero_templ.go +++ b/pkg/nebula/components/home/sections/hero_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -41,7 +41,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleFirst) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 17, Col: 24} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 17, Col: 24} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -54,7 +54,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleEmphasis) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 19, Col: 28} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 19, Col: 28} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -67,7 +67,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleSecond) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 24, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 24, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -80,7 +80,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Subtitle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 27, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 27, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -146,7 +146,7 @@ func heroImage(hero *models.Hero) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Src) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 47, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 47, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -159,7 +159,7 @@ func heroImage(hero *models.Hero) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Width) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 48, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 48, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -172,7 +172,7 @@ func heroImage(hero *models.Hero) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Height) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 49, Col: 29} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 49, Col: 29} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/components/home/highlights.templ b/pkg/nebula/components/home/sections/highlights.templ similarity index 99% rename from pkg/nebula/components/home/highlights.templ rename to pkg/nebula/components/home/sections/highlights.templ index a8d2884cf..21d9c9929 100644 --- a/pkg/nebula/components/home/highlights.templ +++ b/pkg/nebula/components/home/sections/highlights.templ @@ -1,4 +1,4 @@ -package home +package sections templ Highlights() { diff --git a/pkg/nebula/components/home/highlights_templ.go b/pkg/nebula/components/home/sections/highlights_templ.go similarity index 99% rename from pkg/nebula/components/home/highlights_templ.go rename to pkg/nebula/components/home/sections/highlights_templ.go index c00f80c0d..38feb933f 100644 --- a/pkg/nebula/components/home/highlights_templ.go +++ b/pkg/nebula/components/home/sections/highlights_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/lowlights.templ b/pkg/nebula/components/home/sections/lowlights.templ similarity index 99% rename from pkg/nebula/components/home/lowlights.templ rename to pkg/nebula/components/home/sections/lowlights.templ index aecf235fb..1f2d696bf 100644 --- a/pkg/nebula/components/home/lowlights.templ +++ b/pkg/nebula/components/home/sections/lowlights.templ @@ -1,4 +1,4 @@ -package home +package sections templ Lowlights() {
diff --git a/pkg/nebula/components/home/lowlights_templ.go b/pkg/nebula/components/home/sections/lowlights_templ.go similarity index 99% rename from pkg/nebula/components/home/lowlights_templ.go rename to pkg/nebula/components/home/sections/lowlights_templ.go index 470b376ee..23d64a838 100644 --- a/pkg/nebula/components/home/lowlights_templ.go +++ b/pkg/nebula/components/home/sections/lowlights_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/view.templ b/pkg/nebula/components/home/view.templ index dddf771aa..2ea151907 100644 --- a/pkg/nebula/components/home/view.templ +++ b/pkg/nebula/components/home/view.templ @@ -2,18 +2,19 @@ package home import ( "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/components/home/sections" "github.com/onsonr/sonr/pkg/nebula/models" ) templ View(home *models.Home) { @styles.LayoutNoBody("Sonr.ID", true) { - @Header() - @SectionHero(home.Hero) - @Highlights() - @Features() - @Bento() - @Lowlights() - @CallToAction() - @Footer() + @sections.Header() + @sections.SectionHero(home.Hero) + @sections.Highlights() + @sections.Features() + @sections.Bento() + @sections.Lowlights() + @sections.CallToAction() + @sections.Footer() } } diff --git a/pkg/nebula/components/home/view_templ.go b/pkg/nebula/components/home/view_templ.go index e0f84500b..0fe0a9cfd 100644 --- a/pkg/nebula/components/home/view_templ.go +++ b/pkg/nebula/components/home/view_templ.go @@ -9,6 +9,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( + "github.com/onsonr/sonr/pkg/nebula/components/home/sections" "github.com/onsonr/sonr/pkg/nebula/global/styles" "github.com/onsonr/sonr/pkg/nebula/models" ) @@ -46,7 +47,7 @@ func View(home *models.Home) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = Header().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Header().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -54,7 +55,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -62,7 +63,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Highlights().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Highlights().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -70,7 +71,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Features().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Features().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -78,7 +79,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Bento().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Bento().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -86,7 +87,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Lowlights().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Lowlights().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -94,7 +95,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = CallToAction().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.CallToAction().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -102,7 +103,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Footer().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Footer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/profile/view.templ b/pkg/nebula/components/profile/view.templ deleted file mode 100644 index 103fde545..000000000 --- a/pkg/nebula/components/profile/view.templ +++ /dev/null @@ -1,15 +0,0 @@ -package profile - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -templ View(c echo.Context) { - @styles.Layout("Sonr.ID", true) { - @ui.Card("profile-view", styles.SizeLarge) { - @ui.ProfileCard() - } - } -} diff --git a/pkg/nebula/components/profile/view_templ.go b/pkg/nebula/components/profile/view_templ.go deleted file mode 100644 index e7a54b9bb..000000000 --- a/pkg/nebula/components/profile/view_templ.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package profile - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -func View(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = ui.ProfileCard().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = ui.Card("profile-view", styles.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/global/styles/layout.templ b/pkg/nebula/global/styles/layout.templ index 016443807..7d0addb56 100644 --- a/pkg/nebula/global/styles/layout.templ +++ b/pkg/nebula/global/styles/layout.templ @@ -49,3 +49,51 @@ templ LayoutNoBody(title string, remote bool) { } + + +templ Modal(title, description string) { +
+ +
+} diff --git a/pkg/nebula/global/styles/layout_templ.go b/pkg/nebula/global/styles/layout_templ.go index 2e67402b4..154a8cabe 100644 --- a/pkg/nebula/global/styles/layout_templ.go +++ b/pkg/nebula/global/styles/layout_templ.go @@ -140,4 +140,67 @@ func LayoutNoBody(title string, remote bool) templ.Component { }) } +func Modal(title, description string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/router/router.go b/pkg/nebula/router/router.go index cba66b45c..04242ff0d 100644 --- a/pkg/nebula/router/router.go +++ b/pkg/nebula/router/router.go @@ -6,10 +6,8 @@ import ( "github.com/a-h/templ" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/grant" "github.com/onsonr/sonr/pkg/nebula/components/home" "github.com/onsonr/sonr/pkg/nebula/components/login" - "github.com/onsonr/sonr/pkg/nebula/components/profile" "github.com/onsonr/sonr/pkg/nebula/components/register" "github.com/onsonr/sonr/pkg/nebula/models" ) @@ -26,16 +24,9 @@ func Home(c echo.Context) error { return render(c, home.View(mdls.Home)) } -func Profile(c echo.Context) error { - return render(c, profile.View(c)) -} - // ╭───────────────────────────────────────────────────────────╮ // │ Authentication Views │ // ╰───────────────────────────────────────────────────────────╯ -func Authorize(c echo.Context) error { - return render(c, grant.View(c)) -} func Login(c echo.Context) error { return render(c, login.Modal(c)) From 6fc52fd62d423347a4a5fff895d2339354fac433 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:48:57 -0400 Subject: [PATCH 12/57] feat: implement templ forms for consent privacy, credential assert, credential register, and profile details --- Makefile | 12 +++--- devbox.json | 22 +++++----- .../auth/forms/consent_privacy.templ | 11 +++++ .../auth/forms/consent_privacy_templ.go | 40 +++++++++++++++++++ .../auth/forms/credential_assert.templ | 11 +++++ .../auth/forms/credential_assert_templ.go | 40 +++++++++++++++++++ .../auth/forms/credential_register.templ | 11 +++++ .../auth/forms/credential_register_templ.go | 40 +++++++++++++++++++ .../auth/forms/details_profile.templ | 11 +++++ .../auth/forms/details_profile_templ.go | 40 +++++++++++++++++++ 10 files changed, 221 insertions(+), 17 deletions(-) create mode 100644 pkg/nebula/components/auth/forms/consent_privacy.templ create mode 100644 pkg/nebula/components/auth/forms/consent_privacy_templ.go create mode 100644 pkg/nebula/components/auth/forms/credential_assert.templ create mode 100644 pkg/nebula/components/auth/forms/credential_assert_templ.go create mode 100644 pkg/nebula/components/auth/forms/credential_register.templ create mode 100644 pkg/nebula/components/auth/forms/credential_register_templ.go create mode 100644 pkg/nebula/components/auth/forms/details_profile.templ create mode 100644 pkg/nebula/components/auth/forms/details_profile_templ.go diff --git a/Makefile b/Makefile index f795d0b29..52586a6a6 100644 --- a/Makefile +++ b/Makefile @@ -295,26 +295,26 @@ sh-testnet: mod-tidy ### templ & vault ### ############################################################################### -.PHONY: motr hway templ pkl nebula +.PHONY: build-motr build-hway gen-templ gen-pkl build-nebula -hway: +build-hway: @echo "(motr) Building Highway gateway" go build -o ./build/hway ./cmd/hway -motr: +build-motr: @echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault" GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/motr.go -templ: +gen-templ: @echo "(templ) Generating templ files" templ generate -nebula: +build-nebula: @echo "(nebula) Building nebula" cd pkg/nebula && bun run build templ generate -pkl: +gen-pkl: @echo "(pkl) Building PKL" go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/DWN.pkl go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/ORM.pkl diff --git a/devbox.json b/devbox.json index 6b228130e..0d1a5af38 100644 --- a/devbox.json +++ b/devbox.json @@ -35,32 +35,32 @@ "make local-image" ], "build:hway": [ - "make nebula", - "make hway" + "make build-nebula", + "make build-hway" ], "build:nebula": [ - "make nebula" + "make build-nebula" ], "build:motr": [ - "make motr" + "make build-motr" ], "build:sonrd": [ - "make motr", + "make build-motr", "make build" ], "build": [ - "make motr", + "make build-motr", "make build", - "make hway" + "make build-hway" ], "gen:proto": [ "make proto-gen" ], "gen:pkl": [ - "make pkl" + "make gen-pkl" ], "gen:templ": [ - "make templ" + "make gen-templ" ], "start": [ "process-compose up -f ./deploy/process-compose.yaml" @@ -72,8 +72,8 @@ "make sh-testnet" ], "start:hway": [ - "make nebula", - "make hway", + "make build-nebula", + "make build-hway", "./build/hway start" ] } diff --git a/pkg/nebula/components/auth/forms/consent_privacy.templ b/pkg/nebula/components/auth/forms/consent_privacy.templ new file mode 100644 index 000000000..999bac796 --- /dev/null +++ b/pkg/nebula/components/auth/forms/consent_privacy.templ @@ -0,0 +1,11 @@ +package forms + +templ privacyConsentForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/consent_privacy_templ.go b/pkg/nebula/components/auth/forms/consent_privacy_templ.go new file mode 100644 index 000000000..9f1543d59 --- /dev/null +++ b/pkg/nebula/components/auth/forms/consent_privacy_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func privacyConsentForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/auth/forms/credential_assert.templ b/pkg/nebula/components/auth/forms/credential_assert.templ new file mode 100644 index 000000000..142ecaca8 --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_assert.templ @@ -0,0 +1,11 @@ +package forms + +templ AssertCredentialForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/credential_assert_templ.go b/pkg/nebula/components/auth/forms/credential_assert_templ.go new file mode 100644 index 000000000..9c3712c7f --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_assert_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func AssertCredentialForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/auth/forms/credential_register.templ b/pkg/nebula/components/auth/forms/credential_register.templ new file mode 100644 index 000000000..4e91ee1a6 --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_register.templ @@ -0,0 +1,11 @@ +package forms + +templ RegisterCredentialForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/credential_register_templ.go b/pkg/nebula/components/auth/forms/credential_register_templ.go new file mode 100644 index 000000000..0ef8c8922 --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_register_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func RegisterCredentialForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/auth/forms/details_profile.templ b/pkg/nebula/components/auth/forms/details_profile.templ new file mode 100644 index 000000000..5e51c7f93 --- /dev/null +++ b/pkg/nebula/components/auth/forms/details_profile.templ @@ -0,0 +1,11 @@ +package forms + +templ ProfileDetailsForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/details_profile_templ.go b/pkg/nebula/components/auth/forms/details_profile_templ.go new file mode 100644 index 000000000..2e4cc89e2 --- /dev/null +++ b/pkg/nebula/components/auth/forms/details_profile_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func ProfileDetailsForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate From dba9a119ef9ca03fc6a083a684f2bf5da9e5b50c Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:49:25 -0400 Subject: [PATCH 13/57] feat: add json tags to config structs --- pkg/dwn/Config.pkl.go | 10 +++++----- pkg/dwn/IPFS.pkl.go | 4 ++-- pkg/dwn/Motr.pkl.go | 6 +++--- pkg/dwn/Schema.pkl.go | 16 ++++++++-------- pkg/dwn/Sonr.pkl.go | 10 +++++----- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pkg/dwn/Config.pkl.go b/pkg/dwn/Config.pkl.go index 963d9f6a2..f0c8ef0cf 100644 --- a/pkg/dwn/Config.pkl.go +++ b/pkg/dwn/Config.pkl.go @@ -2,13 +2,13 @@ package dwn type Config struct { - Ipfs *IPFS `pkl:"ipfs"` + Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"` - Sonr *Sonr `pkl:"sonr"` + Sonr *Sonr `pkl:"sonr" json:"sonr,omitempty"` - Motr *Motr `pkl:"motr"` + Motr *Motr `pkl:"motr" json:"motr,omitempty"` - Schema *Schema `pkl:"schema"` + Schema *Schema `pkl:"schema" json:"schema,omitempty"` - ProxyUrl string `pkl:"proxyUrl"` + ProxyUrl string `pkl:"proxyUrl" json:"proxyUrl,omitempty"` } diff --git a/pkg/dwn/IPFS.pkl.go b/pkg/dwn/IPFS.pkl.go index 7f2add580..78084810b 100644 --- a/pkg/dwn/IPFS.pkl.go +++ b/pkg/dwn/IPFS.pkl.go @@ -2,7 +2,7 @@ package dwn type IPFS struct { - ApiUrl string `pkl:"apiUrl"` + ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"` - GatewayUrl string `pkl:"gatewayUrl"` + GatewayUrl string `pkl:"gatewayUrl" json:"gatewayUrl,omitempty"` } diff --git a/pkg/dwn/Motr.pkl.go b/pkg/dwn/Motr.pkl.go index 288159103..bc144efd0 100644 --- a/pkg/dwn/Motr.pkl.go +++ b/pkg/dwn/Motr.pkl.go @@ -2,9 +2,9 @@ package dwn type Motr struct { - Keyshare string `pkl:"keyshare"` + Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"` - Address string `pkl:"address"` + Address string `pkl:"address" json:"address,omitempty"` - Origin string `pkl:"origin"` + Origin string `pkl:"origin" json:"origin,omitempty"` } diff --git a/pkg/dwn/Schema.pkl.go b/pkg/dwn/Schema.pkl.go index 80569916f..e8d4692ac 100644 --- a/pkg/dwn/Schema.pkl.go +++ b/pkg/dwn/Schema.pkl.go @@ -4,19 +4,19 @@ package dwn type Schema struct { Version int `pkl:"version"` - Account string `pkl:"account"` + Account string `pkl:"account" json:"account,omitempty"` - Asset string `pkl:"asset"` + Asset string `pkl:"asset" json:"asset,omitempty"` - Chain string `pkl:"chain"` + Chain string `pkl:"chain" json:"chain,omitempty"` - Credential string `pkl:"credential"` + Credential string `pkl:"credential" json:"credential,omitempty"` - Jwk string `pkl:"jwk"` + Jwk string `pkl:"jwk" json:"jwk,omitempty"` - Grant string `pkl:"grant"` + Grant string `pkl:"grant" json:"grant,omitempty"` - Keyshare string `pkl:"keyshare"` + Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"` - Profile string `pkl:"profile"` + Profile string `pkl:"profile" json:"profile,omitempty"` } diff --git a/pkg/dwn/Sonr.pkl.go b/pkg/dwn/Sonr.pkl.go index 9fec1dc2c..8693af808 100644 --- a/pkg/dwn/Sonr.pkl.go +++ b/pkg/dwn/Sonr.pkl.go @@ -2,13 +2,13 @@ package dwn type Sonr struct { - ApiUrl string `pkl:"apiUrl"` + ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"` - GrpcUrl string `pkl:"grpcUrl"` + GrpcUrl string `pkl:"grpcUrl" json:"grpcUrl,omitempty"` - RpcUrl string `pkl:"rpcUrl"` + RpcUrl string `pkl:"rpcUrl" json:"rpcUrl,omitempty"` - WebSocketUrl string `pkl:"webSocketUrl"` + WebSocketUrl string `pkl:"webSocketUrl" json:"webSocketUrl,omitempty"` - ChainId string `pkl:"chainId"` + ChainId string `pkl:"chainId" json:"chainId,omitempty"` } From 2d5cb7e5b831e67bc8b0044f285a3db2c1366d65 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 12:59:08 -0400 Subject: [PATCH 14/57] feat: implement authentication views --- .../components/{register => auth}/modal.templ | 5 +- .../{register => auth}/modal_templ.go | 5 +- .../home/{view.templ => page.templ} | 0 .../home/{view_templ.go => page_templ.go} | 0 pkg/nebula/components/login/modal.templ | 73 ---------- pkg/nebula/components/login/modal_templ.go | 42 ------ pkg/nebula/components/login/view.templ | 21 --- pkg/nebula/components/login/view_templ.go | 132 ------------------ pkg/nebula/components/register/view.templ | 11 -- pkg/nebula/components/register/view_templ.go | 40 ------ pkg/nebula/global/events.go | 13 ++ pkg/nebula/router/state.go | 13 -- .../{router/router.go => routes/routes.go} | 33 ++++- 13 files changed, 45 insertions(+), 343 deletions(-) rename pkg/nebula/components/{register => auth}/modal.templ (96%) rename pkg/nebula/components/{register => auth}/modal_templ.go (96%) rename pkg/nebula/components/home/{view.templ => page.templ} (100%) rename pkg/nebula/components/home/{view_templ.go => page_templ.go} (100%) delete mode 100644 pkg/nebula/components/login/modal.templ delete mode 100644 pkg/nebula/components/login/modal_templ.go delete mode 100644 pkg/nebula/components/login/view.templ delete mode 100644 pkg/nebula/components/login/view_templ.go delete mode 100644 pkg/nebula/components/register/view.templ delete mode 100644 pkg/nebula/components/register/view_templ.go create mode 100644 pkg/nebula/global/events.go delete mode 100644 pkg/nebula/router/state.go rename pkg/nebula/{router/router.go => routes/routes.go} (77%) diff --git a/pkg/nebula/components/register/modal.templ b/pkg/nebula/components/auth/modal.templ similarity index 96% rename from pkg/nebula/components/register/modal.templ rename to pkg/nebula/components/auth/modal.templ index 557fd3aa5..2f69f3fa1 100644 --- a/pkg/nebula/components/register/modal.templ +++ b/pkg/nebula/components/auth/modal.templ @@ -1,9 +1,10 @@ -package register +package auth import ( "github.com/labstack/echo/v4" "github.com/onsonr/sonr/pkg/nebula/global/styles" "github.com/onsonr/sonr/pkg/nebula/global/ui" + "github.com/onsonr/sonr/pkg/nebula/components/auth/forms" ) templ Modal(c echo.Context) { @@ -47,7 +48,7 @@ templ Modal(c echo.Context) {

Enter your account information below to create your account.

@ui.Breadcrumbs() - @basicInfoForm() + @forms.ProfileDetailsForm() @styles.Spacer()
diff --git a/pkg/nebula/components/register/modal_templ.go b/pkg/nebula/components/auth/modal_templ.go similarity index 96% rename from pkg/nebula/components/register/modal_templ.go rename to pkg/nebula/components/auth/modal_templ.go index 9cd7c8aed..efd88f67a 100644 --- a/pkg/nebula/components/register/modal_templ.go +++ b/pkg/nebula/components/auth/modal_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package register +package auth //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -10,6 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/pkg/nebula/components/auth/forms" "github.com/onsonr/sonr/pkg/nebula/global/styles" "github.com/onsonr/sonr/pkg/nebula/global/ui" ) @@ -43,7 +44,7 @@ func Modal(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = basicInfoForm().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = forms.ProfileDetailsForm().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/view.templ b/pkg/nebula/components/home/page.templ similarity index 100% rename from pkg/nebula/components/home/view.templ rename to pkg/nebula/components/home/page.templ diff --git a/pkg/nebula/components/home/view_templ.go b/pkg/nebula/components/home/page_templ.go similarity index 100% rename from pkg/nebula/components/home/view_templ.go rename to pkg/nebula/components/home/page_templ.go diff --git a/pkg/nebula/components/login/modal.templ b/pkg/nebula/components/login/modal.templ deleted file mode 100644 index 95ddc5606..000000000 --- a/pkg/nebula/components/login/modal.templ +++ /dev/null @@ -1,73 +0,0 @@ -package login - -import "github.com/labstack/echo/v4" - -templ Modal(c echo.Context) { -
- -
-} diff --git a/pkg/nebula/components/login/modal_templ.go b/pkg/nebula/components/login/modal_templ.go deleted file mode 100644 index f3797dd6d..000000000 --- a/pkg/nebula/components/login/modal_templ.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package login - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "github.com/labstack/echo/v4" - -func Modal(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/login/view.templ b/pkg/nebula/components/login/view.templ deleted file mode 100644 index 67642100e..000000000 --- a/pkg/nebula/components/login/view.templ +++ /dev/null @@ -1,21 +0,0 @@ -package login - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -templ View(c echo.Context) { - @styles.Layout("Sonr.ID", true) { - @ui.Card("login-view", styles.SizeLarge) { - @styles.H1("Sonr.ID") - @styles.Text("Neo-tree is a file manager for NeoFS.") - @styles.Spacer() - @styles.Spacer() - @ui.Button(ui.GET("/", "#login-view")) { - @styles.Text("Cancel") - } - } - } -} diff --git a/pkg/nebula/components/login/view_templ.go b/pkg/nebula/components/login/view_templ.go deleted file mode 100644 index e55aafdf0..000000000 --- a/pkg/nebula/components/login/view_templ.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package login - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -func View(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = styles.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = styles.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = styles.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = ui.Button(ui.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = ui.Card("login-view", styles.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/register/view.templ b/pkg/nebula/components/register/view.templ deleted file mode 100644 index 64bdcbe22..000000000 --- a/pkg/nebula/components/register/view.templ +++ /dev/null @@ -1,11 +0,0 @@ -package register - -templ basicInfoForm() { -
-
-
-
-
-
-
-} diff --git a/pkg/nebula/components/register/view_templ.go b/pkg/nebula/components/register/view_templ.go deleted file mode 100644 index e29262c8e..000000000 --- a/pkg/nebula/components/register/view_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package register - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func basicInfoForm() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/global/events.go b/pkg/nebula/global/events.go new file mode 100644 index 000000000..e6cf05459 --- /dev/null +++ b/pkg/nebula/global/events.go @@ -0,0 +1,13 @@ +package global + +type Event string + +const ( + // Auth + AuthLoginSuccess Event = "login_success" + AuthLogoutSuccess Event = "logout_success" + AuthRegisterSuccess Event = "register_success" + AuthRegisterFailure Event = "register_failure" + + WalletTransactionConfirmed Event = "transaction_confirmed" +) diff --git a/pkg/nebula/router/state.go b/pkg/nebula/router/state.go deleted file mode 100644 index 10b1ce322..000000000 --- a/pkg/nebula/router/state.go +++ /dev/null @@ -1,13 +0,0 @@ -package router - -type Status string - -const ( - StatusOK Status = "ok" - StatusError Status = "error" - StatusNotFound Status = "not-found" - StatusUnauthorized Status = "unauthorized" - StatusForbidden Status = "forbidden" - StatusInternalServerError Status = "internal-server-error" - StatusBadRequest Status = "bad-request" -) diff --git a/pkg/nebula/router/router.go b/pkg/nebula/routes/routes.go similarity index 77% rename from pkg/nebula/router/router.go rename to pkg/nebula/routes/routes.go index 04242ff0d..3bd754f7e 100644 --- a/pkg/nebula/router/router.go +++ b/pkg/nebula/routes/routes.go @@ -1,4 +1,4 @@ -package router +package routes import ( "bytes" @@ -6,9 +6,8 @@ import ( "github.com/a-h/templ" "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/pkg/nebula/components/auth" "github.com/onsonr/sonr/pkg/nebula/components/home" - "github.com/onsonr/sonr/pkg/nebula/components/login" - "github.com/onsonr/sonr/pkg/nebula/components/register" "github.com/onsonr/sonr/pkg/nebula/models" ) @@ -28,12 +27,32 @@ func Home(c echo.Context) error { // │ Authentication Views │ // ╰───────────────────────────────────────────────────────────╯ -func Login(c echo.Context) error { - return render(c, login.Modal(c)) +func AuthorizeStart(c echo.Context) error { + return render(c, auth.Modal(c)) } -func Register(c echo.Context) error { - return render(c, register.Modal(c)) +func AuthorizeFinish(c echo.Context) error { + return render(c, auth.Modal(c)) +} + +func LoginDevice(c echo.Context) error { + return render(c, auth.Modal(c)) +} + +func LoginStart(c echo.Context) error { + return render(c, auth.Modal(c)) +} + +func LoginFinish(c echo.Context) error { + return render(c, auth.Modal(c)) +} + +func RegisterStart(c echo.Context) error { + return render(c, auth.Modal(c)) +} + +func RegisterFinish(c echo.Context) error { + return render(c, auth.Modal(c)) } // ╭───────────────────────────────────────────────────────────╮ From b633d21ea8dfe5d59a94a35a5407bba3416c76ae Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 13:48:28 -0400 Subject: [PATCH 15/57] feat: add LoginStart and RegisterStart routes --- cmd/hway/server/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/hway/server/server.go b/cmd/hway/server/server.go index bb8dc3bdb..4e4cabc52 100644 --- a/cmd/hway/server/server.go +++ b/cmd/hway/server/server.go @@ -8,7 +8,7 @@ import ( "github.com/onsonr/sonr/internal/session" "github.com/onsonr/sonr/pkg/nebula" - "github.com/onsonr/sonr/pkg/nebula/router" + "github.com/onsonr/sonr/pkg/nebula/routes" ) type Server struct { @@ -25,9 +25,9 @@ func New() *Server { s.Logger.Fatal(err) } - s.GET("/", router.Home) - s.GET("/login", router.Login) - s.GET("/register", router.Register) + s.GET("/", routes.Home) + s.GET("/login", routes.LoginStart) + s.GET("/register", routes.RegisterStart) // s.GET("/profile", router.Profile) // s.GET("/authorize", router.Authorize) return s From f7f0c115877930441939716a4e4d17e5d20e8ae6 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 13:59:29 -0400 Subject: [PATCH 16/57] feat: add ModalForm component --- pkg/nebula/assets/css/styles.css | 185 ---------------------- pkg/nebula/components/auth/modal.templ | 60 ++----- pkg/nebula/components/auth/modal_templ.go | 54 +++++-- pkg/nebula/components/dash/page.templ | 20 +++ pkg/nebula/components/dash/page_templ.go | 120 ++++++++++++++ pkg/nebula/global/styles/layout.templ | 4 +- pkg/nebula/global/styles/layout_templ.go | 4 +- pkg/nebula/nebula.pkl | 24 +++ pkl/UIUX.pkl | 54 ++----- 9 files changed, 226 insertions(+), 299 deletions(-) create mode 100644 pkg/nebula/components/dash/page.templ create mode 100644 pkg/nebula/components/dash/page_templ.go diff --git a/pkg/nebula/assets/css/styles.css b/pkg/nebula/assets/css/styles.css index 8db54c9f3..d196e89da 100644 --- a/pkg/nebula/assets/css/styles.css +++ b/pkg/nebula/assets/css/styles.css @@ -1135,10 +1135,6 @@ select{ margin-top: 6rem; } -.mt-3{ - margin-top: 0.75rem; -} - .mt-4{ margin-top: 1rem; } @@ -1175,10 +1171,6 @@ select{ display: none; } -.h-0\.5{ - height: 0.125rem; -} - .h-10{ height: 2.5rem; } @@ -1239,14 +1231,6 @@ select{ min-height: 100vh; } -.w-0{ - width: 0px; -} - -.w-1\/3{ - width: 33.333333%; -} - .w-14{ width: 3.5rem; } @@ -1360,10 +1344,6 @@ select{ max-width: 20rem; } -.flex-shrink-0{ - flex-shrink: 0; -} - .shrink-0{ flex-shrink: 0; } @@ -1397,11 +1377,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.-translate-x-px{ - --tw-translate-x: -1px; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .-translate-y-0\.5{ --tw-translate-y: -0.125rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1412,11 +1387,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.-translate-y-px{ - --tw-translate-y: -1px; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .translate-x-0{ --tw-translate-x: 0px; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1452,11 +1422,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.translate-y-full{ - --tw-translate-y: 100%; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .rotate-1{ --tw-rotate: 1deg; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1682,10 +1647,6 @@ select{ border-width: 2px; } -.border-\[2px\]{ - border-width: 2px; -} - .border-t{ border-top-width: 1px; } @@ -1700,11 +1661,6 @@ select{ border-color: rgb(22 163 74 / var(--tw-border-opacity)); } -.border-neutral-200{ - --tw-border-opacity: 1; - border-color: rgb(229 229 229 / var(--tw-border-opacity)); -} - .border-neutral-200\/60{ border-color: rgb(229 229 229 / 0.6); } @@ -1853,16 +1809,6 @@ select{ background-image: linear-gradient(to right, var(--tw-gradient-stops)); } -.bg-gradient-to-t{ - background-image: linear-gradient(to top, var(--tw-gradient-stops)); -} - -.from-black{ - --tw-gradient-from: #000 var(--tw-gradient-from-position); - --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position); - --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); -} - .from-zinc-100{ --tw-gradient-from: #f4f4f5 var(--tw-gradient-from-position); --tw-gradient-to: rgb(244 244 245 / 0) var(--tw-gradient-to-position); @@ -1888,10 +1834,6 @@ select{ --tw-gradient-to: #18181b var(--tw-gradient-to-position); } -.bg-cover{ - background-size: cover; -} - .bg-clip-text{ -webkit-background-clip: text; background-clip: text; @@ -1939,16 +1881,6 @@ select{ padding: 1.75rem; } -.px-0\.5{ - padding-left: 0.125rem; - padding-right: 0.125rem; -} - -.px-2{ - padding-left: 0.5rem; - padding-right: 0.5rem; -} - .px-2\.5{ padding-left: 0.625rem; padding-right: 0.625rem; @@ -2029,11 +1961,6 @@ select{ padding-bottom: 2rem; } -.py-px{ - padding-top: 1px; - padding-bottom: 1px; -} - .pb-1{ padding-bottom: 0.25rem; } @@ -2118,10 +2045,6 @@ select{ font-family: Inter Tight, sans-serif; } -.font-sans{ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -} - .text-2xl{ font-size: 1.5rem; line-height: 1.415; @@ -2140,10 +2063,6 @@ select{ letter-spacing: -0.017em; } -.text-\[0\.6rem\]{ - font-size: 0.6rem; -} - .text-base{ font-size: 1rem; line-height: 1.5; @@ -2176,10 +2095,6 @@ select{ font-weight: 700; } -.font-extrabold{ - font-weight: 800; -} - .font-medium{ font-weight: 500; } @@ -2192,10 +2107,6 @@ select{ font-weight: 600; } -.uppercase{ - text-transform: uppercase; -} - .italic{ font-style: italic; } @@ -2270,11 +2181,6 @@ select{ color: rgb(115 115 115 / var(--tw-text-opacity)); } -.text-neutral-600{ - --tw-text-opacity: 1; - color: rgb(82 82 82 / var(--tw-text-opacity)); -} - .text-neutral-800{ --tw-text-opacity: 1; color: rgb(38 38 38 / var(--tw-text-opacity)); @@ -2349,18 +2255,6 @@ select{ color: rgb(24 24 27 / var(--tw-text-opacity)); } -.underline{ - text-decoration-line: underline; -} - -.no-underline{ - text-decoration-line: none; -} - -.underline-offset-4{ - text-underline-offset: 4px; -} - .antialiased{ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -2378,14 +2272,6 @@ select{ opacity: 0.6; } -.opacity-70{ - opacity: 0.7; -} - -.opacity-90{ - opacity: 0.9; -} - .mix-blend-exclusion{ mix-blend-mode: exclusion; } @@ -2456,10 +2342,6 @@ select{ transition-duration: 300ms; } -.duration-500{ - transition-duration: 500ms; -} - .duration-700{ transition-duration: 700ms; } @@ -2889,16 +2771,6 @@ input[type="search"]::-webkit-search-results-decoration { /* Firefox */ } -.placeholder\:text-neutral-500::-moz-placeholder{ - --tw-text-opacity: 1; - color: rgb(115 115 115 / var(--tw-text-opacity)); -} - -.placeholder\:text-neutral-500::placeholder{ - --tw-text-opacity: 1; - color: rgb(115 115 115 / var(--tw-text-opacity)); -} - .placeholder\:text-zinc-400::-moz-placeholder{ --tw-text-opacity: 1; color: rgb(161 161 170 / var(--tw-text-opacity)); @@ -3245,11 +3117,6 @@ input[type="search"]::-webkit-search-results-decoration { opacity: 1; } -.focus\:border-neutral-300:focus{ - --tw-border-opacity: 1; - border-color: rgb(212 212 212 / var(--tw-border-opacity)); -} - .focus\:border-zinc-300:focus{ --tw-border-opacity: 1; border-color: rgb(212 212 216 / var(--tw-border-opacity)); @@ -3260,10 +3127,6 @@ input[type="search"]::-webkit-search-results-decoration { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } -.focus\:no-underline:focus{ - text-decoration-line: none; -} - .focus\:outline-none:focus{ outline: 2px solid transparent; outline-offset: 2px; @@ -3370,25 +3233,6 @@ input[type="search"]::-webkit-search-results-decoration { opacity: 0.5; } -.group:hover .group-hover\:w-full{ - width: 100%; -} - -.group:hover .group-hover\:-rotate-6{ - --tw-rotate: -6deg; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.group:hover .group-hover\:scale-150{ - --tw-scale-x: 1.5; - --tw-scale-y: 1.5; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.group:hover .group-hover\:opacity-100{ - opacity: 1; -} - .group:hover .group-hover\:\[animation-play-state\:paused\]{ animation-play-state: paused; } @@ -3624,26 +3468,14 @@ input[type="search"]::-webkit-search-results-decoration { grid-column: span 6 / span 6; } - .lg\:mb-0{ - margin-bottom: 0px; - } - .lg\:mt-32{ margin-top: 8rem; } - .lg\:block{ - display: block; - } - .lg\:flex{ display: flex; } - .lg\:h-5{ - height: 1.25rem; - } - .lg\:min-w-\[524px\]{ min-width: 524px; } @@ -3680,14 +3512,6 @@ input[type="search"]::-webkit-search-results-decoration { margin-bottom: calc(0px * var(--tw-space-y-reverse)); } - .lg\:border-white\/20{ - border-color: rgb(255 255 255 / 0.2); - } - - .lg\:bg-black\/10{ - background-color: rgb(0 0 0 / 0.1); - } - .lg\:p-24{ padding: 6rem; } @@ -3714,15 +3538,6 @@ input[type="search"]::-webkit-search-results-decoration { line-height: 1.5; letter-spacing: -0.017em; } - - .lg\:text-white{ - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); - } - - .hover\:lg\:bg-black\/30:hover{ - background-color: rgb(0 0 0 / 0.3); - } } @media (min-width: 1280px){ diff --git a/pkg/nebula/components/auth/modal.templ b/pkg/nebula/components/auth/modal.templ index 2f69f3fa1..75faece7a 100644 --- a/pkg/nebula/components/auth/modal.templ +++ b/pkg/nebula/components/auth/modal.templ @@ -8,54 +8,14 @@ import ( ) templ Modal(c echo.Context) { -
- -
+ @styles.OpenModal("Account Registration", "Enter your account information below to create your account.") { + @ui.Breadcrumbs() + @forms.ProfileDetailsForm() + @styles.Spacer() +
+ + +
+ } } + diff --git a/pkg/nebula/components/auth/modal_templ.go b/pkg/nebula/components/auth/modal_templ.go index efd88f67a..23287c428 100644 --- a/pkg/nebula/components/auth/modal_templ.go +++ b/pkg/nebula/components/auth/modal_templ.go @@ -36,23 +36,45 @@ func Modal(c echo.Context) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + }) + templ_7745c5c3_Err = styles.OpenModal("Account Registration", "Enter your account information below to create your account.").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/dash/page.templ b/pkg/nebula/components/dash/page.templ new file mode 100644 index 000000000..610f279ee --- /dev/null +++ b/pkg/nebula/components/dash/page.templ @@ -0,0 +1,20 @@ +package dash + +import ( + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/components/home/sections" + "github.com/onsonr/sonr/pkg/nebula/models" +) + +templ View(home *models.Home) { + @styles.LayoutNoBody("Sonr.ID", true) { + @sections.Header() + @sections.SectionHero(home.Hero) + @sections.Highlights() + @sections.Features() + @sections.Bento() + @sections.Lowlights() + @sections.CallToAction() + @sections.Footer() + } +} diff --git a/pkg/nebula/components/dash/page_templ.go b/pkg/nebula/components/dash/page_templ.go new file mode 100644 index 000000000..99892cd72 --- /dev/null +++ b/pkg/nebula/components/dash/page_templ.go @@ -0,0 +1,120 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package dash + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/onsonr/sonr/pkg/nebula/components/home/sections" + "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/models" +) + +func View(home *models.Home) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = sections.Header().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Highlights().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Features().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Bento().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Lowlights().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.CallToAction().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Footer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = styles.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/global/styles/layout.templ b/pkg/nebula/global/styles/layout.templ index 7d0addb56..f56428d0f 100644 --- a/pkg/nebula/global/styles/layout.templ +++ b/pkg/nebula/global/styles/layout.templ @@ -51,7 +51,7 @@ templ LayoutNoBody(title string, remote bool) { } -templ Modal(title, description string) { +templ OpenModal(title, description string) {