Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

design: refresh Fider UI and add utility classes (#947)

Guilherme Oenningfb46f3f4343b
diff --git a/GUIDELINES.md b/GUIDELINES.md
index 841956b7f..ad250f3a0 100644
--- a/GUIDELINES.md
+++ b/GUIDELINES.md
@@ -29,18 +29,14 @@ public/pages/Home // Home page component folder
**CSS Naming**
-- `p-<page_name>` is the HTML ID of each page component. This is truly unique and should be used to provide page isolated style. E.g.: `p-home`, `p-user-settings`;
-
-- `c-<component_name>` is the main class for each component. Inner components should follow its parent component name as such `c-<component_name>-<inner_component_name>`. E.g: `c-toggle` and `c-toggle-label`;
-
-- `m-<state>` is used to alter the style of a component and it's always related to its component. So `m-disable` of `c-toggle` is different than `m-disable` of `c-button`, even though they have same name.
+Fider uses a combination of BEM and Utility Classes.
-- `l-<name>` is used to general layout styling. It's does not need to be related to any component or page.
+- `p-<page_name>` is the HTML ID of each page component. This is truly unique and should be used to provide page isolated style. E.g.: `p-home`, `p-user-settings`;
-- `is-<state>`, `has-<state>` or simply `<state>` are global style modifiers that have a broader impact.
+- `c-<component_name>` is the "Block" class for each component. Elements should follow its parent component name as such `c-<component_name>__<element>`. E.g: `c-toggle` and `c-toggle__label`;
-- `js-<name>` is used to JavaScript hooks, should be avoided as much as possible;
+- `{block}--<state>` is used to alter the style of its. . E.g: `c-toggle` and `c-toggle--checked`;
-```
+- `is-<state>`, `has-<state>` are global style modifiers that have a broader impact.
-```
+- Utility classes do not have a preffix.
diff --git a/app/cmd/ping.go b/app/cmd/ping.go
index 48dc516aa..f146d8247 100644
--- a/app/cmd/ping.go
+++ b/app/cmd/ping.go
@@ -19,7 +19,7 @@ func RunPing() int {
protocol = "https://"
}
- resp, err := http.Get(protocol + "localhost:3000/-/health")
+ resp, err := http.Get(protocol + "localhost:3000/_health")
if err != nil {
fmt.Printf("Request failed with: %s\n", err)
return 1
diff --git a/app/cmd/routes.go b/app/cmd/routes.go
index 9686c4231..31ea95dd7 100644
--- a/app/cmd/routes.go
+++ b/app/cmd/routes.go
@@ -39,7 +39,7 @@ func routes(r *web.Engine) *web.Engine {
r.Use(middlewares.Session())
- r.Get("/-/health", handlers.Health())
+ r.Get("/_health", handlers.Health())
r.Get("/robots.txt", handlers.RobotsTXT())
r.Post("/_api/log-error", handlers.LogError())
@@ -48,7 +48,6 @@ func routes(r *web.Engine) *web.Engine {
r.Use(middlewares.Tenant())
r.Use(middlewares.User())
- r.Get("/browser-not-supported", handlers.BrowserNotSupported())
r.Get("/privacy", handlers.LegalPage("Privacy Policy", "privacy.md"))
r.Get("/terms", handlers.LegalPage("Terms of Service", "terms.md"))
@@ -77,7 +76,7 @@ func routes(r *web.Engine) *web.Engine {
})
}
- r.Get("/-/ui", handlers.Page("UI Toolkit", "A preview of Fider UI elements", "UIToolkit.page"))
+ r.Get("/_design", handlers.Page("Design System", "A preview of Fider UI elements", "DesignSystem.page"))
r.Get("/signup/verify", handlers.VerifySignUpKey())
r.Get("/signout", handlers.SignOut())
r.Get("/oauth/:provider/token", handlers.OAuthToken())
diff --git a/app/handlers/common.go b/app/handlers/common.go
index 9c175ccc7..831d92e82 100644
--- a/app/handlers/common.go
+++ b/app/handlers/common.go
@@ -42,10 +42,11 @@ func LegalPage(title, file string) web.HandlerFunc {
return c.NotFound()
}
- return c.Render(http.StatusOK, "legal.html", web.Props{
- Title: title,
+ return c.Page(web.Props{
+ Title: title,
+ ChunkName: "Legal.page",
Data: web.Map{
- "Content": string(bytes),
+ "content": string(bytes),
},
})
}
@@ -102,16 +103,6 @@ func Page(title, description, chunkName string) web.HandlerFunc {
}
}
-//BrowserNotSupported returns an error page for browser that Fider dosn't support
-func BrowserNotSupported() web.HandlerFunc {
- return func(c *web.Context) error {
- return c.Render(http.StatusOK, "browser-not-supported.html", web.Props{
- Title: "Browser not supported",
- Description: "We don't support this version of your browser",
- })
- }
-}
-
//NewLogError is the input model for UI errors
type NewLogError struct {
Message string `json:"message"`
diff --git a/app/handlers/common_test.go b/app/handlers/common_test.go
index 52f197169..7239c4b90 100644
--- a/app/handlers/common_test.go
+++ b/app/handlers/common_test.go
@@ -71,7 +71,7 @@ Disallow: /admin/
Disallow: /oauth/
Disallow: /terms
Disallow: /privacy
-Disallow: /-/ui
+Disallow: /_design
Sitemap: https://demo.test.fider.io/sitemap.xml`)
}
diff --git a/app/handlers/oauth.go b/app/handlers/oauth.go
index e5ab9c20e..6655d27c9 100644
--- a/app/handlers/oauth.go
+++ b/app/handlers/oauth.go
@@ -111,7 +111,7 @@ func OAuthToken() web.HandlerFunc {
Email: oauthUser.Result.Email,
Role: enum.RoleVisitor,
Providers: []*models.UserProvider{
- &models.UserProvider{
+ {
UID: oauthUser.Result.ID,
Name: provider,
},
diff --git a/app/middlewares/security_test.go b/app/middlewares/security_test.go
index efd5c9fd7..6129a2738 100644
--- a/app/middlewares/security_test.go
+++ b/app/middlewares/security_test.go
@@ -23,7 +23,7 @@ func TestSecureWithoutCDN(t *testing.T) {
return c.NoContent(http.StatusOK)
})
- expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com ; script-src 'self' 'nonce-" + ctxID + "' https://www.google-analytics.com ; img-src 'self' https: data: ; font-src 'self' https://fonts.gstatic.com data: ; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com ; frame-src 'self'"
+ expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com ; script-src 'self' 'nonce-" + ctxID + "' https://www.google-analytics.com ; img-src 'self' https: data: ; font-src 'self' https://fonts.gstatic.com data: ; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com ; frame-src 'self'"
Expect(status).Equals(http.StatusOK)
Expect(response.Header().Get("Content-Security-Policy")).Equals(expectedPolicy)
@@ -46,7 +46,7 @@ func TestSecureWithCDN(t *testing.T) {
return c.NoContent(http.StatusOK)
})
- expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com *.test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://www.google-analytics.com *.test.fider.io; img-src 'self' https: data: *.test.fider.io; font-src 'self' https://fonts.gstatic.com data: *.test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com *.test.fider.io; frame-src 'self'"
+ expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com *.test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://www.google-analytics.com *.test.fider.io; img-src 'self' https: data: *.test.fider.io; font-src 'self' https://fonts.gstatic.com data: *.test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com *.test.fider.io; frame-src 'self'"
Expect(status).Equals(http.StatusOK)
Expect(response.Header().Get("Content-Security-Policy")).Equals(expectedPolicy)
@@ -69,7 +69,7 @@ func TestSecureWithCDN_SingleHost(t *testing.T) {
return c.NoContent(http.StatusOK)
})
- expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://www.google-analytics.com test.fider.io; img-src 'self' https: data: test.fider.io; font-src 'self' https://fonts.gstatic.com data: test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com test.fider.io; frame-src 'self'"
+ expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://www.google-analytics.com test.fider.io; img-src 'self' https: data: test.fider.io; font-src 'self' https://fonts.gstatic.com data: test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com test.fider.io; frame-src 'self'"
Expect(status).Equals(http.StatusOK)
Expect(response.Header().Get("Content-Security-Policy")).Equals(expectedPolicy)
diff --git a/app/pkg/web/engine.go b/app/pkg/web/engine.go
index 3b568df50..fc9c245de 100644
--- a/app/pkg/web/engine.go
+++ b/app/pkg/web/engine.go
@@ -24,11 +24,12 @@ import (
)
// fonts.gstatic.com and fonts.googleapis.com are required for Custom CSS to work with Google Fonts
+// unsafe-inline on Style is required for rendering Tags on SSR
var (
cspBase = "base-uri 'self'"
cspDefault = "default-src 'self'"
- cspStyle = "style-src 'self' 'nonce-%[1]s' https://fonts.googleapis.com %[2]s"
+ cspStyle = "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com %[2]s"
cspScript = "script-src 'self' 'nonce-%[1]s' https://www.google-analytics.com %[2]s"
cspFont = "font-src 'self' https://fonts.gstatic.com data: %[2]s"
cspImage = "img-src 'self' https: data: %[2]s"
diff --git a/app/pkg/web/react_test.go b/app/pkg/web/react_test.go
index e148fcbf7..761dba0d7 100644
--- a/app/pkg/web/react_test.go
+++ b/app/pkg/web/react_test.go
@@ -33,7 +33,9 @@ func TestReactRenderer_RenderEmptyHomeHTML(t *testing.T) {
"countPerStatus": web.Map{},
},
})
- Expect(html).Equals(`<div id="c-header"><div class="c-env-info">Env: | Compiler: | Version: | BuildTime: N/A |TenantID: 0 | </div><div class="c-menu"><div class="container"><a href="/" class="c-menu-item-title"><h1></h1></a><div class="c-menu-item-signin"><span>Sign in</span></div></div></div></div><div id="p-home" class="page container"><div class="row"><div class="l-welcome-col col-md-4"><div class="markdown-body welcome-message"><p>We&#39;d love to hear what you&#39;re thinking about. </p>
-<p>What can we do better? This is the place for you to vote, discuss and share ideas.</p></div><form autoComplete="off" class="c-form"><div class="c-form-field"><div class="c-form-field-wrapper"><input type="text" id="input-title" tabindex="-1" maxLength="100" value="" placeholder="Enter your suggestion here..."/></div></div></form><div class="c-powered"><a rel="noopener" href="https://getfider.com" target="_blank">Powered by Fider</a></div></div><div class="l-posts-col col-md-8"><div class="l-lonely center"><p><img alt="No Posts" height="100" src="data:image/svg+xml;base64,PHN2ZyBpZD0iYjIxNjEzYzktMmJmMC00ZDM3LWJlZjAtM2IxOTNkMzRmYzVkIiBkYXRhLW5hbWU9IkxheWVyIDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjY0Ny42MzYyNiIgaGVpZ2h0PSI2MzIuMTczODMiIHZpZXdCb3g9IjAgMCA2NDcuNjM2MjYgNjMyLjE3MzgzIj48cGF0aCBkPSJNNjg3LjMyNzksMjc2LjA4NjkxSDUxMi44MTgxM2ExNS4wMTgyOCwxNS4wMTgyOCwwLDAsMC0xNSwxNXYzODcuODVsLTIsLjYxMDA1LTQyLjgxMDA2LDEzLjExYTguMDA2NzYsOC4wMDY3NiwwLDAsMS05Ljk4OTc0LTUuMzFMMzE1LjY3OCwyNzEuMzk2OTFhOC4wMDMxMyw4LjAwMzEzLDAsMCwxLDUuMzEwMDYtOS45OWw2NS45NzAyMi0yMC4yLDE5MS4yNS01OC41NCw2NS45Njk3Mi0yMC4yYTcuOTg5MjcsNy45ODkyNywwLDAsMSw5Ljk5MDI0LDUuM2wzMi41NDk4LDEwNi4zMloiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYuMTgxODcgLTEzMy45MTMwOSkiIGZpbGw9IiNmMmYyZjIiLz48cGF0aCBkPSJNNzI1LjQwOCwyNzQuMDg2OTFsLTM5LjIzLTEyOC4xNGExNi45OTM2OCwxNi45OTM2OCwwLDAsMC0yMS4yMy0xMS4yOGwtOTIuNzUsMjguMzlMMzgwLjk1ODI3LDIyMS42MDY5M2wtOTIuNzUsMjguNGExNy4wMTUyLDE3LjAxNTIsMCwwLDAtMTEuMjgwMjgsMjEuMjNsMTM0LjA4MDA4LDQzNy45M2ExNy4wMjY2MSwxNy4wMjY2MSwwLDAsMCwxNi4yNjAyNiwxMi4wMywxNi43ODkyNiwxNi43ODkyNiwwLDAsMCw0Ljk2OTcyLS43NWw2My41ODAwOC0xOS40NiwyLS42MnYtMi4wOWwtMiwuNjEtNjQuMTY5OTIsMTkuNjVhMTUuMDE0ODksMTUuMDE0ODksMCwwLDEtMTguNzMtOS45NWwtMTM0LjA2OTgzLTQzNy45NGExNC45NzkzNSwxNC45NzkzNSwwLDAsMSw5Ljk0OTcxLTE4LjczbDkyLjc1LTI4LjQsMTkxLjI0MDI0LTU4LjU0LDkyLjc1LTI4LjRhMTUuMTU1NTEsMTUuMTU1NTEsMCwwLDEsNC40MDk2Ni0uNjYsMTUuMDE0NjEsMTUuMDE0NjEsMCwwLDEsMTQuMzIwMzIsMTAuNjFsMzkuMDQ5OCwxMjcuNTYuNjIwMTIsMmgyLjA4MDA4WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzNmM2Q1NiIvPjxwYXRoIGQ9Ik0zOTguODYyNzksMjYxLjczMzg5YTkuMDE1Nyw5LjAxNTcsMCwwLDEtOC42MTEzMy02LjM2NjdsLTEyLjg4MDM3LTQyLjA3MTc4YTguOTk4ODQsOC45OTg4NCwwLDAsMSw1Ljk3MTItMTEuMjQwMjNsMTc1LjkzOS01My44NjM3N2E5LjAwODY3LDkuMDA4NjcsMCwwLDEsMTEuMjQwNzIsNS45NzA3bDEyLjg4MDM3LDQyLjA3MjI3YTkuMDEwMjksOS4wMTAyOSwwLDAsMS01Ljk3MDcsMTEuMjQwNzJMNDAxLjQ5MjE5LDI2MS4zMzg4N0E4Ljk3Niw4Ljk3NiwwLDAsMSwzOTguODYyNzksMjYxLjczMzg5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzQzMzhjYSIvPjxjaXJjbGUgY3g9IjE5MC4xNTM1MSIgY3k9IjI0Ljk1NDY1IiByPSIyMCIgZmlsbD0iIzQzMzhjYSIvPjxjaXJjbGUgY3g9IjE5MC4xNTM1MSIgY3k9IjI0Ljk1NDY1IiByPSIxMi42NjQ2MiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik04NzguODE4MzYsNzE2LjA4NjkxaC0zMzhhOC41MDk4MSw4LjUwOTgxLDAsMCwxLTguNS04LjV2LTQwNWE4LjUwOTUxLDguNTA5NTEsMCwwLDEsOC41LTguNWgzMzhhOC41MDk4Miw4LjUwOTgyLDAsMCwxLDguNSw4LjV2NDA1QTguNTEwMTMsOC41MTAxMywwLDAsMSw4NzguODE4MzYsNzE2LjA4NjkxWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iI2U2ZTZlNiIvPjxwYXRoIGQ9Ik03MjMuMzE4MTMsMjc0LjA4NjkxaC0yMTAuNWExNy4wMjQxMSwxNy4wMjQxMSwwLDAsMC0xNywxN3Y0MDcuOGwyLS42MXYtNDA3LjE5YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLDE1LTE1SDcyMy45MzgyNVptMTgzLjUsMGgtMzk0YTE3LjAyNDExLDE3LjAyNDExLDAsMCwwLTE3LDE3djQ1OGExNy4wMjQxLDE3LjAyNDEsMCwwLDAsMTcsMTdoMzk0YTE3LjAyNDEsMTcuMDI0MSwwLDAsMCwxNy0xN3YtNDU4QTE3LjAyNDExLDE3LjAyNDExLDAsMCwwLDkwNi44MTgxMywyNzQuMDg2OTFabTE1LDQ3NWExNS4wMTgyOCwxNS4wMTgyOCwwLDAsMS0xNSwxNWgtMzk0YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLTE1LTE1di00NThhMTUuMDE4MjgsMTUuMDE4MjgsMCwwLDEsMTUtMTVoMzk0YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLDE1LDE1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzNmM2Q1NiIvPjxwYXRoIGQ9Ik04MDEuODE4MzYsMzE4LjA4NjkxaC0xODRhOS4wMTAxNSw5LjAxMDE1LDAsMCwxLTktOXYtNDRhOS4wMTAxNiw5LjAxMDE2LDAsMCwxLDktOWgxODRhOS4wMTAxNiw5LjAxMDE2LDAsMCwxLDksOXY0NEE5LjAxMDE1LDkuMDEwMTUsMCwwLDEsODAxLjgxODM2LDMxOC4wODY5MVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYuMTgxODcgLTEzMy45MTMwOSkiIGZpbGw9IiM0MzM4Y2EiLz48Y2lyY2xlIGN4PSI0MzMuNjM2MjYiIGN5PSIxMDUuMTczODMiIHI9IjIwIiBmaWxsPSIjNDMzOGNhIi8+PGNpcmNsZSBjeD0iNDMzLjYzNjI2IiBjeT0iMTA1LjE3MzgzIiByPSIxMi4xODE4NyIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg=="/></p><p>No posts have been created yet.</p></div></div></div></div>`)
+ Expect(html).ContainsSubstring(`<div class="c-dev-banner">DEV</div>`)
+ Expect(html).ContainsSubstring(`<input type="text" class="c-input" id="input-title"`)
+ Expect(html).ContainsSubstring(`What can we do better? This is the place for you to vote, discuss and share ideas.`)
+ Expect(html).ContainsSubstring(`Powered by Fider`)
Expect(err).IsNil()
}
diff --git a/app/pkg/web/testdata/basic.html b/app/pkg/web/testdata/basic.html
index 5327f65a7..d32079669 100755
--- a/app/pkg/web/testdata/basic.html
+++ b/app/pkg/web/testdata/basic.html
@@ -25,11 +25,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/app/pkg/web/testdata/canonical.html b/app/pkg/web/testdata/canonical.html
index f03fd5bd8..6b6976064 100755
--- a/app/pkg/web/testdata/canonical.html
+++ b/app/pkg/web/testdata/canonical.html
@@ -27,11 +27,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/app/pkg/web/testdata/chunk.html b/app/pkg/web/testdata/chunk.html
index 1f6a76776..908636c8f 100644
--- a/app/pkg/web/testdata/chunk.html
+++ b/app/pkg/web/testdata/chunk.html
@@ -32,11 +32,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/app/pkg/web/testdata/home.html b/app/pkg/web/testdata/home.html
index 8acdb7444..45d899fef 100755
--- a/app/pkg/web/testdata/home.html
+++ b/app/pkg/web/testdata/home.html
@@ -25,11 +25,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/app/pkg/web/testdata/home_ssr.html b/app/pkg/web/testdata/home_ssr.html
index 6371a9ee5..43b10d4e3 100755
--- a/app/pkg/web/testdata/home_ssr.html
+++ b/app/pkg/web/testdata/home_ssr.html
@@ -29,8 +29,8 @@
-<div id="root"><div id="c-header"><div class="c-env-info">Env: | Compiler: | Version: | BuildTime: N/A |TenantID: 0 | </div><div class="c-menu"><div class="container"><a href="/" class="c-menu-item-title"><h1></h1></a><div class="c-menu-item-signin"><span>Sign in</span></div></div></div></div><div id="p-home" class="page container"><div class="row"><div class="l-welcome-col col-md-4"><div class="markdown-body welcome-message"><p>We&#39;d love to hear what you&#39;re thinking about. </p>
-<p>What can we do better? This is the place for you to vote, discuss and share ideas.</p></div><form autoComplete="off" class="c-form"><div class="c-form-field"><div class="c-form-field-wrapper"><input type="text" id="input-title" tabindex="-1" maxLength="100" value="" placeholder="Enter your suggestion here..."/></div></div></form><div class="c-powered"><a rel="noopener" href="https://getfider.com" target="_blank">Powered by Fider</a></div></div><div class="l-posts-col col-md-8"><div class="l-lonely center"><p><img alt="No Posts" height="100" src="data:image/svg+xml;base64,PHN2ZyBpZD0iYjIxNjEzYzktMmJmMC00ZDM3LWJlZjAtM2IxOTNkMzRmYzVkIiBkYXRhLW5hbWU9IkxheWVyIDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjY0Ny42MzYyNiIgaGVpZ2h0PSI2MzIuMTczODMiIHZpZXdCb3g9IjAgMCA2NDcuNjM2MjYgNjMyLjE3MzgzIj48cGF0aCBkPSJNNjg3LjMyNzksMjc2LjA4NjkxSDUxMi44MTgxM2ExNS4wMTgyOCwxNS4wMTgyOCwwLDAsMC0xNSwxNXYzODcuODVsLTIsLjYxMDA1LTQyLjgxMDA2LDEzLjExYTguMDA2NzYsOC4wMDY3NiwwLDAsMS05Ljk4OTc0LTUuMzFMMzE1LjY3OCwyNzEuMzk2OTFhOC4wMDMxMyw4LjAwMzEzLDAsMCwxLDUuMzEwMDYtOS45OWw2NS45NzAyMi0yMC4yLDE5MS4yNS01OC41NCw2NS45Njk3Mi0yMC4yYTcuOTg5MjcsNy45ODkyNywwLDAsMSw5Ljk5MDI0LDUuM2wzMi41NDk4LDEwNi4zMloiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYuMTgxODcgLTEzMy45MTMwOSkiIGZpbGw9IiNmMmYyZjIiLz48cGF0aCBkPSJNNzI1LjQwOCwyNzQuMDg2OTFsLTM5LjIzLTEyOC4xNGExNi45OTM2OCwxNi45OTM2OCwwLDAsMC0yMS4yMy0xMS4yOGwtOTIuNzUsMjguMzlMMzgwLjk1ODI3LDIyMS42MDY5M2wtOTIuNzUsMjguNGExNy4wMTUyLDE3LjAxNTIsMCwwLDAtMTEuMjgwMjgsMjEuMjNsMTM0LjA4MDA4LDQzNy45M2ExNy4wMjY2MSwxNy4wMjY2MSwwLDAsMCwxNi4yNjAyNiwxMi4wMywxNi43ODkyNiwxNi43ODkyNiwwLDAsMCw0Ljk2OTcyLS43NWw2My41ODAwOC0xOS40NiwyLS42MnYtMi4wOWwtMiwuNjEtNjQuMTY5OTIsMTkuNjVhMTUuMDE0ODksMTUuMDE0ODksMCwwLDEtMTguNzMtOS45NWwtMTM0LjA2OTgzLTQzNy45NGExNC45NzkzNSwxNC45NzkzNSwwLDAsMSw5Ljk0OTcxLTE4LjczbDkyLjc1LTI4LjQsMTkxLjI0MDI0LTU4LjU0LDkyLjc1LTI4LjRhMTUuMTU1NTEsMTUuMTU1NTEsMCwwLDEsNC40MDk2Ni0uNjYsMTUuMDE0NjEsMTUuMDE0NjEsMCwwLDEsMTQuMzIwMzIsMTAuNjFsMzkuMDQ5OCwxMjcuNTYuNjIwMTIsMmgyLjA4MDA4WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzNmM2Q1NiIvPjxwYXRoIGQ9Ik0zOTguODYyNzksMjYxLjczMzg5YTkuMDE1Nyw5LjAxNTcsMCwwLDEtOC42MTEzMy02LjM2NjdsLTEyLjg4MDM3LTQyLjA3MTc4YTguOTk4ODQsOC45OTg4NCwwLDAsMSw1Ljk3MTItMTEuMjQwMjNsMTc1LjkzOS01My44NjM3N2E5LjAwODY3LDkuMDA4NjcsMCwwLDEsMTEuMjQwNzIsNS45NzA3bDEyLjg4MDM3LDQyLjA3MjI3YTkuMDEwMjksOS4wMTAyOSwwLDAsMS01Ljk3MDcsMTEuMjQwNzJMNDAxLjQ5MjE5LDI2MS4zMzg4N0E4Ljk3Niw4Ljk3NiwwLDAsMSwzOTguODYyNzksMjYxLjczMzg5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzQzMzhjYSIvPjxjaXJjbGUgY3g9IjE5MC4xNTM1MSIgY3k9IjI0Ljk1NDY1IiByPSIyMCIgZmlsbD0iIzQzMzhjYSIvPjxjaXJjbGUgY3g9IjE5MC4xNTM1MSIgY3k9IjI0Ljk1NDY1IiByPSIxMi42NjQ2MiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik04NzguODE4MzYsNzE2LjA4NjkxaC0zMzhhOC41MDk4MSw4LjUwOTgxLDAsMCwxLTguNS04LjV2LTQwNWE4LjUwOTUxLDguNTA5NTEsMCwwLDEsOC41LTguNWgzMzhhOC41MDk4Miw4LjUwOTgyLDAsMCwxLDguNSw4LjV2NDA1QTguNTEwMTMsOC41MTAxMywwLDAsMSw4NzguODE4MzYsNzE2LjA4NjkxWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iI2U2ZTZlNiIvPjxwYXRoIGQ9Ik03MjMuMzE4MTMsMjc0LjA4NjkxaC0yMTAuNWExNy4wMjQxMSwxNy4wMjQxMSwwLDAsMC0xNywxN3Y0MDcuOGwyLS42MXYtNDA3LjE5YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLDE1LTE1SDcyMy45MzgyNVptMTgzLjUsMGgtMzk0YTE3LjAyNDExLDE3LjAyNDExLDAsMCwwLTE3LDE3djQ1OGExNy4wMjQxLDE3LjAyNDEsMCwwLDAsMTcsMTdoMzk0YTE3LjAyNDEsMTcuMDI0MSwwLDAsMCwxNy0xN3YtNDU4QTE3LjAyNDExLDE3LjAyNDExLDAsMCwwLDkwNi44MTgxMywyNzQuMDg2OTFabTE1LDQ3NWExNS4wMTgyOCwxNS4wMTgyOCwwLDAsMS0xNSwxNWgtMzk0YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLTE1LTE1di00NThhMTUuMDE4MjgsMTUuMDE4MjgsMCwwLDEsMTUtMTVoMzk0YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLDE1LDE1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzNmM2Q1NiIvPjxwYXRoIGQ9Ik04MDEuODE4MzYsMzE4LjA4NjkxaC0xODRhOS4wMTAxNSw5LjAxMDE1LDAsMCwxLTktOXYtNDRhOS4wMTAxNiw5LjAxMDE2LDAsMCwxLDktOWgxODRhOS4wMTAxNiw5LjAxMDE2LDAsMCwxLDksOXY0NEE5LjAxMDE1LDkuMDEwMTUsMCwwLDEsODAxLjgxODM2LDMxOC4wODY5MVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYuMTgxODcgLTEzMy45MTMwOSkiIGZpbGw9IiM0MzM4Y2EiLz48Y2lyY2xlIGN4PSI0MzMuNjM2MjYiIGN5PSIxMDUuMTczODMiIHI9IjIwIiBmaWxsPSIjNDMzOGNhIi8+PGNpcmNsZSBjeD0iNDMzLjYzNjI2IiBjeT0iMTA1LjE3MzgzIiByPSIxMi4xODE4NyIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg=="/></p><p>No posts have been created yet.</p></div></div></div></div></div>
+<div id="root"><div class="c-dev-banner">DEV</div><div id="c-header"><div class="c-menu shadow p-2 w-full flex flex flex-x flex--spacing-1 flex-items-center"><div class="container"><div class="flex flex flex-x flex--spacing-1 flex-items-center justify-between"><a href="/" class="flex flex-x flex-items-center flex--spacing-2 h-8"><h1 class="text-title"></h1></a><a href="#" class="uppercase text-sm">Sign in</a></div></div></div></div><div id="p-home" class="page container"><div class="p-home__welcome-col"><div class="flex flex flex-y flex--spacing-2"><div class="c-markdown "><p>We&#39;d love to hear what you&#39;re thinking about. </p>
+<p>What can we do better? This is the place for you to vote, discuss and share ideas.</p></div><form autoComplete="off" class="c-form"><div class="c-form-field"><div class="relative flex flex flex-x"><input type="text" class="c-input" id="input-title" tabindex="-1" maxLength="100" value="" placeholder="Enter your suggestion here..."/></div></div></form><div class="c-powered sm:hidden md:hidden lg:block"><a rel="noopener" href="https://getfider.com" target="_blank">Powered by Fider</a></div></div></div><div class="p-home__posts-col"><div class="text-center"><img height="120" class="mt-6 mb-2" src="data:image/svg+xml;base64,PHN2ZyBpZD0iYjIxNjEzYzktMmJmMC00ZDM3LWJlZjAtM2IxOTNkMzRmYzVkIiBkYXRhLW5hbWU9IkxheWVyIDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjY0Ny42MzYyNiIgaGVpZ2h0PSI2MzIuMTczODMiIHZpZXdCb3g9IjAgMCA2NDcuNjM2MjYgNjMyLjE3MzgzIj48cGF0aCBkPSJNNjg3LjMyNzksMjc2LjA4NjkxSDUxMi44MTgxM2ExNS4wMTgyOCwxNS4wMTgyOCwwLDAsMC0xNSwxNXYzODcuODVsLTIsLjYxMDA1LTQyLjgxMDA2LDEzLjExYTguMDA2NzYsOC4wMDY3NiwwLDAsMS05Ljk4OTc0LTUuMzFMMzE1LjY3OCwyNzEuMzk2OTFhOC4wMDMxMyw4LjAwMzEzLDAsMCwxLDUuMzEwMDYtOS45OWw2NS45NzAyMi0yMC4yLDE5MS4yNS01OC41NCw2NS45Njk3Mi0yMC4yYTcuOTg5MjcsNy45ODkyNywwLDAsMSw5Ljk5MDI0LDUuM2wzMi41NDk4LDEwNi4zMloiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYuMTgxODcgLTEzMy45MTMwOSkiIGZpbGw9IiNmMmYyZjIiLz48cGF0aCBkPSJNNzI1LjQwOCwyNzQuMDg2OTFsLTM5LjIzLTEyOC4xNGExNi45OTM2OCwxNi45OTM2OCwwLDAsMC0yMS4yMy0xMS4yOGwtOTIuNzUsMjguMzlMMzgwLjk1ODI3LDIyMS42MDY5M2wtOTIuNzUsMjguNGExNy4wMTUyLDE3LjAxNTIsMCwwLDAtMTEuMjgwMjgsMjEuMjNsMTM0LjA4MDA4LDQzNy45M2ExNy4wMjY2MSwxNy4wMjY2MSwwLDAsMCwxNi4yNjAyNiwxMi4wMywxNi43ODkyNiwxNi43ODkyNiwwLDAsMCw0Ljk2OTcyLS43NWw2My41ODAwOC0xOS40NiwyLS42MnYtMi4wOWwtMiwuNjEtNjQuMTY5OTIsMTkuNjVhMTUuMDE0ODksMTUuMDE0ODksMCwwLDEtMTguNzMtOS45NWwtMTM0LjA2OTgzLTQzNy45NGExNC45NzkzNSwxNC45NzkzNSwwLDAsMSw5Ljk0OTcxLTE4LjczbDkyLjc1LTI4LjQsMTkxLjI0MDI0LTU4LjU0LDkyLjc1LTI4LjRhMTUuMTU1NTEsMTUuMTU1NTEsMCwwLDEsNC40MDk2Ni0uNjYsMTUuMDE0NjEsMTUuMDE0NjEsMCwwLDEsMTQuMzIwMzIsMTAuNjFsMzkuMDQ5OCwxMjcuNTYuNjIwMTIsMmgyLjA4MDA4WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzNmM2Q1NiIvPjxwYXRoIGQ9Ik0zOTguODYyNzksMjYxLjczMzg5YTkuMDE1Nyw5LjAxNTcsMCwwLDEtOC42MTEzMy02LjM2NjdsLTEyLjg4MDM3LTQyLjA3MTc4YTguOTk4ODQsOC45OTg4NCwwLDAsMSw1Ljk3MTItMTEuMjQwMjNsMTc1LjkzOS01My44NjM3N2E5LjAwODY3LDkuMDA4NjcsMCwwLDEsMTEuMjQwNzIsNS45NzA3bDEyLjg4MDM3LDQyLjA3MjI3YTkuMDEwMjksOS4wMTAyOSwwLDAsMS01Ljk3MDcsMTEuMjQwNzJMNDAxLjQ5MjE5LDI2MS4zMzg4N0E4Ljk3Niw4Ljk3NiwwLDAsMSwzOTguODYyNzksMjYxLjczMzg5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzQzMzhjYSIvPjxjaXJjbGUgY3g9IjE5MC4xNTM1MSIgY3k9IjI0Ljk1NDY1IiByPSIyMCIgZmlsbD0iIzQzMzhjYSIvPjxjaXJjbGUgY3g9IjE5MC4xNTM1MSIgY3k9IjI0Ljk1NDY1IiByPSIxMi42NjQ2MiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik04NzguODE4MzYsNzE2LjA4NjkxaC0zMzhhOC41MDk4MSw4LjUwOTgxLDAsMCwxLTguNS04LjV2LTQwNWE4LjUwOTUxLDguNTA5NTEsMCwwLDEsOC41LTguNWgzMzhhOC41MDk4Miw4LjUwOTgyLDAsMCwxLDguNSw4LjV2NDA1QTguNTEwMTMsOC41MTAxMywwLDAsMSw4NzguODE4MzYsNzE2LjA4NjkxWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iI2U2ZTZlNiIvPjxwYXRoIGQ9Ik03MjMuMzE4MTMsMjc0LjA4NjkxaC0yMTAuNWExNy4wMjQxMSwxNy4wMjQxMSwwLDAsMC0xNywxN3Y0MDcuOGwyLS42MXYtNDA3LjE5YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLDE1LTE1SDcyMy45MzgyNVptMTgzLjUsMGgtMzk0YTE3LjAyNDExLDE3LjAyNDExLDAsMCwwLTE3LDE3djQ1OGExNy4wMjQxLDE3LjAyNDEsMCwwLDAsMTcsMTdoMzk0YTE3LjAyNDEsMTcuMDI0MSwwLDAsMCwxNy0xN3YtNDU4QTE3LjAyNDExLDE3LjAyNDExLDAsMCwwLDkwNi44MTgxMywyNzQuMDg2OTFabTE1LDQ3NWExNS4wMTgyOCwxNS4wMTgyOCwwLDAsMS0xNSwxNWgtMzk0YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLTE1LTE1di00NThhMTUuMDE4MjgsMTUuMDE4MjgsMCwwLDEsMTUtMTVoMzk0YTE1LjAxODI4LDE1LjAxODI4LDAsMCwxLDE1LDE1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3Ni4xODE4NyAtMTMzLjkxMzA5KSIgZmlsbD0iIzNmM2Q1NiIvPjxwYXRoIGQ9Ik04MDEuODE4MzYsMzE4LjA4NjkxaC0xODRhOS4wMTAxNSw5LjAxMDE1LDAsMCwxLTktOXYtNDRhOS4wMTAxNiw5LjAxMDE2LDAsMCwxLDktOWgxODRhOS4wMTAxNiw5LjAxMDE2LDAsMCwxLDksOXY0NEE5LjAxMDE1LDkuMDEwMTUsMCwwLDEsODAxLjgxODM2LDMxOC4wODY5MVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYuMTgxODcgLTEzMy45MTMwOSkiIGZpbGw9IiM0MzM4Y2EiLz48Y2lyY2xlIGN4PSI0MzMuNjM2MjYiIGN5PSIxMDUuMTczODMiIHI9IjIwIiBmaWxsPSIjNDMzOGNhIi8+PGNpcmNsZSBjeD0iNDMzLjYzNjI2IiBjeT0iMTA1LjE3MzgzIiByPSIxMi4xODE4NyIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg=="/><p class="text-muted">No posts have been created yet.</p></div><div class="c-powered lg:hidden xl:hidden mt-8"><a rel="noopener" href="https://getfider.com" target="_blank">Powered by Fider</a></div></div></div></div>
<script id="server-data" type="application/json">
diff --git a/app/pkg/web/testdata/oauth.html b/app/pkg/web/testdata/oauth.html
index ed74facef..7167a57ad 100755
--- a/app/pkg/web/testdata/oauth.html
+++ b/app/pkg/web/testdata/oauth.html
@@ -25,11 +25,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/app/pkg/web/testdata/tenant.html b/app/pkg/web/testdata/tenant.html
index 21e48a45a..327b8814e 100755
--- a/app/pkg/web/testdata/tenant.html
+++ b/app/pkg/web/testdata/tenant.html
@@ -25,11 +25,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/app/pkg/web/testdata/user.html b/app/pkg/web/testdata/user.html
index f940fdc12..ba21cb103 100755
--- a/app/pkg/web/testdata/user.html
+++ b/app/pkg/web/testdata/user.html
@@ -25,11 +25,10 @@
</head>
<body>
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
diff --git a/index.d.ts b/index.d.ts
index 6ec282b2e..c84485434 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -3,10 +3,16 @@ declare interface Window {
set: (key: string, value: any) => void
}
+interface SpriteSymbol {
+ id: string
+ viewBox: string
+ url: string
+}
+
declare let __webpack_nonce__: string
declare let __webpack_public_path__: string
declare module "*.svg" {
- const content: string
+ const content: SpriteSymbol
export default content
}
diff --git a/package-lock.json b/package-lock.json
index 5b8541c88..6eeabc3ad 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,7 +11,6 @@
"marked": "2.0.1",
"react": "17.0.2",
"react-dom": "17.0.2",
- "react-icons": "4.2.0",
"react-textarea-autosize": "8.3.2",
"react-toastify": "7.0.3",
"tslib": "2.2.0"
@@ -40,15 +39,16 @@
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-react": "7.23.2",
"eslint-plugin-react-hooks": "4.2.0",
- "file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "6.2.1",
"jest": "26.6.3",
"mini-css-extract-plugin": "1.4.1",
"node-sass": "5.0.0",
"prettier": "2.2.1",
"puppeteer": "8.0.0",
+ "purgecss-webpack-plugin": "4.0.3",
"reflect-metadata": "0.1.13",
"sass-loader": "11.0.1",
+ "svg-sprite-loader": "6.0.5",
"ts-jest": "26.5.4",
"ts-loader": "8.1.0",
"typescript": "4.2.4",
@@ -71,9 +71,9 @@
}
},
"node_modules/@babel/compat-data": {
- "version": "7.13.12",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz",
- "integrity": "sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==",
+ "version": "7.13.15",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz",
+ "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==",
"dev": true
},
"node_modules/@babel/core": {
@@ -155,12 +155,12 @@
}
},
"node_modules/@babel/helper-compilation-targets": {
- "version": "7.13.10",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.10.tgz",
- "integrity": "sha512-/Xju7Qg1GQO4mHZ/Kcs6Au7gfafgZnwm+a7sy/ow/tV1sHeraRUHbjdat8/UvDor4Tez+siGKDk6zIKtCPKVJA==",
+ "version": "7.13.13",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz",
+ "integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==",
"dev": true,
"dependencies": {
- "@babel/compat-data": "^7.13.8",
+ "@babel/compat-data": "^7.13.12",
"@babel/helper-validator-option": "^7.12.17",
"browserslist": "^4.14.5",
"semver": "^6.3.0"
@@ -602,9 +602,9 @@
}
},
"node_modules/@babel/types": {
- "version": "7.13.12",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.12.tgz",
- "integrity": "sha512-K4nY2xFN4QMvQwkQ+zmBDp6ANMbVNw6BbxWmYA4qNjhR9W+Lj/8ky5MEY2Me5r+B2c6/v6F53oMndG+f9s3IiA==",
+ "version": "7.13.14",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz",
+ "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.12.11",
@@ -2312,6 +2312,12 @@
"node": ">= 6"
}
},
+ "node_modules/bluebird": {
+ "version": "3.7.2",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
+ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
+ "dev": true
+ },
"node_modules/boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@@ -2781,6 +2787,15 @@
"node": ">=8"
}
},
+ "node_modules/clone": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
+ "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
"node_modules/clone-deep": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
@@ -3310,6 +3325,12 @@
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz",
"integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg=="
},
+ "node_modules/domready": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/domready/-/domready-1.0.8.tgz",
+ "integrity": "sha1-kfJS5Ze2Wvd+dFriTdAYXV4m1Yw=",
+ "dev": true
+ },
"node_modules/domutils": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.5.0.tgz",
@@ -4356,26 +4377,6 @@
"node": "^10.12.0 || >=12.0.0"
}
},
- "node_modules/file-loader": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
- "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
- "dev": true,
- "dependencies": {
- "loader-utils": "^2.0.0",
- "schema-utils": "^3.0.0"
- },
- "engines": {
- "node": ">= 10.13.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/webpack"
- },
- "peerDependencies": {
- "webpack": "^4.0.0 || ^5.0.0"
- }
- },
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -5024,6 +5025,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true,
+ "bin": {
+ "he": "bin/he"
+ }
+ },
"node_modules/hosted-git-info": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
@@ -5170,6 +5180,18 @@
"node": ">= 4"
}
},
+ "node_modules/image-size": {
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
+ "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
+ "dev": true,
+ "bin": {
+ "image-size": "bin/image-size.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@@ -5517,6 +5539,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/is-plain-obj": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
@@ -6836,6 +6867,18 @@
"node": ">=0.10.0"
}
},
+ "node_modules/merge-options": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-1.0.1.tgz",
+ "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==",
+ "dev": true,
+ "dependencies": {
+ "is-plain-obj": "^1.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -6970,6 +7013,12 @@
"node": ">= 8"
}
},
+ "node_modules/mitt": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.1.2.tgz",
+ "integrity": "sha1-OA5hSA1qYVtmDwertg1R4KTkvtY=",
+ "dev": true
+ },
"node_modules/mixin-deep": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
@@ -7958,6 +8007,116 @@
"postcss": "^8.1.0"
}
},
+ "node_modules/postcss-prefix-selector": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/postcss-prefix-selector/-/postcss-prefix-selector-1.9.0.tgz",
+ "integrity": "sha512-tTUHUNP+/Qfgg+fvbljUIeLs1ijICWb8+CT3bZM2joE2pkd+EnuBzSfZNHY2RMmozNRp44yEFv+I+6IIiLcoCg==",
+ "dev": true,
+ "dependencies": {
+ "postcss": "^7.0.0"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/chalk/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "node_modules/postcss-prefix-selector/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/postcss": {
+ "version": "7.0.35",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz",
+ "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ }
+ },
+ "node_modules/postcss-prefix-selector/node_modules/supports-color": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/postcss-selector-parser": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz",
@@ -7979,6 +8138,170 @@
"integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==",
"dev": true
},
+ "node_modules/posthtml": {
+ "version": "0.9.2",
+ "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.9.2.tgz",
+ "integrity": "sha1-9MBtufZ7Yf0XxOJW5+PZUVv3Jv0=",
+ "dev": true,
+ "dependencies": {
+ "posthtml-parser": "^0.2.0",
+ "posthtml-render": "^1.0.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/posthtml-parser": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.2.1.tgz",
+ "integrity": "sha1-NdUw3jhnQMK6JP8usvrznM3ycd0=",
+ "dev": true,
+ "dependencies": {
+ "htmlparser2": "^3.8.3",
+ "isobject": "^2.1.0"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/dom-serializer": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
+ "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==",
+ "dev": true,
+ "dependencies": {
+ "domelementtype": "^2.0.1",
+ "entities": "^2.0.0"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/dom-serializer/node_modules/domelementtype": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
+ "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ]
+ },
+ "node_modules/posthtml-parser/node_modules/dom-serializer/node_modules/entities": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
+ "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/domelementtype": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
+ "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
+ "dev": true
+ },
+ "node_modules/posthtml-parser/node_modules/domhandler": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
+ "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
+ "dev": true,
+ "dependencies": {
+ "domelementtype": "1"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/domutils": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
+ "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
+ "dev": true,
+ "dependencies": {
+ "dom-serializer": "0",
+ "domelementtype": "1"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/entities": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
+ "dev": true
+ },
+ "node_modules/posthtml-parser/node_modules/htmlparser2": {
+ "version": "3.10.1",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
+ "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
+ "dev": true,
+ "dependencies": {
+ "domelementtype": "^1.3.1",
+ "domhandler": "^2.3.0",
+ "domutils": "^1.5.1",
+ "entities": "^1.1.1",
+ "inherits": "^2.0.1",
+ "readable-stream": "^3.1.1"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "dev": true,
+ "dependencies": {
+ "isarray": "1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/posthtml-parser/node_modules/readable-stream": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "dev": true,
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/posthtml-rename-id": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/posthtml-rename-id/-/posthtml-rename-id-1.0.12.tgz",
+ "integrity": "sha512-UKXf9OF/no8WZo9edRzvuMenb6AD5hDLzIepJW+a4oJT+T/Lx7vfMYWT4aWlGNQh0WMhnUx1ipN9OkZ9q+ddEw==",
+ "dev": true,
+ "dependencies": {
+ "escape-string-regexp": "1.0.5"
+ }
+ },
+ "node_modules/posthtml-rename-id/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/posthtml-render": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/posthtml-render/-/posthtml-render-1.3.1.tgz",
+ "integrity": "sha512-eSToKjNLu0FiF76SSGMHjOFXYzAc/CJqi677Sq6hYvcvFCBtD6de/W5l+0IYPf7ypscqAfjCttxvTdMJt5Gj8Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/posthtml-svg-mode": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/posthtml-svg-mode/-/posthtml-svg-mode-1.0.3.tgz",
+ "integrity": "sha512-hEqw9NHZ9YgJ2/0G7CECOeuLQKZi8HjWLkBaSVtOWjygQ9ZD8P7tqeowYs7WrFdKsWEKG7o+IlsPY8jrr0CJpQ==",
+ "dev": true,
+ "dependencies": {
+ "merge-options": "1.0.1",
+ "posthtml": "^0.9.2",
+ "posthtml-parser": "^0.2.1",
+ "posthtml-render": "^1.0.6"
+ }
+ },
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -8133,15 +8456,79 @@
"node": ">=10.18.1"
}
},
- "node_modules/qs": {
- "version": "6.5.2",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
- "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
+ "node_modules/purgecss": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/purgecss/-/purgecss-4.0.3.tgz",
+ "integrity": "sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw==",
+ "dev": true,
+ "dependencies": {
+ "commander": "^6.0.0",
+ "glob": "^7.0.0",
+ "postcss": "^8.2.1",
+ "postcss-selector-parser": "^6.0.2"
+ },
+ "bin": {
+ "purgecss": "bin/purgecss.js"
+ }
+ },
+ "node_modules/purgecss-webpack-plugin": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/purgecss-webpack-plugin/-/purgecss-webpack-plugin-4.0.3.tgz",
+ "integrity": "sha512-YqmHRuKqjPhB+f/kURHYwlUR2QDcS8NSpCWrgQNICsSd8S2+tj40SDBav5b8KaSPQ8b/uXqrJxa/SnLyHK4BvQ==",
+ "dev": true,
+ "dependencies": {
+ "purgecss": "^4.0.3",
+ "webpack": "^5.4.0",
+ "webpack-sources": "^2.0.0"
+ },
+ "peerDependencies": {
+ "webpack": "*"
+ }
+ },
+ "node_modules/purgecss-webpack-plugin/node_modules/webpack-sources": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz",
+ "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==",
+ "dev": true,
+ "dependencies": {
+ "source-list-map": "^2.0.1",
+ "source-map": "^0.6.1"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/purgecss/node_modules/commander": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
+ "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.5.2",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
+ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true,
"engines": {
"node": ">=0.6"
}
},
+ "node_modules/query-string": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
+ "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
+ "dev": true,
+ "dependencies": {
+ "object-assign": "^4.1.0",
+ "strict-uri-encode": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -8224,14 +8611,6 @@
"react": "17.0.2"
}
},
- "node_modules/react-icons": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.2.0.tgz",
- "integrity": "sha512-rmzEDFt+AVXRzD7zDE21gcxyBizD/3NqjbX6cmViAgdqfJ2UiLer8927/QhhrXQV7dEj/1EGuOTPp7JnLYVJKQ==",
- "peerDependencies": {
- "react": "*"
- }
- },
"node_modules/react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
@@ -9966,6 +10345,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/strict-uri-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
+ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@@ -10114,65 +10502,443 @@
"node": ">=0.10.0"
}
},
- "node_modules/strip-final-newline": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
- "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "node_modules/strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/strip-indent": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
+ "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
+ "dev": true,
+ "dependencies": {
+ "get-stdin": "^4.0.1"
+ },
+ "bin": {
+ "strip-indent": "cli.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-hyperlinks": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz",
+ "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0",
+ "supports-color": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/svg-baker": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/svg-baker/-/svg-baker-1.7.0.tgz",
+ "integrity": "sha512-nibslMbkXOIkqKVrfcncwha45f97fGuAOn1G99YwnwTj8kF9YiM6XexPcUso97NxOm6GsP0SIvYVIosBis1xLg==",
+ "dev": true,
+ "dependencies": {
+ "bluebird": "^3.5.0",
+ "clone": "^2.1.1",
+ "he": "^1.1.1",
+ "image-size": "^0.5.1",
+ "loader-utils": "^1.1.0",
+ "merge-options": "1.0.1",
+ "micromatch": "3.1.0",
+ "postcss": "^5.2.17",
+ "postcss-prefix-selector": "^1.6.0",
+ "posthtml-rename-id": "^1.0",
+ "posthtml-svg-mode": "^1.0.3",
+ "query-string": "^4.3.2",
+ "traverse": "^0.6.6"
+ }
+ },
+ "node_modules/svg-baker-runtime": {
+ "version": "1.4.7",
+ "resolved": "https://registry.npmjs.org/svg-baker-runtime/-/svg-baker-runtime-1.4.7.tgz",
+ "integrity": "sha512-Zorfwwj5+lWjk/oxwSMsRdS2sPQQdTmmsvaSpzU+i9ZWi3zugHLt6VckWfnswphQP0LmOel3nggpF5nETbt6xw==",
+ "dev": true,
+ "dependencies": {
+ "deepmerge": "1.3.2",
+ "mitt": "1.1.2",
+ "svg-baker": "^1.7.0"
+ }
+ },
+ "node_modules/svg-baker-runtime/node_modules/deepmerge": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.3.2.tgz",
+ "integrity": "sha1-FmNpFinU2/42T6EqKk8KqGqjoFA=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/braces": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+ "dev": true,
+ "dependencies": {
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/chalk/node_modules/supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "dependencies": {
+ "is-descriptor": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/fill-range": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
+ "dev": true,
+ "dependencies": {
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/has-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
+ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/is-number": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
+ "dev": true,
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/is-number/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "dev": true,
+ "dependencies": {
+ "minimist": "^1.2.0"
+ },
+ "bin": {
+ "json5": "lib/cli.js"
+ }
+ },
+ "node_modules/svg-baker/node_modules/kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/loader-utils": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
+ "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+ "dev": true,
+ "dependencies": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/micromatch": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.0.tgz",
+ "integrity": "sha512-3StSelAE+hnRvMs8IdVW7Uhk8CVed5tp+kLLGlBP6WiRAXS21GPGu/Nat4WNPXj2Eoc24B02SaeoyozPMfj0/g==",
+ "dev": true,
+ "dependencies": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.2.2",
+ "define-property": "^1.0.0",
+ "extend-shallow": "^2.0.1",
+ "extglob": "^2.0.2",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^5.0.2",
+ "nanomatch": "^1.2.1",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/postcss": {
+ "version": "5.2.18",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz",
+ "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^1.1.3",
+ "js-base64": "^2.1.9",
+ "source-map": "^0.5.6",
+ "supports-color": "^3.2.3"
+ },
+ "engines": {
+ "node": ">=0.12"
+ }
+ },
+ "node_modules/svg-baker/node_modules/source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/supports-color": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
+ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/svg-baker/node_modules/to-regex-range": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
+ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
+ "dev": true,
+ "dependencies": {
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svg-sprite-loader": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/svg-sprite-loader/-/svg-sprite-loader-6.0.5.tgz",
+ "integrity": "sha512-d1F4Bkx//jvITCYo4r5wf8skiJLdTHEREIg9hMH+N9KGARm8o57oCR49O3iBevDY4T+TRcxuTPU479FNQVnt8w==",
"dev": true,
+ "dependencies": {
+ "bluebird": "^3.5.0",
+ "deepmerge": "1.3.2",
+ "domready": "1.0.8",
+ "escape-string-regexp": "1.0.5",
+ "loader-utils": "^1.1.0",
+ "svg-baker": "^1.5.0",
+ "svg-baker-runtime": "^1.4.7",
+ "url-slug": "2.0.0"
+ },
"engines": {
"node": ">=6"
}
},
- "node_modules/strip-indent": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
- "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
+ "node_modules/svg-sprite-loader/node_modules/deepmerge": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.3.2.tgz",
+ "integrity": "sha1-FmNpFinU2/42T6EqKk8KqGqjoFA=",
"dev": true,
- "dependencies": {
- "get-stdin": "^4.0.1"
- },
- "bin": {
- "strip-indent": "cli.js"
- },
"engines": {
"node": ">=0.10.0"
}
},
- "node_modules/strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "node_modules/svg-sprite-loader/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true,
"engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
+ "node": ">=0.8.0"
}
},
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "node_modules/svg-sprite-loader/node_modules/json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"dependencies": {
- "has-flag": "^4.0.0"
+ "minimist": "^1.2.0"
},
- "engines": {
- "node": ">=8"
+ "bin": {
+ "json5": "lib/cli.js"
}
},
- "node_modules/supports-hyperlinks": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz",
- "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==",
+ "node_modules/svg-sprite-loader/node_modules/loader-utils": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
+ "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"dependencies": {
- "has-flag": "^4.0.0",
- "supports-color": "^7.0.0"
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^1.0.1"
},
"engines": {
- "node": ">=8"
+ "node": ">=4.0.0"
}
},
"node_modules/symbol-tree": {
@@ -10550,6 +11316,12 @@
"node": ">=8"
}
},
+ "node_modules/traverse": {
+ "version": "0.6.6",
+ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz",
+ "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=",
+ "dev": true
+ },
"node_modules/trim-newlines": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
@@ -10754,6 +11526,15 @@
"through": "^2.3.8"
}
},
+ "node_modules/unidecode": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/unidecode/-/unidecode-0.1.8.tgz",
+ "integrity": "sha1-77swFTi8RSRqmsjFWdcvAVMFBT4=",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.4.12"
+ }
+ },
"node_modules/union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
@@ -10857,6 +11638,15 @@
"deprecated": "Please see https://github.com/lydell/urix#deprecated",
"dev": true
},
+ "node_modules/url-slug": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/url-slug/-/url-slug-2.0.0.tgz",
+ "integrity": "sha1-p4nVrtSZXA2VrzM3etHVxo1NcCc=",
+ "dev": true,
+ "dependencies": {
+ "unidecode": "0.1.8"
+ }
+ },
"node_modules/use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
@@ -11603,9 +12393,9 @@
}
},
"@babel/compat-data": {
- "version": "7.13.12",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz",
- "integrity": "sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==",
+ "version": "7.13.15",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz",
+ "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==",
"dev": true
},
"@babel/core": {
@@ -11675,12 +12465,12 @@
}
},
"@babel/helper-compilation-targets": {
- "version": "7.13.10",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.10.tgz",
- "integrity": "sha512-/Xju7Qg1GQO4mHZ/Kcs6Au7gfafgZnwm+a7sy/ow/tV1sHeraRUHbjdat8/UvDor4Tez+siGKDk6zIKtCPKVJA==",
+ "version": "7.13.13",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz",
+ "integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==",
"dev": true,
"requires": {
- "@babel/compat-data": "^7.13.8",
+ "@babel/compat-data": "^7.13.12",
"@babel/helper-validator-option": "^7.12.17",
"browserslist": "^4.14.5",
"semver": "^6.3.0"
@@ -12064,9 +12854,9 @@
}
},
"@babel/types": {
- "version": "7.13.12",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.12.tgz",
- "integrity": "sha512-K4nY2xFN4QMvQwkQ+zmBDp6ANMbVNw6BbxWmYA4qNjhR9W+Lj/8ky5MEY2Me5r+B2c6/v6F53oMndG+f9s3IiA==",
+ "version": "7.13.14",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz",
+ "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.12.11",
@@ -13439,6 +14229,12 @@
}
}
},
+ "bluebird": {
+ "version": "3.7.2",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
+ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
+ "dev": true
+ },
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@@ -13806,6 +14602,12 @@
}
}
},
+ "clone": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
+ "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
+ "dev": true
+ },
"clone-deep": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
@@ -14212,6 +15014,12 @@
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz",
"integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg=="
},
+ "domready": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/domready/-/domready-1.0.8.tgz",
+ "integrity": "sha1-kfJS5Ze2Wvd+dFriTdAYXV4m1Yw=",
+ "dev": true
+ },
"domutils": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.5.0.tgz",
@@ -15024,16 +15832,6 @@
"flat-cache": "^3.0.4"
}
},
- "file-loader": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
- "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
- "dev": true,
- "requires": {
- "loader-utils": "^2.0.0",
- "schema-utils": "^3.0.0"
- }
- },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -15528,6 +16326,12 @@
}
}
},
+ "he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true
+ },
"hosted-git-info": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
@@ -15626,6 +16430,12 @@
"integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
"dev": true
},
+ "image-size": {
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
+ "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
+ "dev": true
+ },
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@@ -15865,6 +16675,12 @@
"integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==",
"dev": true
},
+ "is-plain-obj": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+ "dev": true
+ },
"is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
@@ -16903,6 +17719,15 @@
}
}
},
+ "merge-options": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-1.0.1.tgz",
+ "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==",
+ "dev": true,
+ "requires": {
+ "is-plain-obj": "^1.1"
+ }
+ },
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -16997,6 +17822,12 @@
"yallist": "^4.0.0"
}
},
+ "mitt": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.1.2.tgz",
+ "integrity": "sha1-OA5hSA1qYVtmDwertg1R4KTkvtY=",
+ "dev": true
+ },
"mixin-deep": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
@@ -17730,6 +18561,95 @@
"icss-utils": "^5.0.0"
}
},
+ "postcss-prefix-selector": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/postcss-prefix-selector/-/postcss-prefix-selector-1.9.0.tgz",
+ "integrity": "sha512-tTUHUNP+/Qfgg+fvbljUIeLs1ijICWb8+CT3bZM2joE2pkd+EnuBzSfZNHY2RMmozNRp44yEFv+I+6IIiLcoCg==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "postcss": {
+ "version": "7.0.35",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz",
+ "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
+ }
+ },
+ "supports-color": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
"postcss-selector-parser": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz",
@@ -17748,6 +18668,152 @@
"integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==",
"dev": true
},
+ "posthtml": {
+ "version": "0.9.2",
+ "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.9.2.tgz",
+ "integrity": "sha1-9MBtufZ7Yf0XxOJW5+PZUVv3Jv0=",
+ "dev": true,
+ "requires": {
+ "posthtml-parser": "^0.2.0",
+ "posthtml-render": "^1.0.5"
+ }
+ },
+ "posthtml-parser": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.2.1.tgz",
+ "integrity": "sha1-NdUw3jhnQMK6JP8usvrznM3ycd0=",
+ "dev": true,
+ "requires": {
+ "htmlparser2": "^3.8.3",
+ "isobject": "^2.1.0"
+ },
+ "dependencies": {
+ "dom-serializer": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
+ "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^2.0.1",
+ "entities": "^2.0.0"
+ },
+ "dependencies": {
+ "domelementtype": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
+ "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
+ "dev": true
+ },
+ "entities": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
+ "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
+ "dev": true
+ }
+ }
+ },
+ "domelementtype": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
+ "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
+ "dev": true
+ },
+ "domhandler": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
+ "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "1"
+ }
+ },
+ "domutils": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
+ "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
+ "dev": true,
+ "requires": {
+ "dom-serializer": "0",
+ "domelementtype": "1"
+ }
+ },
+ "entities": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
+ "dev": true
+ },
+ "htmlparser2": {
+ "version": "3.10.1",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
+ "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^1.3.1",
+ "domhandler": "^2.3.0",
+ "domutils": "^1.5.1",
+ "entities": "^1.1.1",
+ "inherits": "^2.0.1",
+ "readable-stream": "^3.1.1"
+ }
+ },
+ "isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "dev": true,
+ "requires": {
+ "isarray": "1.0.0"
+ }
+ },
+ "readable-stream": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ }
+ }
+ }
+ },
+ "posthtml-rename-id": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/posthtml-rename-id/-/posthtml-rename-id-1.0.12.tgz",
+ "integrity": "sha512-UKXf9OF/no8WZo9edRzvuMenb6AD5hDLzIepJW+a4oJT+T/Lx7vfMYWT4aWlGNQh0WMhnUx1ipN9OkZ9q+ddEw==",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "1.0.5"
+ },
+ "dependencies": {
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ }
+ }
+ },
+ "posthtml-render": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/posthtml-render/-/posthtml-render-1.3.1.tgz",
+ "integrity": "sha512-eSToKjNLu0FiF76SSGMHjOFXYzAc/CJqi677Sq6hYvcvFCBtD6de/W5l+0IYPf7ypscqAfjCttxvTdMJt5Gj8Q==",
+ "dev": true
+ },
+ "posthtml-svg-mode": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/posthtml-svg-mode/-/posthtml-svg-mode-1.0.3.tgz",
+ "integrity": "sha512-hEqw9NHZ9YgJ2/0G7CECOeuLQKZi8HjWLkBaSVtOWjygQ9ZD8P7tqeowYs7WrFdKsWEKG7o+IlsPY8jrr0CJpQ==",
+ "dev": true,
+ "requires": {
+ "merge-options": "1.0.1",
+ "posthtml": "^0.9.2",
+ "posthtml-parser": "^0.2.1",
+ "posthtml-render": "^1.0.6"
+ }
+ },
"prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -17876,12 +18942,64 @@
"ws": "^7.2.3"
}
},
+ "purgecss": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/purgecss/-/purgecss-4.0.3.tgz",
+ "integrity": "sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw==",
+ "dev": true,
+ "requires": {
+ "commander": "^6.0.0",
+ "glob": "^7.0.0",
+ "postcss": "^8.2.1",
+ "postcss-selector-parser": "^6.0.2"
+ },
+ "dependencies": {
+ "commander": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
+ "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
+ "dev": true
+ }
+ }
+ },
+ "purgecss-webpack-plugin": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/purgecss-webpack-plugin/-/purgecss-webpack-plugin-4.0.3.tgz",
+ "integrity": "sha512-YqmHRuKqjPhB+f/kURHYwlUR2QDcS8NSpCWrgQNICsSd8S2+tj40SDBav5b8KaSPQ8b/uXqrJxa/SnLyHK4BvQ==",
+ "dev": true,
+ "requires": {
+ "purgecss": "^4.0.3",
+ "webpack-sources": "^2.0.0"
+ },
+ "dependencies": {
+ "webpack-sources": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz",
+ "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==",
+ "dev": true,
+ "requires": {
+ "source-list-map": "^2.0.1",
+ "source-map": "^0.6.1"
+ }
+ }
+ }
+ },
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true
},
+ "query-string": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
+ "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
+ "dev": true,
+ "requires": {
+ "object-assign": "^4.1.0",
+ "strict-uri-encode": "^1.0.0"
+ }
+ },
"queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -17941,12 +19059,6 @@
"scheduler": "^0.20.2"
}
},
- "react-icons": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.2.0.tgz",
- "integrity": "sha512-rmzEDFt+AVXRzD7zDE21gcxyBizD/3NqjbX6cmViAgdqfJ2UiLer8927/QhhrXQV7dEj/1EGuOTPp7JnLYVJKQ==",
- "requires": {}
- },
"react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
@@ -19314,6 +20426,12 @@
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
"dev": true
},
+ "strict-uri-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
+ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
+ "dev": true
+ },
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@@ -19468,6 +20586,310 @@
"supports-color": "^7.0.0"
}
},
+ "svg-baker": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/svg-baker/-/svg-baker-1.7.0.tgz",
+ "integrity": "sha512-nibslMbkXOIkqKVrfcncwha45f97fGuAOn1G99YwnwTj8kF9YiM6XexPcUso97NxOm6GsP0SIvYVIosBis1xLg==",
+ "dev": true,
+ "requires": {
+ "bluebird": "^3.5.0",
+ "clone": "^2.1.1",
+ "he": "^1.1.1",
+ "image-size": "^0.5.1",
+ "loader-utils": "^1.1.0",
+ "merge-options": "1.0.1",
+ "micromatch": "3.1.0",
+ "postcss": "^5.2.17",
+ "postcss-prefix-selector": "^1.6.0",
+ "posthtml-rename-id": "^1.0",
+ "posthtml-svg-mode": "^1.0.3",
+ "query-string": "^4.3.2",
+ "traverse": "^0.6.6"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "braces": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+ "dev": true,
+ "requires": {
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ }
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "fill-range": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ }
+ },
+ "has-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
+ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
+ "dev": true
+ },
+ "is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
+ "dev": true
+ },
+ "is-number": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "dev": true,
+ "requires": {
+ "minimist": "^1.2.0"
+ }
+ },
+ "kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "dev": true
+ },
+ "loader-utils": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
+ "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+ "dev": true,
+ "requires": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^1.0.1"
+ }
+ },
+ "micromatch": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.0.tgz",
+ "integrity": "sha512-3StSelAE+hnRvMs8IdVW7Uhk8CVed5tp+kLLGlBP6WiRAXS21GPGu/Nat4WNPXj2Eoc24B02SaeoyozPMfj0/g==",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.2.2",
+ "define-property": "^1.0.0",
+ "extend-shallow": "^2.0.1",
+ "extglob": "^2.0.2",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^5.0.2",
+ "nanomatch": "^1.2.1",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ }
+ },
+ "postcss": {
+ "version": "5.2.18",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz",
+ "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.1.3",
+ "js-base64": "^2.1.9",
+ "source-map": "^0.5.6",
+ "supports-color": "^3.2.3"
+ }
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
+ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
+ "dev": true,
+ "requires": {
+ "has-flag": "^1.0.0"
+ }
+ },
+ "to-regex-range": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
+ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
+ "dev": true,
+ "requires": {
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1"
+ }
+ }
+ }
+ },
+ "svg-baker-runtime": {
+ "version": "1.4.7",
+ "resolved": "https://registry.npmjs.org/svg-baker-runtime/-/svg-baker-runtime-1.4.7.tgz",
+ "integrity": "sha512-Zorfwwj5+lWjk/oxwSMsRdS2sPQQdTmmsvaSpzU+i9ZWi3zugHLt6VckWfnswphQP0LmOel3nggpF5nETbt6xw==",
+ "dev": true,
+ "requires": {
+ "deepmerge": "1.3.2",
+ "mitt": "1.1.2",
+ "svg-baker": "^1.7.0"
+ },
+ "dependencies": {
+ "deepmerge": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.3.2.tgz",
+ "integrity": "sha1-FmNpFinU2/42T6EqKk8KqGqjoFA=",
+ "dev": true
+ }
+ }
+ },
+ "svg-sprite-loader": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/svg-sprite-loader/-/svg-sprite-loader-6.0.5.tgz",
+ "integrity": "sha512-d1F4Bkx//jvITCYo4r5wf8skiJLdTHEREIg9hMH+N9KGARm8o57oCR49O3iBevDY4T+TRcxuTPU479FNQVnt8w==",
+ "dev": true,
+ "requires": {
+ "bluebird": "^3.5.0",
+ "deepmerge": "1.3.2",
+ "domready": "1.0.8",
+ "escape-string-regexp": "1.0.5",
+ "loader-utils": "^1.1.0",
+ "svg-baker": "^1.5.0",
+ "svg-baker-runtime": "^1.4.7",
+ "url-slug": "2.0.0"
+ },
+ "dependencies": {
+ "deepmerge": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.3.2.tgz",
+ "integrity": "sha1-FmNpFinU2/42T6EqKk8KqGqjoFA=",
+ "dev": true
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "dev": true,
+ "requires": {
+ "minimist": "^1.2.0"
+ }
+ },
+ "loader-utils": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
+ "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+ "dev": true,
+ "requires": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^1.0.1"
+ }
+ }
+ }
+ },
"symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
@@ -19767,6 +21189,12 @@
"punycode": "^2.1.1"
}
},
+ "traverse": {
+ "version": "0.6.6",
+ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz",
+ "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=",
+ "dev": true
+ },
"trim-newlines": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
@@ -19921,6 +21349,12 @@
"through": "^2.3.8"
}
},
+ "unidecode": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/unidecode/-/unidecode-0.1.8.tgz",
+ "integrity": "sha1-77swFTi8RSRqmsjFWdcvAVMFBT4=",
+ "dev": true
+ },
"union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
@@ -20008,6 +21442,15 @@
"integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
"dev": true
},
+ "url-slug": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/url-slug/-/url-slug-2.0.0.tgz",
+ "integrity": "sha1-p4nVrtSZXA2VrzM3etHVxo1NcCc=",
+ "dev": true,
+ "requires": {
+ "unidecode": "0.1.8"
+ }
+ },
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
diff --git a/package.json b/package.json
index 4d2ff4201..cf6de55b3 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,6 @@
"marked": "2.0.1",
"react": "17.0.2",
"react-dom": "17.0.2",
- "react-icons": "4.2.0",
"react-textarea-autosize": "8.3.2",
"react-toastify": "7.0.3",
"tslib": "2.2.0"
@@ -37,15 +36,16 @@
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-react": "7.23.2",
"eslint-plugin-react-hooks": "4.2.0",
- "file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "6.2.1",
"jest": "26.6.3",
"mini-css-extract-plugin": "1.4.1",
"node-sass": "5.0.0",
"prettier": "2.2.1",
"puppeteer": "8.0.0",
+ "purgecss-webpack-plugin": "4.0.3",
"reflect-metadata": "0.1.13",
"sass-loader": "11.0.1",
+ "svg-sprite-loader": "6.0.5",
"ts-jest": "26.5.4",
"ts-loader": "8.1.0",
"typescript": "4.2.4",
diff --git a/public/AsyncPages.tsx b/public/AsyncPages.tsx
index 4811dca5a..89bc0318d 100644
--- a/public/AsyncPages.tsx
+++ b/public/AsyncPages.tsx
@@ -151,10 +151,18 @@ export const AsyncOAuthEchoPage = load(
)
)
-export const AsyncUIToolkitPage = load(
+export const AsyncDesignSystemPage = load(
() =>
import(
- /* webpackChunkName: "UIToolkit.page" */
- "@fider/pages/UI/UIToolkit.page"
+ /* webpackChunkName: "DesignSystem.page" */
+ "@fider/pages/DesignSystem/DesignSystem.page"
+ )
+)
+
+export const AsyncLegalPage = load(
+ () =>
+ import(
+ /* webpackChunkName: "Legal.page" */
+ "@fider/pages/Legal/Legal.page"
)
)
diff --git a/public/assets/images/fa-caretup.svg b/public/assets/images/fa-caretup.svg
new file mode 100644
index 000000000..bfd7cdf11
--- /dev/null
+++ b/public/assets/images/fa-caretup.svg
@@ -0,0 +1,3 @@
+<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 320 512" xmlns="http://www.w3.org/2000/svg">
+ <path d="M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"></path>
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-bell.svg b/public/assets/images/heroicons-bell.svg
new file mode 100644
index 000000000..a6cb0f2be
--- /dev/null
+++ b/public/assets/images/heroicons-bell.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-chat-alt-2.svg b/public/assets/images/heroicons-chat-alt-2.svg
new file mode 100644
index 000000000..9aa611b21
--- /dev/null
+++ b/public/assets/images/heroicons-chat-alt-2.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-check-circle.svg b/public/assets/images/heroicons-check-circle.svg
new file mode 100644
index 000000000..65ea1dafb
--- /dev/null
+++ b/public/assets/images/heroicons-check-circle.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-check.svg b/public/assets/images/heroicons-check.svg
new file mode 100644
index 000000000..00fdab70f
--- /dev/null
+++ b/public/assets/images/heroicons-check.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-cog.svg b/public/assets/images/heroicons-cog.svg
new file mode 100644
index 000000000..893a70cb6
--- /dev/null
+++ b/public/assets/images/heroicons-cog.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-dots-horizontal.svg b/public/assets/images/heroicons-dots-horizontal.svg
new file mode 100644
index 000000000..85ed1090d
--- /dev/null
+++ b/public/assets/images/heroicons-dots-horizontal.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-download.svg b/public/assets/images/heroicons-download.svg
new file mode 100644
index 000000000..a0fbf8c27
--- /dev/null
+++ b/public/assets/images/heroicons-download.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-exclamation-circle.svg b/public/assets/images/heroicons-exclamation-circle.svg
new file mode 100644
index 000000000..02ffc5fff
--- /dev/null
+++ b/public/assets/images/heroicons-exclamation-circle.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-exclamation.svg b/public/assets/images/heroicons-exclamation.svg
new file mode 100644
index 000000000..35e2ca55a
--- /dev/null
+++ b/public/assets/images/heroicons-exclamation.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-information-circle.svg b/public/assets/images/heroicons-information-circle.svg
new file mode 100644
index 000000000..8ebddb4c5
--- /dev/null
+++ b/public/assets/images/heroicons-information-circle.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-light-bulb.svg b/public/assets/images/heroicons-light-bulb.svg
new file mode 100644
index 000000000..ab01d2af0
--- /dev/null
+++ b/public/assets/images/heroicons-light-bulb.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-menu.svg b/public/assets/images/heroicons-menu.svg
new file mode 100644
index 000000000..0ead96752
--- /dev/null
+++ b/public/assets/images/heroicons-menu.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-pencil-alt.svg b/public/assets/images/heroicons-pencil-alt.svg
new file mode 100644
index 000000000..19f42b98a
--- /dev/null
+++ b/public/assets/images/heroicons-pencil-alt.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-photograph.svg b/public/assets/images/heroicons-photograph.svg
new file mode 100644
index 000000000..9cbed26c8
--- /dev/null
+++ b/public/assets/images/heroicons-photograph.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-play.svg b/public/assets/images/heroicons-play.svg
new file mode 100644
index 000000000..733dc25c9
--- /dev/null
+++ b/public/assets/images/heroicons-play.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" />
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-search.svg b/public/assets/images/heroicons-search.svg
new file mode 100644
index 000000000..331b53d2c
--- /dev/null
+++ b/public/assets/images/heroicons-search.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-selector.svg b/public/assets/images/heroicons-selector.svg
new file mode 100644
index 000000000..fbe354113
--- /dev/null
+++ b/public/assets/images/heroicons-selector.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-speakerphone.svg b/public/assets/images/heroicons-speakerphone.svg
new file mode 100644
index 000000000..602f818fa
--- /dev/null
+++ b/public/assets/images/heroicons-speakerphone.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-volume-off.svg b/public/assets/images/heroicons-volume-off.svg
new file mode 100644
index 000000000..50afbb6f8
--- /dev/null
+++ b/public/assets/images/heroicons-volume-off.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" clip-rule="evenodd" />
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-volume-on.svg b/public/assets/images/heroicons-volume-on.svg
new file mode 100644
index 000000000..43fdf991b
--- /dev/null
+++ b/public/assets/images/heroicons-volume-on.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-x-circle.svg b/public/assets/images/heroicons-x-circle.svg
new file mode 100644
index 000000000..bc3ac9559
--- /dev/null
+++ b/public/assets/images/heroicons-x-circle.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/images/heroicons-x.svg b/public/assets/images/heroicons-x.svg
new file mode 100644
index 000000000..37d18da15
--- /dev/null
+++ b/public/assets/images/heroicons-x.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
+</svg>
\ No newline at end of file
diff --git a/public/assets/styles/_colors.scss b/public/assets/styles/_colors.scss
new file mode 100644
index 000000000..b4c62be86
--- /dev/null
+++ b/public/assets/styles/_colors.scss
@@ -0,0 +1,68 @@
+$colors: (
+ "gray": (
+ "900": #111827,
+ "800": #1f2937,
+ "700": #374151,
+ "600": #4b5563,
+ "500": #6b7280,
+ "400": #9ca3af,
+ "300": #d1d5db,
+ "200": #e5e7eb,
+ "100": #f3f4f6,
+ "50": #f9fafb,
+ ),
+ "green": (
+ "900": #14532d,
+ "800": #166534,
+ "700": #15803d,
+ "600": #16a34a,
+ "500": #22c55e,
+ "400": #4ade80,
+ "300": #86efac,
+ "200": #bbf7d0,
+ "100": #dcfce7,
+ "50": #f0fdf4,
+ ),
+ "yellow": (
+ "900": #78350f,
+ "800": #92400e,
+ "700": #b45309,
+ "600": #d97706,
+ "500": #f59e0b,
+ "400": #fbbf24,
+ "300": #fcd34d,
+ "200": #fde68a,
+ "100": #fef3c7,
+ "50": #fffbeb,
+ ),
+ "blue": (
+ "900": #0c4a6e,
+ "800": #075985,
+ "700": #0369a1,
+ "600": #0284c7,
+ "500": #0ea5e9,
+ "400": #38bdf8,
+ "300": #7dd3fc,
+ "200": #bae6fd,
+ "100": #e0f2fe,
+ "50": #f0f9ff,
+ ),
+ "red": (
+ "900": #7f1d1d,
+ "800": #991b1b,
+ "700": #b91c1c,
+ "600": #dc2626,
+ "500": #ef4444,
+ "400": #f87171,
+ "300": #fca5a5,
+ "200": #fecaca,
+ "100": #fee2e2,
+ "50": #fef2f2,
+ ),
+ "primary": (
+ "light": var(--primary-color-light, #818cf8),
+ "base": var(--primary-color, #4f46e5),
+ "dark": var(--primary-color-dark, #3730a3),
+ ),
+ "white": #fff,
+);
diff --git a/public/assets/styles/_functions.scss b/public/assets/styles/_functions.scss
new file mode 100644
index 000000000..d84902d7f
--- /dev/null
+++ b/public/assets/styles/_functions.scss
@@ -0,0 +1,69 @@
+// get
+@function get($key, $map: $all) {
+ $keys: str-explode($key, ".");
+
+ @if not deep-map-check($map, $keys...) {
+ @error 'The argument $map: `#{$map}` doesn\'t has some of the $keys: `#{$keys}`!';
+ }
+
+ @return deep-map-get($map, $keys...);
+}
+
+// deep-map-get
+@function deep-map-get($map, $keys...) {
+ @each $key in $keys {
+ $map: map-get($map, $key);
+ }
+ @return $map;
+}
+
+// str-explode
+@function str-explode($string, $delimiter: "") {
+ @if type-of($string) != "string" {
+ @error 'The argument $string: `#{$string}` is of incorrect type: `#{type-of($string)}`. Type of `String` is required!';
+ } @else if type-of($delimiter) != "string" {
+ @error 'The argument $string: `#{$string}` is of incorrect type: `#{type-of($string)}`. Type of `String` is required!';
+ }
+
+ $result: ();
+ $running: true;
+
+ @if str-length($delimiter) == 0 {
+ @for $i from 1 through str-length($string) {
+ $result: append($result, str-slice($string, $i, $i));
+ }
+
+ @return $result;
+ }
+
+ @while $running {
+ $index: str-index($string, $delimiter);
+
+ @if $index != null {
+ $item: str-slice($string, 1, ($index - 1));
+ $result: append($result, $item);
+ $string: str-slice($string, ($index + str-length($delimiter)));
+ } @else {
+ $running: false;
+ }
+ }
+
+ @return append($result, $string);
+}
+
+// deep-map-check
+@function deep-map-check($map, $keys...) {
+ @if type-of($map) != "map" {
+ @error 'The argument $map: `#{$map}` is of incorrect type: `#{type-of($map)}`. Type of `Map` is required!';
+ }
+
+ @each $key in $keys {
+ @if not map-has-key($map, $key) {
+ @return false;
+ }
+
+ $map: map-get($map, $key);
+ }
+
+ @return true;
+}
diff --git a/public/assets/styles/_sizing.scss b/public/assets/styles/_sizing.scss
new file mode 100644
index 000000000..4a0f8e013
--- /dev/null
+++ b/public/assets/styles/_sizing.scss
@@ -0,0 +1,5 @@
+$spacing-inc: 4px;
+
+@function spacing($i) {
+ @return $spacing-inc * $i;
+}
diff --git a/public/assets/styles/_spacing.scss b/public/assets/styles/_spacing.scss
new file mode 100644
index 000000000..c1b1fbd74
--- /dev/null
+++ b/public/assets/styles/_spacing.scss
@@ -0,0 +1,5 @@
+$sizing-inc: 4px;
+
+@function sizing($i) {
+ @return $sizing-inc * $i;
+}
diff --git a/public/assets/styles/_text.scss b/public/assets/styles/_text.scss
new file mode 100644
index 000000000..f24cf6bd9
--- /dev/null
+++ b/public/assets/styles/_text.scss
@@ -0,0 +1,26 @@
+$font-base: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+$font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+
+$font: (
+ family: (
+ base: $font-base,
+ code: $font-code,
+ ),
+ size: (
+ "2xs": 12px,
+ xs: 13px,
+ sm: 14px,
+ base: 15px,
+ lg: 18px,
+ xl: 22px,
+ "2xl": 26px,
+ ),
+ weight: (
+ light: 300,
+ normal: 400,
+ medium: 500,
+ semibold: 600,
+ bold: 700,
+ ),
+);
diff --git a/public/assets/styles/grid.scss b/public/assets/styles/grid.scss
deleted file mode 100644
index ec2e79ab8..000000000
--- a/public/assets/styles/grid.scss
+++ /dev/null
@@ -1,520 +0,0 @@
-// Container Size
-
-.container {
- position: relative;
- display: block;
- max-width: 100% !important;
-}
-
-@include media("sm") {
- .container {
- width: auto !important;
- margin-left: 10px !important;
- margin-right: 10px !important;
- }
-}
-
-@include media("md") {
- .container {
- width: 720px;
- margin-left: auto !important;
- margin-right: auto !important;
- }
-}
-
-@include media("lg") {
- .container {
- width: 960px;
- margin-left: auto !important;
- margin-right: auto !important;
- }
-}
-
-@include media("xl") {
- .container {
- width: 1140px;
- margin-left: auto !important;
- margin-right: auto !important;
- }
-}
-
-.row {
- display: -ms-flexbox;
- display: flex;
- -ms-flex-wrap: wrap;
- flex-wrap: wrap;
- margin-right: -10px;
- margin-left: -10px;
-
- .row > [class*="col-"] {
- padding-top: 0;
- padding-bottom: 0;
- }
-}
-
-.col-1,
-.col-2,
-.col-3,
-.col-4,
-.col-5,
-.col-6,
-.col-7,
-.col-8,
-.col-9,
-.col-10,
-.col-11,
-.col-12,
-.col,
-.col-auto,
-.col-sm-1,
-.col-sm-2,
-.col-sm-3,
-.col-sm-4,
-.col-sm-5,
-.col-sm-6,
-.col-sm-7,
-.col-sm-8,
-.col-sm-9,
-.col-sm-10,
-.col-sm-11,
-.col-sm-12,
-.col-sm,
-.col-sm-auto,
-.col-md-1,
-.col-md-2,
-.col-md-3,
-.col-md-4,
-.col-md-5,
-.col-md-6,
-.col-md-7,
-.col-md-8,
-.col-md-9,
-.col-md-10,
-.col-md-11,
-.col-md-12,
-.col-md,
-.col-md-auto,
-.col-lg-1,
-.col-lg-2,
-.col-lg-3,
-.col-lg-4,
-.col-lg-5,
-.col-lg-6,
-.col-lg-7,
-.col-lg-8,
-.col-lg-9,
-.col-lg-10,
-.col-lg-11,
-.col-lg-12,
-.col-lg,
-.col-lg-auto,
-.col-xl-1,
-.col-xl-2,
-.col-xl-3,
-.col-xl-4,
-.col-xl-5,
-.col-xl-6,
-.col-xl-7,
-.col-xl-8,
-.col-xl-9,
-.col-xl-10,
-.col-xl-11,
-.col-xl-12,
-.col-xl,
-.col-xl-auto {
- position: relative;
- width: 100%;
- min-height: 1px;
- padding: 10px;
-}
-
-.col {
- -ms-flex-preferred-size: 0;
- flex-basis: 0;
- -ms-flex-positive: 1;
- flex-grow: 1;
- max-width: 100%;
-}
-
-.col-auto {
- -ms-flex: 0 0 auto;
- flex: 0 0 auto;
- width: auto;
- max-width: none;
-}
-
-.col-1 {
- -ms-flex: 0 0 8.333333%;
- flex: 0 0 8.333333%;
- max-width: 8.333333%;
-}
-
-.col-2 {
- -ms-flex: 0 0 16.666667%;
- flex: 0 0 16.666667%;
- max-width: 16.666667%;
-}
-
-.col-3 {
- -ms-flex: 0 0 25%;
- flex: 0 0 25%;
- max-width: 25%;
-}
-
-.col-4 {
- -ms-flex: 0 0 33.333333%;
- flex: 0 0 33.333333%;
- max-width: 33.333333%;
-}
-
-.col-5 {
- -ms-flex: 0 0 41.666667%;
- flex: 0 0 41.666667%;
- max-width: 41.666667%;
-}
-
-.col-6 {
- -ms-flex: 0 0 50%;
- flex: 0 0 50%;
- max-width: 50%;
-}
-
-.col-7 {
- -ms-flex: 0 0 58.333333%;
- flex: 0 0 58.333333%;
- max-width: 58.333333%;
-}
-
-.col-8 {
- -ms-flex: 0 0 66.666667%;
- flex: 0 0 66.666667%;
- max-width: 66.666667%;
-}
-
-.col-9 {
- -ms-flex: 0 0 75%;
- flex: 0 0 75%;
- max-width: 75%;
-}
-
-.col-10 {
- -ms-flex: 0 0 83.333333%;
- flex: 0 0 83.333333%;
- max-width: 83.333333%;
-}
-
-.col-11 {
- -ms-flex: 0 0 91.666667%;
- flex: 0 0 91.666667%;
- max-width: 91.666667%;
-}
-
-.col-12 {
- -ms-flex: 0 0 100%;
- flex: 0 0 100%;
- max-width: 100%;
-}
-
-@include media(">=sm") {
- .col-sm {
- -ms-flex-preferred-size: 0;
- flex-basis: 0;
- -ms-flex-positive: 1;
- flex-grow: 1;
- max-width: 100%;
- }
- .col-sm-auto {
- -ms-flex: 0 0 auto;
- flex: 0 0 auto;
- width: auto;
- max-width: none;
- }
- .col-sm-1 {
- -ms-flex: 0 0 8.333333%;
- flex: 0 0 8.333333%;
- max-width: 8.333333%;
- }
- .col-sm-2 {
- -ms-flex: 0 0 16.666667%;
- flex: 0 0 16.666667%;
- max-width: 16.666667%;
- }
- .col-sm-3 {
- -ms-flex: 0 0 25%;
- flex: 0 0 25%;
- max-width: 25%;
- }
- .col-sm-4 {
- -ms-flex: 0 0 33.333333%;
- flex: 0 0 33.333333%;
- max-width: 33.333333%;
- }
- .col-sm-5 {
- -ms-flex: 0 0 41.666667%;
- flex: 0 0 41.666667%;
- max-width: 41.666667%;
- }
- .col-sm-6 {
- -ms-flex: 0 0 50%;
- flex: 0 0 50%;
- max-width: 50%;
- }
- .col-sm-7 {
- -ms-flex: 0 0 58.333333%;
- flex: 0 0 58.333333%;
- max-width: 58.333333%;
- }
- .col-sm-8 {
- -ms-flex: 0 0 66.666667%;
- flex: 0 0 66.666667%;
- max-width: 66.666667%;
- }
- .col-sm-9 {
- -ms-flex: 0 0 75%;
- flex: 0 0 75%;
- max-width: 75%;
- }
- .col-sm-10 {
- -ms-flex: 0 0 83.333333%;
- flex: 0 0 83.333333%;
- max-width: 83.333333%;
- }
- .col-sm-11 {
- -ms-flex: 0 0 91.666667%;
- flex: 0 0 91.666667%;
- max-width: 91.666667%;
- }
- .col-sm-12 {
- -ms-flex: 0 0 100%;
- flex: 0 0 100%;
- max-width: 100%;
- }
-}
-
-@include media(">=md") {
- .col-md {
- -ms-flex-preferred-size: 0;
- flex-basis: 0;
- -ms-flex-positive: 1;
- flex-grow: 1;
- max-width: 100%;
- }
- .col-md-auto {
- -ms-flex: 0 0 auto;
- flex: 0 0 auto;
- width: auto;
- max-width: none;
- }
- .col-md-1 {
- -ms-flex: 0 0 8.333333%;
- flex: 0 0 8.333333%;
- max-width: 8.333333%;
- }
- .col-md-2 {
- -ms-flex: 0 0 16.666667%;
- flex: 0 0 16.666667%;
- max-width: 16.666667%;
- }
- .col-md-3 {
- -ms-flex: 0 0 25%;
- flex: 0 0 25%;
- max-width: 25%;
- }
- .col-md-4 {
- -ms-flex: 0 0 33.333333%;
- flex: 0 0 33.333333%;
- max-width: 33.333333%;
- }
- .col-md-5 {
- -ms-flex: 0 0 41.666667%;
- flex: 0 0 41.666667%;
- max-width: 41.666667%;
- }
- .col-md-6 {
- -ms-flex: 0 0 50%;
- flex: 0 0 50%;
- max-width: 50%;
- }
- .col-md-7 {
- -ms-flex: 0 0 58.333333%;
- flex: 0 0 58.333333%;
- max-width: 58.333333%;
- }
- .col-md-8 {
- -ms-flex: 0 0 66.666667%;
- flex: 0 0 66.666667%;
- max-width: 66.666667%;
- }
- .col-md-9 {
- -ms-flex: 0 0 75%;
- flex: 0 0 75%;
- max-width: 75%;
- }
- .col-md-10 {
- -ms-flex: 0 0 83.333333%;
- flex: 0 0 83.333333%;
- max-width: 83.333333%;
- }
- .col-md-11 {
- -ms-flex: 0 0 91.666667%;
- flex: 0 0 91.666667%;
- max-width: 91.666667%;
- }
- .col-md-12 {
- -ms-flex: 0 0 100%;
- flex: 0 0 100%;
- max-width: 100%;
- }
-}
-
-@include media(">=lg") {
- .col-lg {
- -ms-flex-preferred-size: 0;
- flex-basis: 0;
- -ms-flex-positive: 1;
- flex-grow: 1;
- max-width: 100%;
- }
- .col-lg-auto {
- -ms-flex: 0 0 auto;
- flex: 0 0 auto;
- width: auto;
- max-width: none;
- }
- .col-lg-1 {
- -ms-flex: 0 0 8.333333%;
- flex: 0 0 8.333333%;
- max-width: 8.333333%;
- }
- .col-lg-2 {
- -ms-flex: 0 0 16.666667%;
- flex: 0 0 16.666667%;
- max-width: 16.666667%;
- }
- .col-lg-3 {
- -ms-flex: 0 0 25%;
- flex: 0 0 25%;
- max-width: 25%;
- }
- .col-lg-4 {
- -ms-flex: 0 0 33.333333%;
- flex: 0 0 33.333333%;
- max-width: 33.333333%;
- }
- .col-lg-5 {
- -ms-flex: 0 0 41.666667%;
- flex: 0 0 41.666667%;
- max-width: 41.666667%;
- }
- .col-lg-6 {
- -ms-flex: 0 0 50%;
- flex: 0 0 50%;
- max-width: 50%;
- }
- .col-lg-7 {
- -ms-flex: 0 0 58.333333%;
- flex: 0 0 58.333333%;
- max-width: 58.333333%;
- }
- .col-lg-8 {
- -ms-flex: 0 0 66.666667%;
- flex: 0 0 66.666667%;
- max-width: 66.666667%;
- }
- .col-lg-9 {
- -ms-flex: 0 0 75%;
- flex: 0 0 75%;
- max-width: 75%;
- }
- .col-lg-10 {
- -ms-flex: 0 0 83.333333%;
- flex: 0 0 83.333333%;
- max-width: 83.333333%;
- }
- .col-lg-11 {
- -ms-flex: 0 0 91.666667%;
- flex: 0 0 91.666667%;
- max-width: 91.666667%;
- }
- .col-lg-12 {
- -ms-flex: 0 0 100%;
- flex: 0 0 100%;
- max-width: 100%;
- }
-}
-
-@include media("xl") {
- .col-xl {
- -ms-flex-preferred-size: 0;
- flex-basis: 0;
- -ms-flex-positive: 1;
- flex-grow: 1;
- max-width: 100%;
- }
- .col-xl-auto {
- -ms-flex: 0 0 auto;
- flex: 0 0 auto;
- width: auto;
- max-width: none;
- }
- .col-xl-1 {
- -ms-flex: 0 0 8.333333%;
- flex: 0 0 8.333333%;
- max-width: 8.333333%;
- }
- .col-xl-2 {
- -ms-flex: 0 0 16.666667%;
- flex: 0 0 16.666667%;
- max-width: 16.666667%;
- }
- .col-xl-3 {
- -ms-flex: 0 0 25%;
- flex: 0 0 25%;
- max-width: 25%;
- }
- .col-xl-4 {
- -ms-flex: 0 0 33.333333%;
- flex: 0 0 33.333333%;
- max-width: 33.333333%;
- }
- .col-xl-5 {
- -ms-flex: 0 0 41.666667%;
- flex: 0 0 41.666667%;
- max-width: 41.666667%;
- }
- .col-xl-6 {
- -ms-flex: 0 0 50%;
- flex: 0 0 50%;
- max-width: 50%;
- }
- .col-xl-7 {
- -ms-flex: 0 0 58.333333%;
- flex: 0 0 58.333333%;
- max-width: 58.333333%;
- }
- .col-xl-8 {
- -ms-flex: 0 0 66.666667%;
- flex: 0 0 66.666667%;
- max-width: 66.666667%;
- }
- .col-xl-9 {
- -ms-flex: 0 0 75%;
- flex: 0 0 75%;
- max-width: 75%;
- }
- .col-xl-10 {
- -ms-flex: 0 0 83.333333%;
- flex: 0 0 83.333333%;
- max-width: 83.333333%;
- }
- .col-xl-11 {
- -ms-flex: 0 0 91.666667%;
- flex: 0 0 91.666667%;
- max-width: 91.666667%;
- }
- .col-xl-12 {
- -ms-flex: 0 0 100%;
- flex: 0 0 100%;
- max-width: 100%;
- }
-}
diff --git a/public/assets/styles/index.scss b/public/assets/styles/index.scss
index d0e3cb58c..46d1493af 100644
--- a/public/assets/styles/index.scss
+++ b/public/assets/styles/index.scss
@@ -1,5 +1,4 @@
@import "variables.scss";
-@import "main.scss";
-@import "tooltip.scss";
-@import "grid.scss";
+@import "reset.scss";
@import "utility.scss";
+@import "tooltip.scss";
diff --git a/public/assets/styles/main.scss b/public/assets/styles/main.scss
deleted file mode 100644
index ccb763dc0..000000000
--- a/public/assets/styles/main.scss
+++ /dev/null
@@ -1,459 +0,0 @@
-/*******************************
- Site
-*******************************/
-
-html,
-body {
- height: 100%;
- box-sizing: border-box;
- -ms-overflow-style: scrollbar;
-}
-
-*,
-*::before,
-*::after {
- box-sizing: inherit;
-}
-
-body {
- margin: 0px;
- padding: 0px;
- overflow-x: hidden;
- min-width: 320px;
- font-family: $font-site;
- color: $gray-900;
- font-size: $font-size;
-}
-
-button,
-input,
-optgroup,
-select,
-textarea {
- font-family: $font-site;
- font-size: $font-size;
-}
-
-/*******************************
- Headers
-*******************************/
-
-h1,
-h2,
-h3,
-h4,
-h5 {
- line-height: 120%;
- margin: 25px 0em 14px;
- font-weight: 600;
- padding: 0;
- font-weight: 600;
-}
-
-h1 {
- font-size: 28px;
-}
-h2 {
- font-size: 24px;
-}
-h3 {
- font-size: 20px;
-}
-h4 {
- font-size: 16px;
-}
-h5 {
- font-size: 14px;
-}
-h1:first-child,
-h2:first-child,
-h3:first-child,
-h4:first-child,
-h5:first-child {
- margin-top: 0;
-}
-h1:last-child,
-h2:last-child,
-h3:last-child,
-h4:last-child,
-h5:last-child {
- margin-bottom: 0;
-}
-
-/*******************************
- Text
-*******************************/
-
-p {
- margin: 0 0 14px;
- line-height: 1.5;
-}
-p:first-child {
- margin-top: 0;
-}
-p:last-child {
- margin-bottom: 0;
-}
-
-ul {
- li {
- line-height: 1.38;
- }
-}
-
-/*******************************
- Links
-*******************************/
-
-a {
- color: $link-color;
- text-decoration: none;
-}
-a:hover {
- color: darken($link-color, 10%);
- text-decoration: none;
-}
-
-/*******************************
- Stauses
-*******************************/
-
-.status-label {
- text-transform: uppercase;
- display: inline-block;
- line-height: 1;
- font-weight: 600;
- font-size: $font-size-mini;
-}
-
-.status-open {
- color: $gray-900;
-}
-
-.status-planned {
- color: #6435c9;
-}
-
-.status-started {
- color: #2185d0;
-}
-
-.status-completed {
- color: #21ba45;
-}
-
-.status-declined {
- color: #db2828;
-}
-
-.status-duplicate {
- color: #d6a100;
-}
-
-/*******************************
- Others
-*******************************/
-
-#root {
- height: 100%;
- display: flex;
- flex-direction: column;
-}
-
-.center {
- text-align: center;
-}
-
-*:focus {
- outline: 0;
- box-shadow: 0 0 0 3px $blue-300;
- transition: all 0.3s ease;
-}
-
-[type="reset"],
-[type="submit"],
-button,
-html [type="button"] {
- -webkit-appearance: button;
- appearance: button;
-}
-
-.page {
- flex: 1 0 auto;
- margin-top: 10px;
- padding-bottom: 20px;
-}
-
-.page::after {
- content: "";
- clear: both;
- display: table;
-}
-
-noscript {
- margin-top: 20px;
-}
-
-code {
- font-family: $font-code;
-}
-
-body,
-h1,
-h2,
-h3,
-h4,
-h5,
-input {
- text-rendering: optimizeLegibility;
- -webkit-font-smoothing: antialiased;
-}
-
-.info {
- font-size: 90%;
- font-weight: 400;
- color: $gray-700;
-}
-
-.right {
- float: right;
- vertical-align: middle;
-}
-
-.center {
- text-align: center;
-}
-
-svg.icon {
- display: inline-block;
- opacity: 1;
- width: 1.18em;
- vertical-align: middle;
-}
-
-.clickable {
- cursor: pointer;
-}
-
-.subtitle {
- font-size: $font-size-mini;
- margin: 10px 0 5px 0;
- font-weight: 600;
- letter-spacing: 0.3px;
- text-transform: uppercase;
- color: $gray-500;
- display: block;
- &.active {
- cursor: pointer;
- &:hover {
- color: $main-color;
- }
- svg.icon {
- float: right;
- }
- }
-
- &:first-child {
- margin-top: 0;
- }
-
- &:last-child {
- margin-bottom: 0;
- }
-}
-
-.markdown-body {
- overflow-wrap: break-word;
- word-break: break-word;
-
- blockquote {
- padding: 0 8px;
- color: $gray-900;
- border-left: 4px solid $gray-300;
- margin: 5px 0;
- }
-
- ul,
- ol {
- padding-left: 30px;
- margin: 0 0 14px;
-
- &:first-child {
- margin-top: 0;
- }
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- img {
- max-width: 100%;
- }
-
- pre {
- overflow-x: scroll;
- padding: 16px;
- line-height: 1.45;
- background-color: #f6f8fa;
- border-radius: 3px;
- code {
- display: inline;
- max-width: auto;
- padding: 0;
- margin: 0;
- overflow: visible;
- line-height: inherit;
- word-wrap: normal;
- background-color: transparent;
- border: 0;
- }
- }
- code {
- padding: 0.2em;
- font-size: 85%;
- margin: 0;
- background-color: rgba(27, 31, 35, 0.05);
- border-radius: 3px;
- }
-}
-
-.inline.dropdown {
- > .text {
- border-bottom: 1px dashed #9e9e9e;
- }
-}
-
-.basic.red.label {
- width: 100%;
- color: #ef7878 !important;
- border-color: #ef7878 !important;
-
- &.below {
- border-left: none;
- border-right: none;
- border-top: none;
- }
-
- &.above {
- border-left: none;
- border-right: none;
- border-bottom: none;
- }
-}
-
-.failure-page {
- height: 60%;
- text-align: center;
- margin-top: 100px;
- max-width: 800px !important;
- p {
- font-size: 130%;
- line-height: 30px;
- }
- h1 {
- font-size: 180%;
- color: #3b4450;
- }
- img {
- max-height: 100px;
- max-width: 100px;
- }
- .l-browser-list {
- text-align: left;
- max-width: 500px;
- margin: 0 auto;
- a {
- display: block;
- }
- .browser-logo {
- margin-right: 10px;
- vertical-align: middle;
- width: 48px;
- height: 48px;
- }
- .browser-name {
- font-weight: bold;
- }
- .browser-download {
- float: right;
- line-height: 48px;
- }
- }
-}
-
-.legal-page {
- max-width: 800px !important;
- padding: 50px 0;
- h1 {
- margin-bottom: 30px;
- }
- p {
- line-height: 150%;
- }
-
- table {
- tr {
- th {
- padding: 5px;
- border-bottom: 1px solid $gray-400;
- background-color: $gray-200;
- }
- td {
- border-bottom: 1px solid $gray-400;
- padding: 5px;
- }
- }
- }
-}
-
-.c-divider {
- display: table;
- font-weight: 700;
- margin: 15px 0px;
-
- &::before,
- &::after {
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC);
- content: "";
- display: table-cell;
- position: relative;
- top: 50%;
- width: 50%;
- background-repeat: no-repeat;
- }
- &::before {
- background-position: right 1em top 50%;
- }
- &::after {
- background-position: left 1em top 50%;
- }
-}
-
-.c-toast {
- border-radius: 5px !important;
-}
-
-@include media("sm") {
- .hidden-sm {
- display: none;
- }
-}
-
-@include media("md") {
- .hidden-md {
- display: none;
- }
-}
-
-@include media("lg") {
- .hidden-lg {
- display: none;
- }
-}
-
-@include media("xl") {
- .hidden-xl {
- display: none;
- }
-}
diff --git a/public/assets/styles/reset.scss b/public/assets/styles/reset.scss
new file mode 100644
index 000000000..70d2d6ffc
--- /dev/null
+++ b/public/assets/styles/reset.scss
@@ -0,0 +1,70 @@
+html,
+body {
+ height: 100%;
+ box-sizing: border-box;
+}
+
+*,
+*::before,
+*::after {
+ box-sizing: inherit;
+}
+
+body {
+ margin: 0px;
+ padding: 0px;
+ overflow-x: hidden;
+ min-width: 320px;
+ color: get("colors.gray.900");
+ font-size: get("font.size.base");
+ font-family: $font-base;
+}
+
+code {
+ font-family: $font-code;
+}
+
+body,
+h1,
+h2,
+h3,
+h4,
+h5,
+input {
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+pre {
+ margin: 0;
+}
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ margin: 0;
+ font-family: $font-base;
+ font-size: get("font.size.base");
+}
+
+a {
+ color: get("colors.gray.900");
+ text-decoration: none;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ margin: 0;
+ font-weight: 400;
+ font-size: get("font.size.base");
+}
+
+img {
+ height: 100%;
+}
diff --git a/public/assets/styles/tooltip.scss b/public/assets/styles/tooltip.scss
index 3d012aa6d..07a310526 100644
--- a/public/assets/styles/tooltip.scss
+++ b/public/assets/styles/tooltip.scss
@@ -1,12 +1,12 @@
-[data-tooltip]{
+[data-tooltip] {
cursor: pointer;
position: relative;
}
[data-tooltip]::before {
- background-color: $gray-700;
- color: $white;
- font-size: $font-size-tiny;
+ background-color: get("colors.gray.700");
+ color: get("colors.white");
+ font-size: 11px;
padding: 4px 6px;
height: max-content;
width: max-content;
@@ -24,4 +24,4 @@
[data-tooltip]:hover:before {
display: block;
transform: translate(-50%, 100%) scale(1);
-}
\ No newline at end of file
+}
diff --git a/public/assets/styles/utility.scss b/public/assets/styles/utility.scss
index b8c87ed03..ab5d5bd33 100644
--- a/public/assets/styles/utility.scss
+++ b/public/assets/styles/utility.scss
@@ -1,9 +1,8 @@
-$space: 5px;
-
-.mb-1 {
- margin-bottom: $space;
-}
-
-.mb-2 {
- margin-bottom: $space * 2;
-}
+@import "./utility/display.scss";
+@import "./utility/colors.scss";
+@import "./utility/grid.scss";
+@import "./utility/sizing.scss";
+@import "./utility/text.scss";
+@import "./utility/page.scss";
+@import "./utility/outline.scss";
+@import "./utility/spacing.scss";
diff --git a/public/assets/styles/utility/colors.scss b/public/assets/styles/utility/colors.scss
new file mode 100644
index 000000000..c1fe079d3
--- /dev/null
+++ b/public/assets/styles/utility/colors.scss
@@ -0,0 +1,31 @@
+@each $name, $shades in $colors {
+ @if type-of($shades) == "map" {
+ @each $shade, $color in $shades {
+ .text-#{$name}-#{$shade} {
+ color: #{$color};
+ }
+ .hover\:text-#{$name}-#{$shade}:hover {
+ color: #{$color};
+ }
+ .bg-#{$name}-#{$shade} {
+ background-color: #{$color};
+ }
+ .hover\:bg-#{$name}-#{$shade}:hover {
+ background-color: #{$color};
+ }
+ .border-#{$name}-#{$shade} {
+ border-color: #{$color};
+ }
+ }
+ } @else {
+ .text-#{$name} {
+ color: #{$shades};
+ }
+ .bg-#{$name} {
+ background-color: #{$shades};
+ }
+ .border-#{$name} {
+ border-color: #{$shades};
+ }
+ }
+}
diff --git a/public/assets/styles/utility/display.scss b/public/assets/styles/utility/display.scss
new file mode 100644
index 000000000..37042f9e4
--- /dev/null
+++ b/public/assets/styles/utility/display.scss
@@ -0,0 +1,182 @@
+.hidden {
+ display: none;
+}
+
+.block {
+ display: block;
+}
+
+.relative {
+ position: relative;
+}
+
+.inline-block {
+ display: inline-block;
+}
+
+@each $media in $medias {
+ @include media(#{$media}) {
+ .#{$media}\:hidden {
+ display: none;
+ }
+ .#{$media}\:block {
+ display: block;
+ }
+ }
+}
+
+.container {
+ position: relative;
+ display: block;
+ max-width: 100%;
+}
+
+@include media("sm") {
+ .container {
+ width: 100vw;
+ margin-left: auto;
+ margin-right: auto;
+ }
+}
+
+@include media("md") {
+ .container {
+ width: 720px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+}
+
+@include media("lg") {
+ .container {
+ width: 960px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+}
+
+@include media("xl") {
+ .container {
+ width: 1140px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+}
+
+.flex {
+ display: flex;
+}
+
+.flex-y {
+ flex-direction: column;
+}
+
+.flex-x {
+ flex-direction: row;
+}
+
+.flex-grow {
+ flex-grow: 1;
+}
+
+.flex-wrap {
+ flex-wrap: wrap;
+}
+
+.flex-items-center {
+ align-items: center;
+}
+
+.flex-items-baseline {
+ align-items: baseline;
+}
+
+.justify-between {
+ justify-content: space-between;
+}
+
+.justify-evenly {
+ justify-content: space-evenly;
+}
+
+@each $i in 0, 1, 2, 4, 6, 8 {
+ .flex-x.flex--spacing-#{$i} > * + * {
+ margin-left: spacing($i);
+ }
+ .flex-y.flex--spacing-#{$i} > * + * {
+ margin-top: spacing($i);
+ }
+}
+
+@each $i in 2, 4 {
+ .flex-x.flex--divide-#{$i} > *:first-child {
+ padding-right: spacing($i);
+ }
+ .flex-x.flex--divide-#{$i} > * + * {
+ padding-right: spacing($i);
+ padding-left: spacing($i);
+ border: 0 solid get("colors.gray.100");
+ border-left-width: 1px;
+ }
+ .flex-x.flex--divide-#{$i} > *:last-child {
+ padding-right: 0;
+ }
+ .flex-y.flex--divide-#{$i} > *:first-child {
+ padding-bottom: spacing($i);
+ }
+ .flex-y.flex--divide-#{$i} > * + * {
+ padding-top: spacing($i);
+ padding-bottom: spacing($i);
+ border: 0 solid get("colors.gray.100");
+ border-top-width: 1px;
+ }
+ .flex-y.flex--divide-#{$i} > *:last-child {
+ padding-bottom: 0;
+ }
+}
+
+.shadow-sm {
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
+}
+.shadow {
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
+}
+.shadow-md {
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
+}
+.shadow-lg {
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
+}
+
+.rounded {
+ border-radius: sizing(1);
+}
+
+.rounded-md {
+ border-radius: sizing(2);
+}
+
+.rounded-full {
+ border-radius: 999px;
+}
+
+.invisible {
+ visibility: hidden;
+}
+
+.overflow-scroll {
+ overflow: scroll;
+}
+
+.border {
+ border: 1px solid transparent;
+}
+
+.border-2 {
+ border: 2px solid transparent;
+}
+
+.clickable {
+ cursor: pointer;
+ pointer-events: inherit;
+}
diff --git a/public/assets/styles/utility/grid.scss b/public/assets/styles/utility/grid.scss
new file mode 100644
index 000000000..67e2e1ad1
--- /dev/null
+++ b/public/assets/styles/utility/grid.scss
@@ -0,0 +1,38 @@
+.grid {
+ display: grid;
+}
+
+.grid-cols-1 {
+ grid-template-columns: repeat(1, minmax(0, 1fr));
+}
+
+.grid-cols-2 {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+}
+
+.grid-cols-3 {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+}
+
+.grid-cols-4 {
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+}
+
+@include media("lg") {
+ .lg\:grid-cols-3 {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ }
+ .lg\:grid-cols-5 {
+ grid-template-columns: repeat(5, minmax(0, 1fr));
+ }
+}
+
+.col-span-3 {
+ grid-column: span 3 / span 3;
+}
+
+@for $i from 0 through 8 {
+ .gap-#{$i} {
+ gap: spacing($i);
+ }
+}
diff --git a/public/assets/styles/utility/outline.scss b/public/assets/styles/utility/outline.scss
new file mode 100644
index 000000000..07541e806
--- /dev/null
+++ b/public/assets/styles/utility/outline.scss
@@ -0,0 +1,6 @@
+*:focus {
+ outline: 0;
+ box-shadow: rgb(255, 255, 255) 0px 0px 0px 0px, get("colors.primary.light") 0px 0px 0px 1px, rgba(0, 0, 0, 0) 0px 0px 0px 0px !important;
+ border-color: get("colors.primary.light") !important;
+ transition: all 0.3s ease;
+}
diff --git a/public/assets/styles/utility/page.scss b/public/assets/styles/utility/page.scss
new file mode 100644
index 000000000..d8c8b9fb8
--- /dev/null
+++ b/public/assets/styles/utility/page.scss
@@ -0,0 +1,18 @@
+#root {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.page {
+ padding-top: spacing(4);
+ padding-bottom: spacing(4);
+}
+
+@include media("sm") {
+ .page {
+ width: calc(100vw - 20px);
+ margin-left: 10px;
+ margin-right: 10px;
+ }
+}
diff --git a/public/assets/styles/utility/sizing.scss b/public/assets/styles/utility/sizing.scss
new file mode 100644
index 000000000..bb4286bb5
--- /dev/null
+++ b/public/assets/styles/utility/sizing.scss
@@ -0,0 +1,24 @@
+@for $i from 0 through 20 {
+ .w-#{$i} {
+ width: sizing($i);
+ }
+ .h-#{$i} {
+ height: sizing($i);
+ }
+ .w-min-#{$i} {
+ min-width: sizing($i);
+ }
+}
+
+@for $i from 0 through 20 {
+ .w-max-#{$i}xl {
+ max-width: sizing($i * 20);
+ }
+ .h-max-#{$i}xl {
+ max-height: sizing($i * 20);
+ }
+}
+
+.w-full {
+ width: 100%;
+}
diff --git a/public/assets/styles/utility/spacing.scss b/public/assets/styles/utility/spacing.scss
new file mode 100644
index 000000000..22b13341d
--- /dev/null
+++ b/public/assets/styles/utility/spacing.scss
@@ -0,0 +1,56 @@
+.mx-auto {
+ margin-right: auto;
+ margin-left: auto;
+}
+
+@for $i from 0 through 9 {
+ // Margin
+ .m-#{$i} {
+ margin: spacing($i);
+ }
+ .mb-#{$i} {
+ margin-bottom: spacing($i);
+ }
+ .mt-#{$i} {
+ margin-top: spacing($i);
+ }
+ .ml-#{$i} {
+ margin-left: spacing($i);
+ }
+ .mr-#{$i} {
+ margin-right: spacing($i);
+ }
+ .mx-#{$i} {
+ margin-left: spacing($i);
+ margin-right: spacing($i);
+ }
+ .my-#{$i} {
+ margin-bottom: spacing($i);
+ margin-top: spacing($i);
+ }
+
+ // Padding
+ .p-#{$i} {
+ padding: spacing($i);
+ }
+ .pb-#{$i} {
+ padding-bottom: spacing($i);
+ }
+ .pt-#{$i} {
+ padding-top: spacing($i);
+ }
+ .pl-#{$i} {
+ padding-left: spacing($i);
+ }
+ .pr-#{$i} {
+ padding-right: spacing($i);
+ }
+ .px-#{$i} {
+ padding-left: spacing($i);
+ padding-right: spacing($i);
+ }
+ .py-#{$i} {
+ padding-bottom: spacing($i);
+ padding-top: spacing($i);
+ }
+}
diff --git a/public/assets/styles/utility/text.scss b/public/assets/styles/utility/text.scss
new file mode 100644
index 000000000..bbafbc6f6
--- /dev/null
+++ b/public/assets/styles/utility/text.scss
@@ -0,0 +1,91 @@
+p,
+pre {
+ margin: 0 0 14px;
+ line-height: 1.5;
+}
+
+p:last-child,
+pre:last-child {
+ margin-bottom: 0;
+}
+
+.text-display2 {
+ font-size: get("font.size.2xl");
+ font-weight: get("font.weight.bold");
+ letter-spacing: -1px;
+}
+
+.text-display {
+ font-size: get("font.size.xl");
+ font-weight: get("font.weight.semibold");
+}
+
+.text-title {
+ font-size: get("font.size.lg");
+ font-weight: get("font.weight.medium");
+}
+
+.text-body {
+ font-size: get("font.size.base");
+}
+
+.text-sm {
+ font-size: get("font.size.sm");
+}
+
+.text-category {
+ font-size: get("font.size.xs");
+ font-weight: get("font.weight.semibold");
+ color: get("colors.gray.600");
+ text-transform: uppercase;
+}
+
+.text-muted {
+ font-size: get("font.size.xs");
+ color: get("colors.gray.700");
+}
+
+.text-link {
+ color: get("colors.blue.600");
+}
+
+.text-link:hover {
+ color: get("colors.blue.800");
+ text-decoration: underline;
+}
+
+.text-sm {
+ font-size: get("font.size.sm");
+}
+
+.text-xs {
+ font-size: get("font.size.xs");
+}
+
+.text-2xs {
+ font-size: get("font.size.2xs");
+}
+
+.hover\:underline:hover {
+ text-decoration: underline;
+}
+
+.text-center {
+ text-align: center;
+}
+
+.text-medium {
+ font-weight: get("font.weight.medium");
+}
+
+.text-semibold {
+ font-weight: get("font.weight.semibold");
+}
+
+.text-bold {
+ font-weight: get("font.weight.bold");
+}
+
+.uppercase {
+ text-transform: uppercase;
+}
diff --git a/public/assets/styles/variables.scss b/public/assets/styles/variables.scss
index 156387c4f..90e73dd58 100644
--- a/public/assets/styles/variables.scss
+++ b/public/assets/styles/variables.scss
@@ -1,124 +1,24 @@
-$font-size-micro: 9px;
-$font-size-mini: 11px;
-$font-size-tiny: 12px;
-$font-size-small: 13px;
-$font-size: 14px;
-$font-size-large: 16px;
-$font-size-big: 18px;
-$font-size-xlarge: 22px;
-
-$font-site: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Helvetica Neue", Helvetica, sans-serif;
-$font-code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
-
-$white: #fff;
-
-$gray-900: #111827;
-$gray-700: #374151;
-$gray-500: #6b7280;
-$gray-400: #9ca3af;
-$gray-300: #d1d5db;
-$gray-200: #e5e7eb;
-$gray-100: #f3f4f6;
-$gray-50: #f9fafb;
-
-$gray-scale: (
- 900: $gray-900,
- 700: $gray-700,
- 500: $gray-500,
- 400: $gray-400,
- 300: $gray-300,
- 200: $gray-200,
- 100: $gray-100,
- 50: $gray-50,
-);
-
-$green-900: #064e3b;
-$green-700: #047857;
-$green-500: #10b981;
-$green-400: #34d399;
-$green-300: #6ee7b7;
-$green-200: #a7f3d0;
-$green-100: #d1fae5;
-$green-50: #ecfdf5;
-
-$green-scale: (
- 900: $green-900,
- 700: $green-700,
- 500: $green-500,
- 400: $green-400,
- 300: $green-300,
- 200: $green-200,
- 100: $green-100,
- 50: $green-50,
-);
-
-$yellow-900: #78350f;
-$yellow-700: #b45309;
-$yellow-500: #f59e0b;
-$yellow-400: #fbbf24;
-$yellow-300: #fcd34d;
-$yellow-200: #fde68a;
-$yellow-100: #fef3c7;
-$yellow-50: #fffbeb;
-
-$yellow-scale: (
- 900: $yellow-900,
- 700: $yellow-700,
- 500: $yellow-500,
- 400: $yellow-400,
- 300: $yellow-300,
- 200: $yellow-200,
- 100: $yellow-100,
- 50: $yellow-50,
-);
-
-$red-900: #7f1d1d;
-$red-700: #b91c1c;
-$red-500: #ef4444;
-$red-400: #f87171;
-$red-300: #fca5a5;
-$red-200: #fecaca;
-$red-100: #fee2e2;
-$red-50: #fef2f2;
-
-$red-scale: (
- 900: $red-900,
- 700: $red-700,
- 500: $red-500,
- 400: $red-400,
- 300: $red-300,
- 200: $red-200,
- 100: $red-100,
- 50: $red-50,
-);
-
-$blue-900: #1e3a8a;
-$blue-700: #1d4ed8;
-$blue-500: #3b82f6;
-$blue-400: #60a5fa;
-$blue-300: #93c5fd;
-$blue-200: #bfdbfe;
-$blue-100: #dbeafe;
-$blue-50: #eff6ff;
-
-$blue-scale: (
- 900: $blue-900,
- 700: $blue-700,
- 500: $blue-500,
- 400: $blue-400,
- 300: $blue-300,
- 200: $blue-200,
- 100: $blue-100,
- 50: $blue-50,
+@import "_functions";
+@import "_colors";
+@import "_spacing";
+@import "_sizing";
+@import "_text";
+
+$all: (
+ colors: $colors,
+ font: $font,
+ border: (
+ radius: (
+ small: 4px,
+ medium: 6px,
+ large: 8px,
+ full: 999px,
+ ),
+ ),
);
-$main-color: #4338ca;
-$admin-color: #4338ca;
-$link-color: #3b82f6;
-
-$orange: #f59e0b;
-
// Queries
+$medias: "sm", "md", "lg", "xl";
$sm-width: 576px;
$md-width: 768px;
$lg-width: 992px;
@@ -126,34 +26,14 @@ $xl-width: 1200px;
@mixin media($media) {
@if $media == "sm" {
- @media only screen and (max-width: #{$md-width - 0.1px}) {
- @content;
- }
- } @else if $media == ">=sm" {
- @media only screen and (min-width: #{$sm-width}) {
- @content;
- }
- } @else if $media == "<=md" {
- @media only screen and (max-width: #{$lg-width - 0.1px}) {
+ @media only screen and (max-width: #{$md-width}) {
@content;
}
} @else if $media == "md" {
- @media only screen and (min-width: #{$md-width}) and (max-width: #{$lg-width - 0.1px}) {
- @content;
- }
- } @else if $media == ">=md" {
@media only screen and (min-width: #{$md-width}) {
@content;
}
- } @else if $media == "<lg" {
- @media only screen and (max-width: #{$xl-width - 0.1px}) {
- @content;
- }
} @else if $media == "lg" {
- @media only screen and (min-width: #{$lg-width}) and (max-width: #{$xl-width - 0.1px}) {
- @content;
- }
- } @else if $media == ">=lg" {
@media only screen and (min-width: #{$lg-width}) {
@content;
}
@@ -164,19 +44,9 @@ $xl-width: 1200px;
}
}
-@function textColorFor($color) {
- @if (lightness($color) > 60) {
- @return $gray-900; // Lighter background, return dark color
- } @else {
- @return $gray-100; // Darker background, return light color
- }
-}
-
@mixin disabled() {
cursor: not-allowed;
opacity: 0.45 !important;
background-image: none !important;
- -webkit-box-shadow: none !important;
- box-shadow: none !important;
pointer-events: none !important;
}
diff --git a/public/components/Header.tsx b/public/components/Header.tsx
new file mode 100644
index 000000000..a3cfa690f
--- /dev/null
+++ b/public/components/Header.tsx
@@ -0,0 +1,46 @@
+import React, { useState } from "react"
+import { SignInModal, TenantLogo, DevBanner, NotificationIndicator, UserMenu } from "@fider/components"
+import { useFider } from "@fider/hooks"
+import { HStack } from "./layout"
+
+export const Header = () => {
+ const fider = useFider()
+ const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)
+
+ const showModal = (e: React.MouseEvent) => {
+ e.preventDefault()
+ setIsSignInModalOpen(true)
+ }
+
+ const hideModal = () => setIsSignInModalOpen(false)
+
+ return (
+ <>
+ <DevBanner />
+ <div id="c-header">
+ <SignInModal isOpen={isSignInModalOpen} onClose={hideModal} />
+ <HStack className="c-menu shadow p-2 w-full">
+ <div className="container">
+ <HStack justify="between">
+ <a href="/" className="flex flex-x flex-items-center flex--spacing-2 h-8">
+ <TenantLogo size={100} />
+ <h1 className="text-title">{fider.session.tenant.name}</h1>
+ </a>
+ {fider.session.isAuthenticated && (
+ <HStack spacing={2}>
+ <NotificationIndicator />
+ <UserMenu />
+ </HStack>
+ )}
+ {!fider.session.isAuthenticated && (
+ <a href="#" className="uppercase text-sm" onClick={showModal}>
+ Sign in
+ </a>
+ )}
+ </HStack>
+ </div>
+ </HStack>
+ </div>
+ </>
+ )
+}
diff --git a/public/components/NotificationIndicator.scss b/public/components/NotificationIndicator.scss
new file mode 100644
index 000000000..d36e2da63
--- /dev/null
+++ b/public/components/NotificationIndicator.scss
@@ -0,0 +1,15 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-notification-indicator {
+ position: relative;
+
+ .c-notification-indicator-unread-counter {
+ position: absolute;
+ top: 2px;
+ right: 2px;
+ background-color: get("colors.red.500");
+ height: sizing(2);
+ width: sizing(2);
+ border-radius: 100%;
+ }
+}
diff --git a/public/components/NotificationIndicator.tsx b/public/components/NotificationIndicator.tsx
new file mode 100644
index 000000000..9a547ee44
--- /dev/null
+++ b/public/components/NotificationIndicator.tsx
@@ -0,0 +1,29 @@
+import "./NotificationIndicator.scss"
+
+import React, { useEffect, useState } from "react"
+import IconBell from "@fider/assets/images/heroicons-bell.svg"
+import { useFider } from "@fider/hooks"
+import { actions } from "@fider/services"
+import { Icon } from "./common"
+
+export const NotificationIndicator = () => {
+ const fider = useFider()
+ const [unreadNotifications, setUnreadNotifications] = useState(0)
+
+ useEffect(() => {
+ if (fider.session.isAuthenticated) {
+ actions.getTotalUnreadNotifications().then((result) => {
+ if (result.ok && result.data > 0) {
+ setUnreadNotifications(result.data)
+ }
+ })
+ }
+ }, [fider.session.isAuthenticated])
+
+ return (
+ <a href="/notifications" className="c-notification-indicator">
+ <Icon sprite={IconBell} className="h-6 text-gray-500" />
+ {unreadNotifications > 0 && <div className="c-notification-indicator-unread-counter" />}
+ </a>
+ )
+}
diff --git a/public/components/ShowPostResponse.scss b/public/components/ShowPostResponse.scss
deleted file mode 100644
index f980fb4e0..000000000
--- a/public/components/ShowPostResponse.scss
+++ /dev/null
@@ -1,15 +0,0 @@
-.c-segment.l-response {
- padding: 8px;
-
- .content {
- margin-top: 5px;
- }
-
- .c-avatar {
- margin-left: 3px;
- }
-
- span.date {
- margin-left: 3px;
- }
-}
diff --git a/public/components/ShowPostResponse.tsx b/public/components/ShowPostResponse.tsx
index 79122bad4..8769d04cc 100644
--- a/public/components/ShowPostResponse.tsx
+++ b/public/components/ShowPostResponse.tsx
@@ -1,16 +1,7 @@
-import "./ShowPostResponse.scss"
-
import React from "react"
import { PostResponse, PostStatus } from "@fider/models"
-import { Avatar, MultiLineText, UserName, Segment } from "@fider/components/common"
-
-interface ShowPostStatusProps {
- status: PostStatus
-}
-
-export const ShowPostStatus = (props: ShowPostStatusProps) => {
- return <span className={`status-label status-${props.status.value}`}>{props.status.title}</span>
-}
+import { Markdown, UserName, ShowPostStatus } from "@fider/components"
+import { HStack } from "./layout"
const DuplicateDetails = (props: PostResponseProps): JSX.Element | null => {
if (!props.response) {
@@ -24,7 +15,10 @@ const DuplicateDetails = (props: PostResponseProps): JSX.Element | null => {
return (
<div className="content">
- <span>&#8618;</span> <a href={`/posts/${original.number}/${original.slug}`}>{original.title}</a>
+ <span>&#8618;</span>{" "}
+ <a className="text-link" href={`/posts/${original.number}/${original.slug}`}>
+ {original.title}
+ </a>
</div>
)
}
@@ -32,7 +26,6 @@ const DuplicateDetails = (props: PostResponseProps): JSX.Element | null => {
interface PostResponseProps {
status: string
response: PostResponse | null
- showUser: boolean
}
const StatusDetails = (props: PostResponseProps): JSX.Element | null => {
@@ -42,7 +35,7 @@ const StatusDetails = (props: PostResponseProps): JSX.Element | null => {
return (
<div className="content">
- <MultiLineText text={props.response.text} style="full" />
+ <Markdown text={props.response.text} style="full" />
</div>
)
}
@@ -52,15 +45,15 @@ export const ShowPostResponse = (props: PostResponseProps): JSX.Element | null =
if (props.response && (status.show || props.response.text)) {
return (
- <Segment className="l-response">
- {status.show && <ShowPostStatus status={status} />}
- {props.showUser && (
- <>
- <Avatar user={props.response.user} size="small" /> <UserName user={props.response.user} />
- </>
- )}
+ <div className="p-2 shadow rounded">
+ <HStack>
+ {status.show && <ShowPostStatus status={status} />}
+ <span className="text-xs">
+ &middot; <UserName user={props.response.user} />
+ </span>
+ </HStack>
{status === PostStatus.Duplicate ? DuplicateDetails(props) : StatusDetails(props)}
- </Segment>
+ </div>
)
}
diff --git a/public/components/ShowPostStatus.scss b/public/components/ShowPostStatus.scss
new file mode 100644
index 000000000..8702d7022
--- /dev/null
+++ b/public/components/ShowPostStatus.scss
@@ -0,0 +1,31 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-status-label {
+ text-transform: uppercase;
+ font-weight: 600;
+ font-size: 11px;
+
+ &--open {
+ color: get("colors.gray.900");
+ }
+
+ &--planned {
+ color: #6435c9;
+ }
+
+ &--started {
+ color: #2185d0;
+ }
+
+ &--completed {
+ color: #21ba45;
+ }
+
+ &--declined {
+ color: #db2828;
+ }
+
+ &--duplicate {
+ color: #d6a100;
+ }
+}
diff --git a/public/components/ShowPostStatus.tsx b/public/components/ShowPostStatus.tsx
new file mode 100644
index 000000000..baa1bba3c
--- /dev/null
+++ b/public/components/ShowPostStatus.tsx
@@ -0,0 +1,12 @@
+import "./ShowPostStatus.scss"
+
+import React from "react"
+import { PostStatus } from "@fider/models"
+
+interface ShowPostStatusProps {
+ status: PostStatus
+}
+
+export const ShowPostStatus = (props: ShowPostStatusProps) => {
+ return <span className={`c-status-label c-status-label--${props.status.value}`}>{props.status.title}</span>
+}
diff --git a/public/components/ShowTag.scss b/public/components/ShowTag.scss
index 01cebb99d..77c4a5d76 100644
--- a/public/components/ShowTag.scss
+++ b/public/components/ShowTag.scss
@@ -4,8 +4,8 @@
display: inline-flex;
justify-content: center;
align-items: center;
- font-size: $font-size-tiny;
- color: $gray-900;
+ font-size: 11px;
+ color: get("colors.gray.900");
font-weight: 500;
border-radius: 10px;
line-height: 18px;
@@ -17,12 +17,7 @@
margin-right: 2px;
}
- &:last-child {
- margin-top: 0;
- margin-bottom: 0;
- }
-
- &.m-circular {
+ &--circular {
min-height: 0;
min-width: 0;
overflow: hidden;
diff --git a/public/components/ShowTag.tsx b/public/components/ShowTag.tsx
index 322240558..a1ba20bc8 100644
--- a/public/components/ShowTag.tsx
+++ b/public/components/ShowTag.tsx
@@ -30,7 +30,7 @@ const textColor = (color: string) => {
export const ShowTag = (props: TagProps) => {
const className = classSet({
"c-tag": true,
- "m-circular": props.circular === true,
+ "c-tag--circular": props.circular === true,
})
return (
diff --git a/public/components/SignInModal.tsx b/public/components/SignInModal.tsx
index 28e32bb01..c81569581 100644
--- a/public/components/SignInModal.tsx
+++ b/public/components/SignInModal.tsx
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from "react"
-import { Modal, SignInControl, LegalFooter } from "@fider/components/common"
+import { Modal, SignInControl, LegalFooter } from "@fider/components"
+import { Button } from "./common"
interface SignInModalProps {
isOpen: boolean
@@ -30,9 +31,9 @@ export const SignInModal: React.StatelessComponent<SignInModalProps> = (props) =
We have just sent a confirmation link to <b>{confirmationAddress}</b>. <br /> Click the link and you’ll be signed in.
</p>
<p>
- <a href="#" onClick={closeModal}>
+ <Button variant="tertiary" onClick={closeModal}>
OK
- </a>
+ </Button>
</p>
</>
) : (
diff --git a/public/components/UserMenu.tsx b/public/components/UserMenu.tsx
new file mode 100644
index 000000000..a6a5ed620
--- /dev/null
+++ b/public/components/UserMenu.tsx
@@ -0,0 +1,26 @@
+import React from "react"
+import { useFider } from "@fider/hooks"
+import { Avatar, Dropdown } from "./common"
+
+export const UserMenu = () => {
+ const fider = useFider()
+
+ return (
+ <div className="c-menu-user">
+ <Dropdown position="left" renderHandle={<Avatar user={fider.session.user} />}>
+ <div className="p-2 text-medium uppercase">{fider.session.user.name}</div>
+ <Dropdown.ListItem href="/settings">My Settings</Dropdown.ListItem>
+ <Dropdown.Divider />
+
+ {fider.session.user.isCollaborator && (
+ <>
+ <div className="p-2 text-medium uppercase">Administration</div>
+ <Dropdown.ListItem href="/admin">Site Settings</Dropdown.ListItem>
+ <Dropdown.Divider />
+ </>
+ )}
+ <Dropdown.ListItem href="/signout?redirect=/">Sign out</Dropdown.ListItem>
+ </Dropdown>
+ </div>
+ )
+}
diff --git a/public/components/VoteCounter.scss b/public/components/VoteCounter.scss
index 09849a2f2..a21e7fe1d 100644
--- a/public/components/VoteCounter.scss
+++ b/public/components/VoteCounter.scss
@@ -1,44 +1,36 @@
@import "~@fider/assets/styles/variables.scss";
.c-vote-counter {
- margin-right: 10px;
-
- button,
- button.m-voted,
- button.m-disabled {
- font-size: 18px;
+ &__button {
+ font-size: get("font.size.lg");
border: none;
- width: 45px;
- font-weight: 700;
+ width: sizing(11);
+ font-weight: get("font.weight.bold");
cursor: pointer;
background-color: transparent;
text-align: center;
margin: 0 auto;
padding: 0 0;
- color: $gray-700;
+ color: get("colors.gray.700");
+ display: flex;
+ flex-direction: column;
+ align-items: center;
- .icon {
- color: $gray-400;
- margin-bottom: -3px;
+ svg {
+ color: get("colors.gray.400");
+ margin-bottom: -2px;
}
- }
-
- button.m-disabled {
- @include disabled();
- cursor: not-allowed;
- }
- button.m-voted,
- button.no-touch:hover {
- color: $main-color;
-
- .icon {
- color: $main-color;
+ &--voted,
+ &:hover {
+ color: get("colors.primary.base");
+ svg {
+ color: get("colors.primary.base");
+ }
}
- }
- .icon {
- margin: 0 auto;
- display: block;
+ &--disabled {
+ @include disabled();
+ }
}
}
diff --git a/public/components/VoteCounter.spec.tsx b/public/components/VoteCounter.spec.tsx
index 88b888a69..edc3aeee5 100644
--- a/public/components/VoteCounter.spec.tsx
+++ b/public/components/VoteCounter.spec.tsx
@@ -36,9 +36,9 @@ describe("<VoteCounter />", () => {
post.votesCount = 9
const wrapper = shallow(<VoteCounter post={post} />)
const button = wrapper.find("button")
- expect(button.text()).toBe("<FaCaretUp />9")
- expect(button.hasClass("m-voted")).toBe(true)
- expect(button.hasClass("m-disabled")).toBe(false)
+ expect(button.text()).toBe("<Icon />9")
+ expect(button.hasClass("c-vote-counter__button--voted")).toBe(true)
+ expect(button.hasClass("c-vote-counter__button--disabled")).toBe(false)
})
test("when hasVoted === false", () => {
@@ -46,18 +46,18 @@ describe("<VoteCounter />", () => {
post.votesCount = 2
const wrapper = shallow(<VoteCounter post={post} />)
const button = wrapper.find("button")
- expect(button.text()).toBe("<FaCaretUp />2")
- expect(button.hasClass("m-voted")).toBe(false)
- expect(button.hasClass("m-disabled")).toBe(false)
+ expect(button.text()).toBe("<Icon />2")
+ expect(button.hasClass("c-vote-counter__button--voted")).toBe(false)
+ expect(button.hasClass("c-vote-counter__button--disabled")).toBe(false)
})
test("when post is closed", () => {
post.status = PostStatus.Completed.value
const wrapper = shallow(<VoteCounter post={post} />)
const button = wrapper.find("button")
- expect(button.text()).toBe("<FaCaretUp />5")
- expect(button.hasClass("m-voted")).toBe(false)
- expect(button.hasClass("m-disabled")).toBe(true)
+ expect(button.text()).toBe("<Icon />5")
+ expect(button.hasClass("c-vote-counter__button--voted")).toBe(false)
+ expect(button.hasClass("c-vote-counter__button--disabled")).toBe(true)
})
test("click when unauthenticated", async () => {
@@ -84,7 +84,7 @@ describe("<VoteCounter />", () => {
expect(mock.post).toHaveBeenCalledTimes(1)
await rerender(wrapper)
- expect(wrapper.find("button").text()).toBe("<FaCaretUp />6")
+ expect(wrapper.find("button").text()).toBe("<Icon />6")
})
test("click when authenticated and hasVoted === true", async () => {
@@ -99,6 +99,6 @@ describe("<VoteCounter />", () => {
expect(mock.delete).toHaveBeenCalledTimes(1)
await rerender(wrapper)
- expect(wrapper.find("button").text()).toBe("<FaCaretUp />4")
+ expect(wrapper.find("button").text()).toBe("<Icon />4")
})
})
diff --git a/public/components/VoteCounter.tsx b/public/components/VoteCounter.tsx
index 5b702b993..375171d7d 100644
--- a/public/components/VoteCounter.tsx
+++ b/public/components/VoteCounter.tsx
@@ -2,10 +2,10 @@ import "./VoteCounter.scss"
import React, { useState } from "react"
import { Post, PostStatus } from "@fider/models"
-import { actions, device, classSet } from "@fider/services"
-import { SignInModal } from "@fider/components"
-import { FaCaretUp } from "react-icons/fa"
+import { actions, classSet } from "@fider/services"
+import { Icon, SignInModal } from "@fider/components"
import { useFider } from "@fider/hooks"
+import FaCaretUp from "@fider/assets/images/fa-caretup.svg"
interface VoteCounterProps {
post: Post
@@ -37,21 +37,21 @@ export const VoteCounter = (props: VoteCounterProps) => {
const status = PostStatus.Get(props.post.status)
const className = classSet({
- "m-voted": !status.closed && hasVoted,
- "m-disabled": status.closed,
- "no-touch": !device.isTouch(),
+ "c-vote-counter__button": true,
+ "c-vote-counter__button--voted": !status.closed && hasVoted,
+ "c-vote-counter__button--disabled": status.closed,
})
const vote = (
<button className={className} onClick={voteOrUndo}>
- <FaCaretUp />
+ <Icon sprite={FaCaretUp} height="16" width="16" />
{votesCount}
</button>
)
const disabled = (
<button className={className}>
- <FaCaretUp />
+ <Icon sprite={FaCaretUp} height="16" width="16" />
{votesCount}
</button>
)
diff --git a/public/components/common/Avatar.scss b/public/components/common/Avatar.scss
index 2572240db..b5691a2b3 100644
--- a/public/components/common/Avatar.scss
+++ b/public/components/common/Avatar.scss
@@ -3,21 +3,5 @@
.c-avatar {
border-radius: 50%;
vertical-align: middle;
- padding: 1px;
display: inline-block;
-
- &.m-small {
- width: 25px;
- height: 25px;
- }
-
- &.m-normal {
- width: 30px;
- height: 30px;
- }
-
- &.m-large {
- width: 35px;
- height: 35px;
- }
}
diff --git a/public/components/common/Avatar.tsx b/public/components/common/Avatar.tsx
index b8f43f604..7475b579c 100644
--- a/public/components/common/Avatar.tsx
+++ b/public/components/common/Avatar.tsx
@@ -1,8 +1,7 @@
import "./Avatar.scss"
import React from "react"
-import { classSet } from "@fider/services"
-import { isCollaborator, UserRole } from "@fider/models"
+import { UserRole } from "@fider/models"
interface AvatarProps {
user: {
@@ -10,17 +9,10 @@ interface AvatarProps {
avatarURL: string
name: string
}
- size?: "small" | "normal" | "large"
+ size?: "small" | "normal"
}
export const Avatar = (props: AvatarProps) => {
- const size = props.size || "normal"
-
- const className = classSet({
- "c-avatar": true,
- [`m-${size}`]: true,
- "m-staff": props.user.role && isCollaborator(props.user.role),
- })
-
- return <img className={className} alt={props.user.name} src={`${props.user.avatarURL}?size=50`} />
+ const size = props.size === "small" ? "h-6 w-6" : "h-8 w-8"
+ return <img className={`c-avatar ${size}`} alt={props.user.name} src={`${props.user.avatarURL}?size=50`} />
}
diff --git a/public/components/common/AvatarStack.scss b/public/components/common/AvatarStack.scss
new file mode 100644
index 000000000..d89b65262
--- /dev/null
+++ b/public/components/common/AvatarStack.scss
@@ -0,0 +1,11 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-avatar-stack {
+ > * {
+ border: 2px solid white;
+ }
+
+ > * + * {
+ margin-left: spacing(-3);
+ }
+}
diff --git a/public/components/common/AvatarStack.tsx b/public/components/common/AvatarStack.tsx
new file mode 100644
index 000000000..72eb75888
--- /dev/null
+++ b/public/components/common/AvatarStack.tsx
@@ -0,0 +1,23 @@
+import "./AvatarStack.scss"
+
+import React from "react"
+import { UserRole } from "@fider/models"
+import { Avatar } from "./Avatar"
+
+interface AvatarStackProps {
+ users: Array<{
+ role?: UserRole
+ avatarURL: string
+ name: string
+ }>
+}
+
+export const AvatarStack = (props: AvatarStackProps) => {
+ return (
+ <div className="c-avatar-stack">
+ {props.users.map((x, i) => (
+ <Avatar key={i} user={x} />
+ ))}
+ </div>
+ )
+}
diff --git a/public/components/common/Button.scss b/public/components/common/Button.scss
index 53306b73e..9a5d5ef7d 100644
--- a/public/components/common/Button.scss
+++ b/public/components/common/Button.scss
@@ -1,24 +1,23 @@
@import "~@fider/assets/styles/variables.scss";
.c-button {
- -webkit-appearance: none;
- appearance: none;
line-height: 1.15;
- display: inline-block;
+ display: inline-flex;
+ align-items: center;
cursor: pointer;
- font-size: $font-size;
- border-radius: 3px;
+ font-size: get("font.size.base");
+ border-radius: 4px;
border: none;
- margin: 0 4px 0 0;
padding: 8px 16px;
- text-align: left;
- font-weight: 600;
+ font-weight: 500;
+ white-space: nowrap;
- .icon {
- margin-top: -3px;
+ svg + *,
+ img + * {
+ margin-left: spacing(1);
}
- &.m-cancel {
+ &--tertiary {
background-color: transparent;
&:hover {
@@ -26,77 +25,74 @@
}
}
- &.m-default {
- color: $gray-900;
- background-color: $gray-100;
- border: 1px solid $gray-300;
+ &--secondary {
+ color: get("colors.gray.900");
+ background-color: get("colors.gray.50");
+ border: 1px solid get("colors.gray.300");
&:hover {
- border: 1px solid $gray-500;
+ background-color: get("colors.gray.100");
}
}
- &.m-positive {
- color: $white;
- background-color: $green-500;
- border: 1px solid $green-500;
+ &--primary {
+ color: get("colors.white");
+ background-color: get("colors.primary.base");
+ border: 1px solid get("colors.primary.base");
&:hover {
- background-color: $green-700;
- border-color: $green-700;
+ background-color: get("colors.primary.dark");
}
}
- &.m-danger {
- color: $red-500;
- border: 1px solid $gray-300;
- background-color: $white;
+ &--danger {
+ color: get("colors.red.600");
+ border: 1px solid get("colors.gray.300");
+ background-color: get("colors.white");
&:hover {
- color: $white;
- border: 1px solid $red-500;
- background-color: $red-500;
+ color: get("colors.white");
+ border: 1px solid get("colors.red.600");
+ background-color: get("colors.red.600");
}
}
- &.m-mini {
- padding: 6px 12px;
- font-size: $font-size-mini;
- }
+ &--small {
+ padding: 6px 10px;
+ font-size: 11px;
- &.m-tiny {
- padding: 7px 14px;
- font-size: $font-size-tiny;
+ svg,
+ img {
+ height: sizing(3);
+ }
}
- &.m-small {
- padding: 8px 16px;
- font-size: $font-size-small;
- }
+ &--default {
+ padding: 8px 12px;
+ font-size: get("font.size.sm");
- &.m-normal {
- padding: 9px 18px;
- font-size: $font-size;
+ svg,
+ img {
+ height: sizing(4);
+ }
}
- &.m-large {
- padding: 10px 20px;
- font-size: $font-size-large;
- }
+ &--large {
+ padding: 10px 14px;
+ font-size: get("font.size.lg");
- &.m-fluid {
- display: block;
- width: 100%;
+ svg,
+ img {
+ height: sizing(5);
+ }
}
- &.m-loading {
+ &--loading {
position: relative;
cursor: default;
- text-shadow: none !important;
- color: transparent !important;
+ color: transparent;
opacity: 1;
pointer-events: auto;
- -webkit-transition: all 0s linear, opacity 0.1s ease;
transition: all 0s linear, opacity 0.1s ease;
&:before {
@@ -108,7 +104,7 @@
width: 1.28571429em;
height: 1.28571429em;
border-radius: 500rem;
- border: 0.2em solid rgba(0, 0, 0, 0.15);
+ border: 0.2em solid get("colors.gray.500");
}
&:after {
@@ -119,71 +115,26 @@
margin: -0.64285714em 0 0 -0.64285714em;
width: 1.28571429em;
height: 1.28571429em;
- -webkit-animation: button-spin 0.6s linear;
animation: button-spin 0.6s linear;
- -webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
border-radius: 500rem;
- border-color: #fff transparent transparent;
+ border-color: get("colors.white") transparent transparent;
border-style: solid;
border-width: 0.2em;
- -webkit-box-shadow: 0 0 0 1px transparent;
box-shadow: 0 0 0 1px transparent;
}
}
- &.m-disabled {
+ &--disabled {
@include disabled();
}
-
- &.m-social {
- background-color: $white;
- color: $gray-900;
- text-align: center;
- height: 40px;
- line-height: 22px;
- padding: 8px 0px;
- border: none;
- box-shadow: 0 0 0 1px rgba(20, 11, 47, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
-
- &.m-loading img {
- display: none;
- }
-
- img {
- display: inline-block;
- vertical-align: middle;
- width: 24px;
- height: 24px;
- margin-right: 5px;
- }
-
- &:hover {
- background-color: #fafafb;
- color: $gray-900;
- border: none;
- box-shadow: 0 0 0 1px rgba(20, 11, 47, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
- }
- }
}
-@-webkit-keyframes button-spin {
- from {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- to {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
@keyframes button-spin {
from {
- -webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
- -webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
diff --git a/public/components/common/Button.tsx b/public/components/common/Button.tsx
index 66da5964d..34806167e 100644
--- a/public/components/common/Button.tsx
+++ b/public/components/common/Button.tsx
@@ -1,3 +1,5 @@
+import "./Button.scss"
+
import React from "react"
import { classSet } from "@fider/services"
@@ -7,18 +9,15 @@ interface ButtonProps {
href?: string
rel?: "nofollow"
type?: "button" | "submit"
- color?: "positive" | "danger" | "default" | "cancel"
- fluid?: boolean
- size?: "mini" | "tiny" | "small" | "normal" | "large"
- onClick?: (event: ButtonClickEvent) => Promise<any>
+ variant?: "primary" | "danger" | "secondary" | "tertiary"
+ size?: "small" | "default" | "large"
+ onClick?: (event: ButtonClickEvent) => Promise<any> | void
}
interface ButtonState {
clicked: boolean
}
-import "./Button.scss"
-
export class ButtonClickEvent {
private shouldEnable = true
public preventEnable(): void {
@@ -33,9 +32,8 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
private unmounted = false
public static defaultProps: Partial<ButtonProps> = {
- size: "small",
- fluid: false,
- color: "default",
+ size: "default",
+ variant: "secondary",
type: "button",
}
@@ -73,12 +71,12 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
public render() {
const className = classSet({
"c-button": true,
- "m-fluid": this.props.fluid,
- [`m-${this.props.size}`]: this.props.size,
- [`m-${this.props.color}`]: this.props.color,
- "m-loading": this.state.clicked,
- "m-disabled": this.state.clicked || this.props.disabled,
+ [`c-button--${this.props.size}`]: this.props.size,
+ [`c-button--${this.props.variant}`]: this.props.variant,
+ "c-button--loading": this.state.clicked,
+ "c-button--disabled": this.state.clicked || this.props.disabled,
[this.props.className || ""]: this.props.className,
+ "shadow-sm": this.props.variant !== "tertiary",
})
if (this.props.href) {
diff --git a/public/components/common/DevBanner.scss b/public/components/common/DevBanner.scss
new file mode 100644
index 000000000..54f17eec6
--- /dev/null
+++ b/public/components/common/DevBanner.scss
@@ -0,0 +1,13 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-dev-banner {
+ position: fixed;
+ top: spacing(2);
+ left: spacing(2);
+ padding: spacing(2);
+ font-size: get("font.size.base");
+ color: get("colors.red.700");
+ border: 2px solid get("colors.red.700");
+ background-color: get("colors.red.50");
+ opacity: 0.7;
+}
diff --git a/public/components/common/DevBanner.tsx b/public/components/common/DevBanner.tsx
new file mode 100644
index 000000000..6b4bc50f0
--- /dev/null
+++ b/public/components/common/DevBanner.tsx
@@ -0,0 +1,14 @@
+import React from "react"
+import { useFider } from "@fider/hooks"
+
+import "./DevBanner.scss"
+
+export const DevBanner = () => {
+ const fider = useFider()
+
+ if (fider.isProduction()) {
+ return null
+ }
+
+ return <div className="c-dev-banner">DEV</div>
+}
diff --git a/public/components/common/DropDown.scss b/public/components/common/DropDown.scss
deleted file mode 100644
index 810a7b6be..000000000
--- a/public/components/common/DropDown.scss
+++ /dev/null
@@ -1,131 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-dropdown {
- position: relative;
-
- &.is-inline {
- display: inline-block;
- .c-dropdown-menu {
- width: auto;
- border-radius: 5px;
- margin-top: 5px;
- }
- }
-
- &.is-open {
- .c-dropdown-arrow {
- border-color: transparent transparent $gray-400;
- border-width: 0 5px 5px;
- }
- }
-
- &.m-left {
- .c-dropdown-menu {
- right: 0;
- }
- }
-
- &.m-style-normal {
- .c-dropdown-control {
- border: 1px solid $gray-300;
-
- &:hover {
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
- }
- }
- }
-
- .c-dropdown-control {
- position: relative;
- cursor: pointer;
- overflow: hidden;
- background-color: transparent;
- border-radius: 3px;
- box-sizing: border-box;
- color: $gray-900;
- outline: none;
- padding: 8px 52px 8px 10px;
- transition: all 200ms ease;
-
- input {
- border: none;
- width: 100%;
- }
-
- .c-dropdown-placeholder {
- color: $gray-300;
- }
-
- .c-dropdown-arrow {
- border-color: $gray-500 transparent transparent;
- border-style: solid;
- border-width: 5px 5px 0;
- content: " ";
- display: block;
- height: 0;
- margin-top: -ceil(2.5);
- position: absolute;
- right: 10px;
- top: 40%;
- width: 0;
- }
- }
-
- .c-dropdown-menu {
- background-color: $white;
- border: 1px solid $gray-300;
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
- box-sizing: border-box;
- margin-top: -1px;
- overflow-y: auto;
- position: absolute;
- width: 100%;
- top: 100%;
- z-index: 1000;
- min-width: -webkit-min-content;
- min-width: -moz-min-content;
- min-width: min-content;
- max-height: 300px;
- -webkit-overflow-scrolling: touch;
-
- > * {
- white-space: nowrap;
- }
-
- .c-dropdown-menu-header {
- padding: 12px 10px;
- text-transform: uppercase;
- font-weight: 700;
- font-size: 0.78571429em;
- }
-
- .c-dropdown-item {
- box-sizing: border-box;
- cursor: pointer;
- display: block;
- padding: 12px 10px;
- line-height: $font-size;
-
- &:last-child {
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
- }
-
- &:hover {
- background-color: $gray-100;
- }
-
- &.is-selected {
- font-weight: 700;
- }
- }
-
- .c-dropdown-noresults {
- box-sizing: border-box;
- color: $gray-400;
- cursor: default;
- display: block;
- padding: 8px 10px;
- }
- }
-}
diff --git a/public/components/common/DropDown.tsx b/public/components/common/DropDown.tsx
deleted file mode 100644
index 707ba9c8f..000000000
--- a/public/components/common/DropDown.tsx
+++ /dev/null
@@ -1,189 +0,0 @@
-import React from "react"
-import { classSet } from "@fider/services"
-
-import "./DropDown.scss"
-
-export interface DropDownItem {
- value: any
- label: string
- render?: JSX.Element
-}
-
-export interface DropDownProps {
- className?: string
- defaultValue?: any
- items: (DropDownItem | undefined | false)[]
- placeholder?: string
- searchable?: boolean
- inline?: boolean
- style: "normal" | "simple"
- highlightSelected?: boolean
- header?: string
- direction?: "left" | "right"
- onChange?: (item: DropDownItem) => void
- onSearchChange?: (e: React.FormEvent<HTMLInputElement>) => void
- renderText?: (item?: DropDownItem) => JSX.Element | string | undefined
- renderControl?: (item?: DropDownItem) => JSX.Element | string | undefined
-}
-
-export interface DropDownState {
- isOpen: boolean
- selected?: DropDownItem
-}
-
-export class DropDown extends React.Component<DropDownProps, DropDownState> {
- private rootElementRef: React.RefObject<HTMLDivElement>
- private mounted = false
-
- public static defaultProps: Partial<DropDownProps> = {
- direction: "right",
- style: "normal",
- highlightSelected: true,
- }
-
- constructor(props: DropDownProps) {
- super(props)
- this.rootElementRef = React.createRef<HTMLDivElement>()
- this.state = {
- selected: this.findItem(props.defaultValue, props.items),
- isOpen: false,
- }
- }
-
- public componentDidMount() {
- this.mounted = true
- }
-
- public componentWillUnmount() {
- this.mounted = false
- this.removeListeners()
- }
-
- private addListeners() {
- document.addEventListener("click", this.handleDocumentClick, false)
- document.addEventListener("touchend", this.handleDocumentClick, false)
- }
-
- private removeListeners() {
- document.removeEventListener("click", this.handleDocumentClick, false)
- document.removeEventListener("touchend", this.handleDocumentClick, false)
- }
-
- public handleMouseDown = (event: any) => {
- if (event.type === "mousedown" && event.button !== 0) {
- return
- }
-
- event.stopPropagation()
- event.preventDefault()
-
- this.setState(
- {
- isOpen: true,
- },
- this.addListeners
- )
- }
-
- public findItem(value: any, items: (DropDownItem | undefined | false)[]): DropDownItem | undefined {
- for (const item of items) {
- if (item && item.value === value) {
- return item
- }
- }
- return undefined
- }
-
- public setSelected(selected: DropDownItem) {
- const newState = {
- selected,
- isOpen: false,
- }
- this.fireChangeEvent(newState)
- this.setState(newState, this.removeListeners)
- }
-
- public fireChangeEvent(newState: DropDownState) {
- if (newState.selected && newState.selected !== this.state.selected && this.props.onChange) {
- this.props.onChange(newState.selected)
- }
- }
-
- public renderItem = (item: DropDownItem | undefined | false) => {
- if (!item) {
- return
- }
-
- const { label, value } = item
- const isSelected = this.props.highlightSelected && this.state.selected && value === this.state.selected.value
- const className = classSet({
- "c-dropdown-item": true,
- "is-selected": isSelected,
- })
-
- return (
- <div key={value} className={className} onMouseDown={this.setSelected.bind(this, item)} onClick={this.setSelected.bind(this, item)}>
- {item.render ? item.render : label}
- </div>
- )
- }
-
- public buildItemList() {
- const items = this.props.items.map(this.renderItem)
-
- return (
- <div className="c-dropdown-menu">
- {this.props.header && <div className="c-dropdown-menu-header">{this.props.header}</div>}
- <div className="c-dropdown-menu-items">{items.length ? items : <div className={`c-dropdown-noresults`}>No results found</div>}</div>
- </div>
- )
- }
-
- public handleDocumentClick = (event: any) => {
- if (this.mounted) {
- const node = this.rootElementRef.current
- if (node && !node.contains(event.target)) {
- if (this.state.isOpen) {
- this.setState(
- {
- isOpen: false,
- },
- this.removeListeners
- )
- }
- }
- }
- }
-
- public render() {
- const text = this.state.selected ? this.state.selected.label : <span className="c-dropdown-placeholder">{this.props.placeholder}</span>
-
- const search = <input type="text" autoFocus={true} onChange={this.props.onSearchChange} />
-
- const dropdownClass = classSet({
- "c-dropdown": true,
- [`${this.props.className}`]: this.props.className,
- "is-open": this.state.isOpen,
- [`m-style-${this.props.style}`]: true,
- "is-inline": this.props.inline,
- "m-right": this.props.direction === "right",
- "m-left": this.props.direction === "left",
- })
-
- return (
- <div ref={this.rootElementRef} className={dropdownClass}>
- <div onMouseDown={this.handleMouseDown} onTouchEnd={this.handleMouseDown}>
- {this.props.renderControl ? (
- <div className="c-dropdown-control">{this.props.renderControl(this.state.selected)}</div>
- ) : (
- <div className="c-dropdown-control">
- {this.state.isOpen && this.props.searchable ? search : this.props.renderText ? this.props.renderText(this.state.selected) : <div>{text}</div>}
- <span className="c-dropdown-arrow" />
- </div>
- )}
- </div>
- {this.state.isOpen && this.buildItemList()}
- </div>
- )
- }
-}
diff --git a/public/components/common/Dropdown.scss b/public/components/common/Dropdown.scss
new file mode 100644
index 000000000..265bf97ca
--- /dev/null
+++ b/public/components/common/Dropdown.scss
@@ -0,0 +1,49 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-dropdown {
+ display: inline-block;
+ position: relative;
+ font-size: get("font.size.sm");
+
+ &__handle {
+ text-align: left;
+ background-color: transparent;
+ border: none;
+ padding: 0;
+ cursor: pointer;
+ }
+
+ &__list {
+ margin-top: spacing(2);
+ position: absolute;
+ overflow: auto;
+ width: max-content;
+ min-width: sizing(40);
+ max-width: sizing(60);
+ padding: spacing(1) 0;
+ background-color: get("colors.white");
+ border-radius: get("border.radius.medium");
+ border: 1px solid get("colors.gray.300");
+ z-index: 10;
+
+ &--left {
+ right: 0;
+ }
+ }
+
+ &__listitem {
+ display: block;
+ padding: spacing(2);
+ &:hover {
+ cursor: pointer;
+ background-color: get("colors.gray.100");
+ }
+ }
+
+ &__divider {
+ margin: spacing(1);
+ background-color: get("colors.gray.200");
+ height: 1px;
+ border: none;
+ }
+}
diff --git a/public/components/common/Dropdown.tsx b/public/components/common/Dropdown.tsx
new file mode 100644
index 000000000..8da23d576
--- /dev/null
+++ b/public/components/common/Dropdown.tsx
@@ -0,0 +1,102 @@
+import "./Dropdown.scss"
+
+import React, { createContext, useContext, useEffect, useRef, useState } from "react"
+import { classSet } from "@fider/services"
+
+interface DropdownListItemProps {
+ href?: string
+ onClick?: () => void
+ className?: string
+ children: React.ReactNode
+}
+
+const ListItem = (props: DropdownListItemProps) => {
+ const ctx = useContext(DropdownContext)
+ const handleClick = () => {
+ if (props.onClick) {
+ props.onClick()
+ }
+
+ ctx?.close()
+ }
+
+ if (props.href) {
+ return (
+ <a href={props.href} className={`c-dropdown__listitem ${props.className}`}>
+ {props.children}
+ </a>
+ )
+ }
+
+ return (
+ <div onClick={handleClick} className={`c-dropdown__listitem ${props.className}`}>
+ {props.children}
+ </div>
+ )
+}
+
+const Divider = () => {
+ return <hr className="c-dropdown__divider" />
+}
+
+interface DropdownProps {
+ renderHandle: JSX.Element
+ position?: "left" | "right"
+ children: React.ReactNode
+}
+
+interface DropdownContextFuncs {
+ close(): void
+}
+
+const DropdownContext = createContext<DropdownContextFuncs | null>(null)
+DropdownContext.displayName = "DropdownContext"
+
+export const Dropdown = (props: DropdownProps) => {
+ const node = useRef<HTMLDivElement | null>(null)
+ const [isOpen, setIsOpen] = useState(false)
+ const position = props.position || "right"
+
+ const toggleIsOpen = () => {
+ setIsOpen(!isOpen)
+ }
+
+ const close = () => {
+ setIsOpen(false)
+ }
+
+ const handleClick = (e: MouseEvent) => {
+ if (node.current && node.current.contains(e.target as Node)) {
+ return
+ }
+
+ close()
+ }
+
+ useEffect(() => {
+ document.addEventListener("mousedown", handleClick)
+
+ return () => {
+ document.removeEventListener("mousedown", handleClick)
+ }
+ }, [])
+
+ const listClassName = classSet({
+ "c-dropdown__list shadow-lg": true,
+ [`c-dropdown__list--${position}`]: position === "left",
+ })
+
+ return (
+ <DropdownContext.Provider value={{ close }}>
+ <div ref={node} className="c-dropdown">
+ <button type="button" className="c-dropdown__handle" onClick={toggleIsOpen}>
+ {props.renderHandle}
+ </button>
+ {isOpen && <div className={listClassName}>{props.children}</div>}
+ </div>
+ </DropdownContext.Provider>
+ )
+}
+
+Dropdown.ListItem = ListItem
+Dropdown.Divider = Divider
diff --git a/public/components/common/EnvironmentInfo.tsx b/public/components/common/EnvironmentInfo.tsx
deleted file mode 100644
index e33661f76..000000000
--- a/public/components/common/EnvironmentInfo.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from "react"
-import { useFider } from "@fider/hooks"
-
-export const EnvironmentInfo = () => {
- const fider = useFider()
-
- if (fider.isProduction()) {
- return null
- }
-
- return (
- <div className="c-env-info">
- Env: {fider.settings.environment} | Compiler: {fider.settings.compiler} | Version: {fider.settings.version} | BuildTime:{" "}
- {fider.settings.buildTime || "N/A"} |{!fider.isSingleHostMode() && `TenantID: ${fider.session.tenant.id}`} |{" "}
- {fider.session.isAuthenticated && `UserID: ${fider.session.user.id}`}
- </div>
- )
-}
diff --git a/public/components/common/FiderVersion.tsx b/public/components/common/FiderVersion.tsx
index b8c5d00e7..8d618b052 100644
--- a/public/components/common/FiderVersion.tsx
+++ b/public/components/common/FiderVersion.tsx
@@ -5,9 +5,9 @@ export const FiderVersion = () => {
const fider = useFider()
return (
- <p className="info center hidden-sm hidden-md">
+ <p className="text-muted mt-2 text-center sm:hidden md:hidden">
Support our{" "}
- <a rel="noopener" target="_blank" href="http://opencollective.com/fider">
+ <a className="text-link" rel="noopener" target="_blank" href="http://opencollective.com/fider">
OpenCollective
</a>
<br />
diff --git a/public/components/common/Header.scss b/public/components/common/Header.scss
deleted file mode 100644
index 12aa4a117..000000000
--- a/public/components/common/Header.scss
+++ /dev/null
@@ -1,167 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-@mixin menu-item {
- position: relative;
- vertical-align: middle;
- line-height: 1;
- text-decoration: none;
- flex: 0 0 auto;
- user-select: none;
- padding: 15px 10px;
- display: flex;
- align-items: center;
-}
-
-#c-header {
- .c-env-info {
- padding: 2px;
- border-radius: 0px;
- font-size: 10px;
- color: $red-900;
- border-bottom: 1px solid $red-900;
- background-color: rgba($red-400, 0.05);
- }
-
- .c-menu {
- margin-top: 0px;
- height: 50px;
- border-radius: 0px;
- border: none;
- display: flex;
- box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15);
- margin-bottom: 10px;
-
- .container {
- display: flex;
- }
-
- @include media("sm") {
- height: 40px;
- .container {
- width: 100% !important;
- margin-left: 0 !important;
- margin-right: 0 !important;
- }
- }
-
- .c-menu-item-title {
- @include menu-item;
- color: #484848;
- img {
- margin-right: 10px;
- width: auto;
- height: auto;
- max-height: 36px;
- @include media("sm") {
- max-height: 26px;
- margin-right: 5px;
- }
- }
- h1 {
- font-size: $font-size-big;
- margin: 0 0 0 0;
- font-weight: 600;
- @include media("sm") {
- font-size: $font-size;
- max-width: 240px;
- }
- }
- }
-
- .c-menu-item-signin {
- @include menu-item;
- cursor: pointer;
- font-size: 90%;
- margin-left: auto !important;
- margin-bottom: 0;
-
- > span {
- font-weight: 600;
- text-transform: uppercase;
- color: $gray-700;
- }
-
- &:hover {
- > span {
- color: $gray-900;
- }
- }
-
- .c-menu-user {
- display: none;
- position: absolute;
- overflow: visible;
- width: auto;
- height: auto;
- top: 100% !important;
- opacity: 1;
- z-index: 11;
- background-color: $white;
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
- border: 1px solid rgba(34, 36, 38, 0.15);
- min-width: 160px;
- border-radius: 0px 0px 5px 5px;
-
- span {
- vertical-align: middle;
- }
-
- .c-menu-user-heading {
- white-space: nowrap;
- font-size: $font-size-mini;
- padding: 10px;
- display: block;
- color: $gray-900;
- text-transform: uppercase;
- font-weight: 600;
- cursor: default;
- }
-
- .c-menu-user-item {
- font-size: $font-size-small;
- padding: 10px;
- display: block;
- color: $gray-900;
- &:hover {
- background-color: $gray-200;
- }
- }
- .c-menu-user-divider {
- border-top: 1px solid rgba(34, 36, 38, 0.1);
- display: block;
- cursor: default;
- }
- }
-
- &:hover {
- .c-menu-user {
- display: block;
- left: auto;
- right: 0;
- }
- }
-
- .c-unread-dot {
- width: 10px;
- height: 10px;
- border-radius: 5px;
- margin-left: -10px;
- margin-top: -25px;
- background-color: $red-500;
- border: 1px solid $white !important;
- }
-
- .c-unread-count {
- display: inline-block;
- background-color: $red-500;
- position: absolute;
- right: 5px;
- padding: 2px 8px;
- color: $white;
- border-radius: 100px;
- font-size: $font-size-mini;
- text-align: center;
- }
- }
- }
-}
diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsx
deleted file mode 100644
index 1d5b9e780..000000000
--- a/public/components/common/Header.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import "./Header.scss"
-
-import React, { useState, useEffect } from "react"
-import { SignInModal, EnvironmentInfo, Avatar, TenantLogo } from "@fider/components"
-import { actions } from "@fider/services"
-import { FaUser, FaCog, FaCaretDown } from "react-icons/fa"
-import { useFider } from "@fider/hooks"
-
-export const Header = () => {
- const fider = useFider()
- const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)
- const [unreadNotifications, setUnreadNotifications] = useState(0)
-
- useEffect(() => {
- if (fider.session.isAuthenticated) {
- actions.getTotalUnreadNotifications().then((result) => {
- if (result.ok && result.data > 0) {
- setUnreadNotifications(result.data)
- }
- })
- }
- }, [fider.session.isAuthenticated])
-
- const showModal = () => {
- if (!fider.session.isAuthenticated) {
- setIsSignInModalOpen(true)
- }
- }
-
- const hideModal = () => setIsSignInModalOpen(false)
-
- const items = fider.session.isAuthenticated && (
- <div className="c-menu-user">
- <div className="c-menu-user-heading">
- <FaUser /> <span>{fider.session.user.name}</span>
- </div>
- <a href="/settings" className="c-menu-user-item">
- Settings
- </a>
- <a href="/notifications" className="c-menu-user-item">
- Notifications
- {unreadNotifications > 0 && <div className="c-unread-count">{unreadNotifications}</div>}
- </a>
- <div className="c-menu-user-divider" />
- {fider.session.user.isCollaborator && [
- <div key={1} className="c-menu-user-heading">
- <FaCog /> <span>Administration</span>
- </div>,
- <a key={2} href="/admin" className="c-menu-user-item">
- Site Settings
- </a>,
- <div key={5} className="c-menu-user-divider" />,
- ]}
- <a href="/signout?redirect=/" className="c-menu-user-item signout">
- Sign out
- </a>
- </div>
- )
-
- const showRightMenu = fider.session.isAuthenticated || !fider.session.tenant.isPrivate
- return (
- <div id="c-header">
- <EnvironmentInfo />
- <SignInModal isOpen={isSignInModalOpen} onClose={hideModal} />
- <div className="c-menu">
- <div className="container">
- <a href="/" className="c-menu-item-title">
- <TenantLogo size={100} />
- <h1>{fider.session.tenant.name}</h1>
- </a>
- {showRightMenu && (
- <div onClick={showModal} className="c-menu-item-signin">
- {fider.session.isAuthenticated && <Avatar user={fider.session.user} />}
- {unreadNotifications > 0 && <div className="c-unread-dot" />}
- {!fider.session.isAuthenticated && <span>Sign in</span>}
- {fider.session.isAuthenticated && <FaCaretDown />}
- {items}
- </div>
- )}
- </div>
- </div>
- </div>
- )
-}
diff --git a/public/components/common/Heading.scss b/public/components/common/Heading.scss
deleted file mode 100644
index 0019e28bd..000000000
--- a/public/components/common/Heading.scss
+++ /dev/null
@@ -1,54 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-heading {
- margin: 0px 0px 10px 0px;
-
- .c-heading-content {
- display: inline-block;
- vertical-align: middle;
-
- .c-heading-subtitle {
- font-weight: 400;
- margin-top: 5px;
- color: $gray-700;
- font-size: $font-size;
- }
- }
-
- .c-heading-icon + .c-heading-content {
- padding-left: 10px;
- }
-
- .c-heading-icon {
- font-size: 30px;
- @include media("sm") {
- font-size: 20px;
- }
- display: inline-block;
- vertical-align: middle;
- &.circular {
- border-radius: 500em !important;
- padding: 0.5em 0 !important;
- -webkit-box-shadow: 0 0 0 0.1em rgba(0, 0, 0, 0.1) inset;
- box-shadow: 0 0 0 0.1em rgba(0, 0, 0, 0.1) inset;
- width: 2em !important;
- height: 2em !important;
- text-align: center;
- .icon {
- vertical-align: top;
- }
- }
- }
-
- &.m-dividing {
- box-shadow: 0px 1px 0px 0px rgba(34, 36, 38, 0.1);
- padding-bottom: 5px;
- margin-bottom: 10px;
- }
-
- &.m-small {
- .c-heading-subtitle {
- font-size: $font-size-small;
- }
- }
-}
diff --git a/public/components/common/Heading.tsx b/public/components/common/Heading.tsx
deleted file mode 100644
index 2985013c6..000000000
--- a/public/components/common/Heading.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import "./Heading.scss"
-
-import React from "react"
-import { classSet } from "@fider/services"
-import { IconType } from "react-icons"
-
-interface HeadingLogo {
- title: string
- dividing?: boolean
- size?: "normal" | "small"
- icon?: IconType
- subtitle?: string
- className?: string
-}
-
-const Header: React.FunctionComponent<{ level: number; className: string }> = (props) =>
- React.createElement(`h${props.level}`, { className: props.className }, props.children)
-
-export const Heading = (props: HeadingLogo) => {
- const size = props.size || "normal"
- const level = size === "normal" ? 2 : 3
- const className = classSet({
- "c-heading": true,
- "m-dividing": props.dividing || false,
- [`m-${size}`]: true,
- [`${props.className}`]: props.className,
- })
-
- const iconClassName = classSet({
- "c-heading-icon": true,
- circular: level <= 2,
- })
-
- const icon = props.icon && <div className={iconClassName}>{React.createElement(props.icon)}</div>
-
- return (
- <Header level={level} className={className}>
- {icon}
- <div className="c-heading-content">
- {props.title}
- <div className="c-heading-subtitle">{props.subtitle}</div>
- </div>
- </Header>
- )
-}
diff --git a/public/components/common/Hint.scss b/public/components/common/Hint.scss
index f6f5a63d2..36d3db5da 100644
--- a/public/components/common/Hint.scss
+++ b/public/components/common/Hint.scss
@@ -2,17 +2,18 @@
.c-hint {
position: relative;
- padding: 15px 35px 15px 15px;
- margin-bottom: 10px;
- color: $blue-700;
- border-left: 2px solid $blue-500;
- background-color: $blue-50;
+ padding: spacing(4);
+ margin-bottom: spacing(2);
+ color: get("colors.blue.800");
+ border-left: 2px solid get("colors.blue.800");
+ background-color: get("colors.blue.50");
+ text-align: left;
- .close {
- position: absolute;
- right: 15px;
- top: 15px;
- font-size: $font-size-large;
+ span {
+ flex: 1;
+ }
+
+ &__close {
cursor: pointer;
}
}
diff --git a/public/components/common/Hint.tsx b/public/components/common/Hint.tsx
index cf5692537..2ff25717c 100644
--- a/public/components/common/Hint.tsx
+++ b/public/components/common/Hint.tsx
@@ -1,9 +1,10 @@
import "./Hint.scss"
import React, { useState } from "react"
-import { FaTimes } from "react-icons/fa"
-
+import IconX from "@fider/assets/images/heroicons-x.svg"
+import { HStack } from "@fider/components/layout"
import { cache } from "@fider/services"
+import { Icon } from "./Icon"
interface HintProps {
permanentCloseKey?: string
@@ -24,10 +25,11 @@ export const Hint: React.FC<HintProps> = (props) => {
if (props.condition === false || isClosed) {
return null
}
+
return (
- <p className="c-hint">
- <strong>HINT:</strong> {props.children}
- {cacheKey && <FaTimes onClick={close} className="close" />}
- </p>
+ <HStack className="c-hint" justify="between" spacing={2}>
+ <span>{props.children}</span>
+ {cacheKey && <Icon sprite={IconX} onClick={close} className="c-hint__close h-5" />}
+ </HStack>
)
}
diff --git a/public/components/common/Icon.tsx b/public/components/common/Icon.tsx
new file mode 100644
index 000000000..241d5fd85
--- /dev/null
+++ b/public/components/common/Icon.tsx
@@ -0,0 +1,21 @@
+import React from "react"
+
+interface IconProps {
+ sprite: SpriteSymbol | string
+ height?: string
+ width?: string
+ className?: string
+ onClick?: () => void
+}
+
+export const Icon = (props: IconProps) => {
+ if (typeof props.sprite === "string") {
+ return <img height={props.height} width={props.width} className={props.className} src={props.sprite} />
+ }
+
+ return (
+ <svg onClick={props.onClick} height={props.height} width={props.width} className={props.className} viewBox={props.sprite.viewBox}>
+ <use href={props.sprite.url} />
+ </svg>
+ )
+}
diff --git a/public/components/common/Legal.tsx b/public/components/common/Legal.tsx
index dababcb98..1216cdbb7 100644
--- a/public/components/common/Legal.tsx
+++ b/public/components/common/Legal.tsx
@@ -1,17 +1,17 @@
import React from "react"
-import { Modal, Checkbox } from "@fider/components/common"
+import { Modal, Checkbox } from "@fider/components"
import { useFider } from "@fider/hooks"
interface LegalAgreementProps {
onChange: (agreed: boolean) => void
}
-export const TermsOfService: React.FunctionComponent<any> = () => {
+export const TermsOfService = () => {
const fider = useFider()
if (fider.settings.hasLegal) {
return (
- <a href="/terms" target="_blank">
+ <a href="/terms" className="text-link" target="_blank">
Terms of Service
</a>
)
@@ -19,12 +19,12 @@ export const TermsOfService: React.FunctionComponent<any> = () => {
return null
}
-export const PrivacyPolicy: React.FunctionComponent<any> = () => {
+export const PrivacyPolicy = () => {
const fider = useFider()
if (fider.settings.hasLegal) {
return (
- <a href="/privacy" target="_blank">
+ <a href="/privacy" className="text-link" target="_blank">
Privacy Policy
</a>
)
@@ -32,12 +32,12 @@ export const PrivacyPolicy: React.FunctionComponent<any> = () => {
return null
}
-export const LegalNotice: React.FunctionComponent<any> = () => {
+export const LegalNotice = () => {
const fider = useFider()
if (fider.settings.hasLegal) {
return (
- <p className="info">
+ <p className="text-muted">
By signing in, you agree to the <PrivacyPolicy /> and <TermsOfService />.
</p>
)
@@ -45,7 +45,7 @@ export const LegalNotice: React.FunctionComponent<any> = () => {
return null
}
-export const LegalFooter: React.FunctionComponent<any> = () => {
+export const LegalFooter = () => {
const fider = useFider()
if (fider.settings.hasLegal) {
diff --git a/public/components/common/List.scss b/public/components/common/List.scss
deleted file mode 100644
index 262a8f9de..000000000
--- a/public/components/common/List.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-list {
- margin-bottom: 15px;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- &.m-hover {
- .c-list-item {
- padding: 5px;
- }
- .c-list-item:hover {
- background-color: $gray-200;
- border-radius: 2px;
- }
- }
-
- &.m-divided {
- .c-list-item {
- padding: 15px 0 0 0;
- margin: 0 0 15px 0;
- border-top: 1px solid $gray-200;
- &:first-child {
- border-top: none;
- padding-top: 0;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
-
- .c-list-item {
- display: list-item;
- table-layout: fixed;
- list-style-type: none;
- list-style-position: outside;
- padding: 3px 0;
- border: none;
-
- &.m-selectable {
- cursor: pointer;
- }
-
- .showover {
- visibility: hidden;
- }
-
- &:hover {
- .showover {
- visibility: visible;
- }
- }
- }
-}
diff --git a/public/components/common/List.tsx b/public/components/common/List.tsx
deleted file mode 100644
index 0e5e0ab07..000000000
--- a/public/components/common/List.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import "./List.scss"
-
-import React from "react"
-import { classSet } from "@fider/services"
-
-interface ListProps {
- className?: string
- divided?: boolean
- hover?: boolean
-}
-
-interface ListItemProps {
- className?: string
- onClick?: () => void
-}
-
-export const List: React.FunctionComponent<ListProps> = (props) => {
- const className = classSet({
- "c-list": true,
- [props.className || ""]: true,
- "m-divided": props.divided,
- "m-hover": props.hover,
- })
-
- return <div className={className}>{props.children}</div>
-}
-
-export const ListItem: React.FunctionComponent<ListItemProps> = (props) => {
- const className = classSet({
- "c-list-item": true,
- [props.className || ""]: true,
- "m-selectable": props.onClick,
- })
-
- if (props.onClick) {
- return (
- <div className={className} onClick={props.onClick}>
- {props.children}
- </div>
- )
- }
- return <div className={className}>{props.children}</div>
-}
diff --git a/public/components/common/Loader.scss b/public/components/common/Loader.scss
index 957b6a055..97c97521f 100644
--- a/public/components/common/Loader.scss
+++ b/public/components/common/Loader.scss
@@ -1,3 +1,5 @@
+@import "~@fider/assets/styles/variables.scss";
+
.c-loader {
display: block;
position: relative;
@@ -19,7 +21,7 @@
width: 100%;
height: 100%;
border-radius: 500rem;
- border: 0.2em solid rgba(0, 0, 0, 0.1);
+ border: 0.2em solid get("colors.gray.300");
}
.c-loader:after {
@@ -29,15 +31,12 @@
left: 50%;
width: 100%;
height: 100%;
- -webkit-animation: loader 0.6s linear;
animation: loader 0.6s linear;
- -webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
border-radius: 500rem;
- border-color: #767676 transparent transparent;
+ border-color: get("colors.gray.700") transparent transparent;
border-style: solid;
border-width: 0.2em;
- -webkit-box-shadow: 0px 0px 0px 1px transparent;
box-shadow: 0px 0px 0px 1px transparent;
}
@@ -48,23 +47,11 @@
margin: 0 0 0 -15px;
}
-@-webkit-keyframes loader {
- from {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- to {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
@keyframes loader {
from {
- -webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
- -webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
diff --git a/public/components/common/Markdown.scss b/public/components/common/Markdown.scss
new file mode 100644
index 000000000..7a40b8b81
--- /dev/null
+++ b/public/components/common/Markdown.scss
@@ -0,0 +1,70 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-markdown {
+ overflow-wrap: break-word;
+ word-break: break-word;
+
+ blockquote {
+ padding: 0 spacing(2);
+ color: get("colors.gray.900");
+ border-left: 4px solid get("colors.gray.300");
+ margin: spacing(1) 0;
+ }
+
+ h1 {
+ font-size: get("font.size.2xl");
+ }
+
+ h2 {
+ font-size: get("font.size.xl");
+ }
+
+ h3 {
+ font-size: get("font.size.lg");
+ }
+
+ ul,
+ ol {
+ padding-left: spacing(8);
+ margin: 0 0 spacing(3);
+
+ &:first-child {
+ margin-top: 0;
+ }
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+ }
+
+ img {
+ max-width: 100%;
+ }
+
+ pre {
+ overflow-x: scroll;
+ padding: 16px;
+ line-height: 1.45;
+ background-color: get("colors.gray.100");
+ border-radius: 4px;
+ code {
+ display: inline;
+ max-width: auto;
+ padding: 0;
+ margin: 0;
+ overflow: visible;
+ line-height: inherit;
+ word-wrap: normal;
+ background-color: transparent;
+ border: 0;
+ }
+ }
+
+ code {
+ padding: 0.2em;
+ font-size: 85%;
+ margin: 0;
+ background-color: get("colors.gray.100");
+ border-radius: 4px;
+ }
+}
diff --git a/public/components/common/MultiLineText.tsx b/public/components/common/Markdown.tsx
similarity index 74%
rename from public/components/common/MultiLineText.tsx
rename to public/components/common/Markdown.tsx
index f33d34a2f..827b1fc2a 100644
--- a/public/components/common/MultiLineText.tsx
+++ b/public/components/common/Markdown.tsx
@@ -1,20 +1,22 @@
import React from "react"
import { markdown, truncate } from "@fider/services"
-interface MultiLineTextProps {
+import "./Markdown.scss"
+
+interface MarkdownProps {
className?: string
text?: string
maxLength?: number
style: "full" | "plainText"
}
-export const MultiLineText = (props: MultiLineTextProps) => {
+export const Markdown = (props: MarkdownProps) => {
if (!props.text) {
return null
}
const html = markdown[props.style](props.text)
- const className = `markdown-body ${props.className || ""}`
+ const className = `c-markdown ${props.className || ""}`
const tagName = props.style === "plainText" ? "p" : "div"
return React.createElement(tagName, {
diff --git a/public/components/common/Message.scss b/public/components/common/Message.scss
index ef3aa581a..c996d8d6e 100644
--- a/public/components/common/Message.scss
+++ b/public/components/common/Message.scss
@@ -1,31 +1,24 @@
@import "~@fider/assets/styles/variables.scss";
.c-message {
- padding: 15px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
+ padding: spacing(4);
+ margin-bottom: spacing(2);
- .icon {
- margin-right: 6px;
- height: 14px;
+ &--success {
+ color: get("colors.green.800");
+ border-left: 2px solid get("colors.green.800");
+ background-color: get("colors.green.50");
}
- &.m-success {
- color: $green-700;
- border-left: 2px solid $green-500;
- background-color: $green-50;
+ &--warning {
+ color: get("colors.yellow.800");
+ border-left: 2px solid get("colors.yellow.800");
+ background-color: get("colors.yellow.50");
}
- &.m-warning {
- color: $yellow-700;
- border-left: 2px solid $yellow-500;
- background-color: $yellow-50;
- }
-
- &.m-error {
- color: $red-700;
- border-left: 2px solid $red-500;
- background-color: $red-50;
+ &--error {
+ color: get("colors.red.800");
+ border-left: 2px solid get("colors.red.800");
+ background-color: get("colors.red.50");
}
}
diff --git a/public/components/common/Message.tsx b/public/components/common/Message.tsx
index 0e28e5f46..a814be1b6 100644
--- a/public/components/common/Message.tsx
+++ b/public/components/common/Message.tsx
@@ -2,25 +2,31 @@ import "./Message.scss"
import React from "react"
import { classSet } from "@fider/services"
-import { FaBan, FaRegCheckCircle, FaExclamationTriangle } from "react-icons/fa"
+import IconCheckCircle from "@fider/assets/images/heroicons-check-circle.svg"
+import IconExclamationCircle from "@fider/assets/images/heroicons-exclamation-circle.svg"
+import IconExclamation from "@fider/assets/images/heroicons-exclamation.svg"
+import { HStack } from "@fider/components/layout"
+import { Icon } from "./Icon"
interface MessageProps {
type: "success" | "warning" | "error"
+ className?: string
showIcon?: boolean
}
export const Message: React.FunctionComponent<MessageProps> = (props) => {
const className = classSet({
"c-message": true,
- [`m-${props.type}`]: true,
+ [`c-message--${props.type}`]: true,
+ [`${props.className}`]: props.className,
})
- const icon = props.type === "error" ? <FaBan /> : props.type === "warning" ? <FaExclamationTriangle /> : <FaRegCheckCircle />
+ const icon = props.type === "error" ? IconExclamation : props.type === "warning" ? IconExclamationCircle : IconCheckCircle
return (
- <p className={className}>
- {props.showIcon === true && icon}
+ <HStack className={className} spacing={2}>
+ {props.showIcon === true && <Icon className="h-5" sprite={icon} />}
<span>{props.children}</span>
- </p>
+ </HStack>
)
}
diff --git a/public/components/common/Modal.scss b/public/components/common/Modal.scss
index d2fa24294..48e690851 100644
--- a/public/components/common/Modal.scss
+++ b/public/components/common/Modal.scss
@@ -9,13 +9,13 @@
text-align: center;
vertical-align: middle;
padding: 1em;
- background-color: rgba(60, 60, 60, 0.8);
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
overflow-y: hidden;
animation: dimmerFadeIn 0.5s;
+ background-color: rgba(get("colors.gray.800"), 0.7);
@media only screen and (max-height: 483px) {
overflow-y: scroll;
@@ -25,10 +25,10 @@
@keyframes dimmerFadeIn {
from {
- background-color: rgba(60, 60, 60, 0.1);
+ background-color: rgba(get("colors.gray.800"), 0.1);
}
to {
- background-color: rgba(60, 60, 60, 0.8);
+ background-color: rgba(get("colors.gray.800"), 0.7);
}
}
@@ -49,33 +49,31 @@
background: #fff;
border: none;
border-radius: 3px;
- -webkit-box-shadow: 1px 3px 3px 0 rgba(0, 0, 0, 0.2), 1px 3px 15px 2px rgba(0, 0, 0, 0.2);
- box-shadow: 1px 3px 3px 0 rgba(0, 0, 0, 0.2), 1px 3px 15px 2px rgba(0, 0, 0, 0.2);
animation: windowfadeIn 0.5s;
- &.m-small {
+ &--small {
width: 100%;
- @include media(">=md") {
+ @include media("md") {
width: 500px;
}
}
- &.m-large {
+ &--large {
width: 100%;
- @include media(">=md") {
+ @include media("md") {
width: 750px;
}
}
- &.m-center {
+ &--center {
text-align: center;
}
.c-modal-header {
- font-size: $font-size-large;
+ font-size: get("font.size.lg");
font-weight: 600;
padding: 15px 20px;
- border-bottom: 1px solid $gray-200;
+ border-bottom: 1px solid get("colors.gray.200");
}
.c-modal-content {
@@ -83,18 +81,18 @@
}
.c-modal-footer {
- background: $gray-100;
+ background: get("colors.gray.100");
padding: 10px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
- border-top: 1px solid $gray-300;
- &.m-right {
+ border-top: 1px solid get("colors.gray.300");
+ &--right {
text-align: right;
}
- &.m-center {
+ &--center {
text-align: center;
}
- &.m-left {
+ &--left {
text-align: left;
}
}
diff --git a/public/components/common/Modal.tsx b/public/components/common/Modal.tsx
index fe359b5bc..df1a0f0c2 100644
--- a/public/components/common/Modal.tsx
+++ b/public/components/common/Modal.tsx
@@ -55,8 +55,8 @@ const ModalWindow: React.FunctionComponent<ModalWindowProps> = (props) => {
const className = classSet({
"c-modal-window": true,
[`${props.className}`]: !!props.className,
- "m-center": props.center,
- [`m-${props.size}`]: true,
+ "c-modal-window--center": props.center,
+ [`c-modal-window--${props.size}`]: true,
})
return ReactDOM.createPortal(
@@ -81,7 +81,7 @@ const Footer = (props: ModalFooterProps) => {
const align = props.align || "right"
const className = classSet({
"c-modal-footer": true,
- [`m-${align}`]: true,
+ [`c-modal-footer--${align}`]: true,
})
return <div className={className}>{props.children}</div>
}
diff --git a/public/components/common/PageTitle.tsx b/public/components/common/PageTitle.tsx
new file mode 100644
index 000000000..ae199cb5d
--- /dev/null
+++ b/public/components/common/PageTitle.tsx
@@ -0,0 +1,22 @@
+import React from "react"
+import { classSet } from "@fider/services"
+
+interface PageTitleLogo {
+ title: string
+ subtitle?: string
+ className?: string
+}
+
+export const PageTitle = (props: PageTitleLogo) => {
+ const className = classSet({
+ "mb-4": true,
+ [`${props.className}`]: props.className,
+ })
+
+ return (
+ <div className={className}>
+ <div className="text-display2 mb-1">{props.title}</div>
+ <div className="text-gray-700">{props.subtitle}</div>
+ </div>
+ )
+}
diff --git a/public/components/common/PoweredByFider.scss b/public/components/common/PoweredByFider.scss
index 49202b402..8b5bc3582 100644
--- a/public/components/common/PoweredByFider.scss
+++ b/public/components/common/PoweredByFider.scss
@@ -2,14 +2,12 @@
.c-powered {
text-align: center;
- display: block;
- margin-top: 20px;
a {
- color: rgba($gray-900, 0.6);
- font-size: $font-size-tiny;
+ color: get("colors.gray.700");
+ font-size: 11px;
}
a:hover {
- color: $gray-900;
+ color: get("colors.gray.900");
}
-}
\ No newline at end of file
+}
diff --git a/public/components/common/PoweredByFider.tsx b/public/components/common/PoweredByFider.tsx
index a7a445c5b..42701aaae 100644
--- a/public/components/common/PoweredByFider.tsx
+++ b/public/components/common/PoweredByFider.tsx
@@ -2,9 +2,13 @@ import React from "react"
import "./PoweredByFider.scss"
-export const PoweredByFider = () => {
+interface PoweredByFiderProps {
+ className: string
+}
+
+export const PoweredByFider = (props: PoweredByFiderProps) => {
return (
- <div className="c-powered">
+ <div className={`c-powered ${props.className}`}>
<a rel="noopener" href="https://getfider.com" target="_blank">
Powered by Fider
</a>
diff --git a/public/components/common/Segment.scss b/public/components/common/Segment.scss
deleted file mode 100644
index 61084737d..000000000
--- a/public/components/common/Segment.scss
+++ /dev/null
@@ -1,45 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-segment {
- position: relative;
- padding: 15px;
- margin: 10px 0;
- background-color: $white;
- border-radius: 5px;
- box-shadow: 0px 2px 5px 0px $gray-300;
- transition: all 0.2s ease;
-
- &:hover {
- box-shadow: 0px 5px 10px 0px $gray-300;
- }
-
- &:first-child {
- margin-top: 0em;
- }
-}
-
-.c-segments {
- position: relative;
- box-shadow: 0px 2px 5px 0px $gray-300;
- border-radius: 5px;
- margin: 10px 0;
- transition: all 0.2s ease;
-
- &:hover {
- box-shadow: 0px 5px 10px 0px $gray-300;
- }
-
- &:first-child {
- margin-top: 0em;
- }
-
- .c-segment {
- margin: 0;
- box-shadow: none;
- border: none;
- border-bottom: 0.1px solid rgba(34, 36, 38, 0.15);
- &:last-child {
- border-bottom: none;
- }
- }
-}
diff --git a/public/components/common/Segment.tsx b/public/components/common/Segment.tsx
deleted file mode 100644
index b9f23235a..000000000
--- a/public/components/common/Segment.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import "./Segment.scss"
-
-import React from "react"
-
-interface SegmentProps {
- className?: string
-}
-
-export const Segments: React.FunctionComponent<SegmentProps> = (props) => {
- return <div className={`c-segments ${props.className || ""}`}>{props.children}</div>
-}
-
-export const Segment: React.FunctionComponent<SegmentProps> = (props) => {
- return <div className={`c-segment ${props.className || ""}`}>{props.children}</div>
-}
diff --git a/public/components/common/SignInControl.scss b/public/components/common/SignInControl.scss
index 57533e486..9d9b2e589 100644
--- a/public/components/common/SignInControl.scss
+++ b/public/components/common/SignInControl.scss
@@ -1,15 +1,9 @@
@import "~@fider/assets/styles/variables.scss";
.c-signin-control {
- text-align: center;
- .col-lf {
- width: 100%;
- }
- .l-social-col {
- padding: 10px 5px;
- max-width: 50%;
- }
- .l-social-col-100 {
- width: 100%;
+ &__oauth {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: spacing(2);
}
}
diff --git a/public/components/common/SignInControl.tsx b/public/components/common/SignInControl.tsx
index d19b0b215..90541dc05 100644
--- a/public/components/common/SignInControl.tsx
+++ b/public/components/common/SignInControl.tsx
@@ -2,6 +2,7 @@ import "./SignInControl.scss"
import React, { useState } from "react"
import { SocialSignInButton, Form, Button, Input, Message } from "@fider/components"
+import { Divider } from "@fider/components/layout"
import { device, actions, Failure, isCookieEnabled } from "@fider/services"
import { useFider } from "@fider/hooks"
@@ -34,7 +35,7 @@ export const SignInControl: React.FunctionComponent<SignInControlProps> = (props
if (!isCookieEnabled()) {
return (
<Message type="error">
- <h3>Cookies Required</h3>
+ <h3 className="text-display">Cookies Required</h3>
<p>Cookies are not enabled on your browser. Please enable cookies in your browser preferences to continue.</p>
</Message>
)
@@ -43,25 +44,22 @@ export const SignInControl: React.FunctionComponent<SignInControlProps> = (props
return (
<div className="c-signin-control">
{providersLen > 0 && (
- <div className="l-signin-social">
- <div className="row">
- {fider.settings.oauth.map((o, i) => (
+ <>
+ <div className="c-signin-control__oauth mb-2">
+ {fider.settings.oauth.map((o) => (
<React.Fragment key={o.provider}>
- {i % 4 === 0 && <div className="col-lf" />}
- <div className={`col-sm l-provider-${o.provider} l-social-col ${providersLen === 1 ? "l-social-col-100" : ""}`}>
- <SocialSignInButton option={o} redirectTo={props.redirectTo} />
- </div>
+ <SocialSignInButton option={o} redirectTo={props.redirectTo} />
</React.Fragment>
))}
</div>
- <p className="info">We will never post to these accounts on your behalf.</p>
- </div>
+ <p className="text-muted">We will never post to these accounts on your behalf.</p>
+ </>
)}
- {providersLen > 0 && <div className="c-divider">OR</div>}
+ {providersLen > 0 && <Divider />}
{props.useEmail && (
- <div className="l-signin-email">
+ <div>
<p>Enter your email address to sign in</p>
<Form error={error}>
<Input
@@ -71,7 +69,7 @@ export const SignInControl: React.FunctionComponent<SignInControlProps> = (props
onChange={setEmail}
placeholder="[email protected]"
suffix={
- <Button type="submit" color="positive" disabled={email === ""} onClick={signIn}>
+ <Button type="submit" variant="primary" disabled={email === ""} onClick={signIn}>
Sign in
</Button>
}
diff --git a/public/components/common/SocialSignInButton.tsx b/public/components/common/SocialSignInButton.tsx
index 286abb878..5e14ee5b8 100644
--- a/public/components/common/SocialSignInButton.tsx
+++ b/public/components/common/SocialSignInButton.tsx
@@ -1,6 +1,5 @@
import React from "react"
-import { Button, OAuthProviderLogo } from "@fider/components/common"
-import { classSet } from "@fider/services"
+import { Button, OAuthProviderLogo } from "@fider/components"
interface SocialSignInButtonProps {
option: {
@@ -10,19 +9,16 @@ interface SocialSignInButtonProps {
logoBlobKey?: string
logoURL?: string
}
+ className?: string
redirectTo?: string
}
export const SocialSignInButton = (props: SocialSignInButtonProps) => {
const redirectTo = props.redirectTo || window.location.href
const href = props.option.url ? `${props.option.url}?redirect=${redirectTo}` : undefined
- const className = classSet({
- "m-social": true,
- [`m-${props.option.provider}`]: props.option.provider,
- })
return (
- <Button href={href} rel="nofollow" fluid={true} className={className}>
+ <Button href={href} rel="nofollow" className={props.className}>
{props.option.logoURL ? <img alt={props.option.displayName} src={props.option.logoURL} /> : <OAuthProviderLogo option={props.option} />}
<span>{props.option.displayName}</span>
</Button>
diff --git a/public/components/common/Toggle.scss b/public/components/common/Toggle.scss
index a62d45dd2..81da5b608 100644
--- a/public/components/common/Toggle.scss
+++ b/public/components/common/Toggle.scss
@@ -1,54 +1,43 @@
@import "~@fider/assets/styles/variables.scss";
+@mixin transition {
+ transition-duration: 0.2s;
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
+ transition-property: background-color, transform;
+}
+
.c-toggle {
+ padding: 0;
+ position: relative;
+ display: inline-flex;
+ height: sizing(4);
+ width: sizing(8);
+ border: 2px solid transparent;
+ background-color: get("colors.gray.200");
+ border-radius: 50px;
cursor: pointer;
+ @include transition();
- &.m-disabled {
- cursor: not-allowed;
- label {
- cursor: not-allowed;
- }
- }
-
- input {
- display: none;
- }
-
- .text {
- margin-left: 5px;
- vertical-align: middle;
- }
-
- label {
+ span {
+ pointer-events: none;
+ height: sizing(3);
+ width: sizing(3);
display: inline-block;
- vertical-align: middle;
- width: 30px;
- height: 15px;
- border-radius: 10px;
- position: relative;
- cursor: pointer;
- background: $gray-300;
+ border-radius: 50px;
+ background-color: get("colors.white");
+ transform: matrix(1, 0, 0, 1, 0, 0);
+ @include transition();
}
- .switch {
- position: absolute;
- width: 13px;
- height: 13px;
- margin-top: 1px;
- margin-left: 1px;
- border-radius: 1em;
- box-shadow: 0px 1px 5px 0px $gray-500;
- background: $gray-100;
- transition: transform 0.2s ease-in;
+ &--disabled {
+ @include disabled();
}
- input:checked ~ label {
- background: $green-500;
- }
+ &--enabled {
+ background-color: get("colors.green.600");
- input:checked ~ label .switch {
- background: $gray-100;
- transform: translatex(15px);
- transition: transform 0.2s ease-in;
+ span {
+ transform: matrix(1, 0, 0, 1, 16, 0);
+ }
}
}
diff --git a/public/components/common/Toggle.tsx b/public/components/common/Toggle.tsx
index 1f8f0dde4..c86d670a2 100644
--- a/public/components/common/Toggle.tsx
+++ b/public/components/common/Toggle.tsx
@@ -2,6 +2,7 @@ import "./Toggle.scss"
import React, { useState } from "react"
import { classSet } from "@fider/services"
+import { HStack } from "../layout"
interface ToggleProps {
label?: string
@@ -10,7 +11,7 @@ interface ToggleProps {
onToggle?: (active: boolean) => void
}
-export const Toggle: React.StatelessComponent<ToggleProps> = (props) => {
+export const Toggle: React.FC<ToggleProps> = (props) => {
const [active, setActive] = useState(props.active)
const toggle = () => {
@@ -27,16 +28,16 @@ export const Toggle: React.StatelessComponent<ToggleProps> = (props) => {
const className = classSet({
"c-toggle": true,
- "m-disabled": !!props.disabled,
+ "c-toggle--enabled": active,
+ "c-toggle--disabled": !!props.disabled,
})
return (
- <span className={className} onClick={toggle}>
- <input type="checkbox" checked={active} readOnly={true} />
- <label>
- <span className="switch" />
- </label>
- <span className="text">{!!props.label && props.label}</span>
- </span>
+ <HStack spacing={2}>
+ <button onClick={toggle} type="button" className={className} role="switch">
+ <span aria-hidden="true" className="shadow"></span>
+ </button>
+ {props.label && <span className="text-sm">{props.label}</span>}
+ </HStack>
)
}
diff --git a/public/components/common/UserName.scss b/public/components/common/UserName.scss
index 5525f5c2e..aaa8a796b 100644
--- a/public/components/common/UserName.scss
+++ b/public/components/common/UserName.scss
@@ -1,14 +1,14 @@
@import "~@fider/assets/styles/variables.scss";
.c-username {
- color: $gray-900;
+ color: get("colors.gray.900");
font-weight: 600;
display: inline-flex;
align-items: center;
- &.m-staff {
- color: $admin-color;
- border-color: $admin-color;
+ &--staff {
+ color: get("colors.primary.base");
+ border-color: get("colors.primary.base");
div {
svg {
diff --git a/public/components/common/UserName.tsx b/public/components/common/UserName.tsx
index 354e4fe6d..8559d3bd0 100644
--- a/public/components/common/UserName.tsx
+++ b/public/components/common/UserName.tsx
@@ -16,7 +16,7 @@ export const UserName = (props: UserNameProps) => {
const isStaff = props.user.role && isCollaborator(props.user.role)
const className = classSet({
"c-username": true,
- "m-staff": isStaff,
+ "c-username--staff": isStaff,
})
return (
diff --git a/public/components/common/form/Checkbox.scss b/public/components/common/form/Checkbox.scss
new file mode 100644
index 000000000..19e0cc0c9
--- /dev/null
+++ b/public/components/common/form/Checkbox.scss
@@ -0,0 +1,24 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-checkbox input {
+ margin: 0px;
+ appearance: none;
+ border: 1px solid get("colors.gray.300");
+ height: sizing(4);
+ width: sizing(4);
+ color: get("colors.primary.base");
+ -webkit-appearance: none;
+ appearance: none;
+
+ &:checked {
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
+ }
+
+ &:checked {
+ border-color: transparent;
+ background-color: currentColor;
+ background-size: 100% 100%;
+ background-position: center;
+ background-repeat: no-repeat;
+ }
+}
diff --git a/public/components/common/form/Checkbox.tsx b/public/components/common/form/Checkbox.tsx
index 4fea69a14..2beb68e03 100644
--- a/public/components/common/form/Checkbox.tsx
+++ b/public/components/common/form/Checkbox.tsx
@@ -1,11 +1,14 @@
import React, { useState } from "react"
import { classSet } from "@fider/services"
import { DisplayError, ValidationContext, hasError } from "../"
+import { HStack } from "@fider/components/layout"
+
+import "./Checkbox.scss"
interface CheckboxProps {
field: string
checked?: boolean
- onChange: (checked: boolean) => void
+ onChange?: (checked: boolean) => void
}
export const Checkbox: React.FC<CheckboxProps> = (props) => {
@@ -15,7 +18,9 @@ export const Checkbox: React.FC<CheckboxProps> = (props) => {
const isChecked: boolean = e.currentTarget.checked
setChecked(isChecked)
- props.onChange(isChecked)
+ if (props.onChange) {
+ props.onChange(isChecked)
+ }
}
return (
@@ -23,15 +28,19 @@ export const Checkbox: React.FC<CheckboxProps> = (props) => {
{(ctx) => (
<div
className={classSet({
- "c-form-field m-checkbox": true,
+ "c-form-field": true,
"m-error": hasError(props.field, ctx.error),
})}
>
- <label htmlFor={`input-${props.field}`}>
- <input id={`input-${props.field}`} type="checkbox" checked={checked} onChange={onChange} />
- {props.children}
- </label>
- <DisplayError fields={[props.field]} error={ctx.error} />
+ <div className="c-checkbox">
+ <HStack>
+ <input id={`input-${props.field}`} type="checkbox" checked={checked} onChange={onChange} />
+ <label htmlFor={`input-${props.field}`} className="text-sm">
+ {props.children}
+ </label>
+ </HStack>
+ <DisplayError fields={[props.field]} error={ctx.error} />
+ </div>
</div>
)}
</ValidationContext.Consumer>
diff --git a/public/components/common/form/DisplayError.scss b/public/components/common/form/DisplayError.scss
new file mode 100644
index 000000000..548c8b5ec
--- /dev/null
+++ b/public/components/common/form/DisplayError.scss
@@ -0,0 +1,11 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-form-error {
+ color: get("colors.red.600");
+ font-size: get("font.size.sm");
+ ul {
+ list-style: none;
+ padding-left: sizing(1);
+ margin: 0;
+ }
+}
diff --git a/public/components/common/form/DisplayError.spec.tsx b/public/components/common/form/DisplayError.spec.tsx
index 39dfe35d8..6808853b0 100644
--- a/public/components/common/form/DisplayError.spec.tsx
+++ b/public/components/common/form/DisplayError.spec.tsx
@@ -19,7 +19,7 @@ describe("<DisplayError />", () => {
const wrapper = shallow(<DisplayError error={error} />)
const root = wrapper.find("div")
- expect(root.hasClass("c-form-field-error")).toBe(true)
+ expect(root.hasClass("c-form-error")).toBe(true)
const items = root.find("ul li")
expect(items).toHaveLength(1)
expect(items.at(0).key()).toBe("Something went wrong.")
@@ -47,7 +47,7 @@ describe("<DisplayError />", () => {
const wrapper1 = shallow(<DisplayError error={error} fields={["name"]} />)
const root1 = wrapper1.find("div")
- expect(root1.hasClass("c-form-field-error")).toBe(true)
+ expect(root1.hasClass("c-form-error")).toBe(true)
const items1 = root1.find("ul li")
expect(items1).toHaveLength(2)
expect(items1.at(0).key()).toBe("Name is required")
@@ -57,7 +57,7 @@ describe("<DisplayError />", () => {
const wrapper2 = shallow(<DisplayError error={error} fields={["age"]} />)
const root2 = wrapper2.find("div")
- expect(root2.hasClass("c-form-field-error")).toBe(true)
+ expect(root2.hasClass("c-form-error")).toBe(true)
const items2 = root2.find("ul li")
expect(items2).toHaveLength(1)
expect(items2.at(0).key()).toBe("Age must be >= 18")
@@ -65,7 +65,7 @@ describe("<DisplayError />", () => {
const wrapper3 = shallow(<DisplayError error={error} fields={["name", "age"]} />)
const root3 = wrapper3.find("div")
- expect(root3.hasClass("c-form-field-error")).toBe(true)
+ expect(root3.hasClass("c-form-error")).toBe(true)
const items3 = root3.find("ul li")
expect(items3).toHaveLength(3)
expect(items3.at(0).key()).toBe("Name is required")
diff --git a/public/components/common/form/DisplayError.tsx b/public/components/common/form/DisplayError.tsx
index cc18297c0..b5a2a7b63 100644
--- a/public/components/common/form/DisplayError.tsx
+++ b/public/components/common/form/DisplayError.tsx
@@ -1,6 +1,8 @@
import React from "react"
import { Failure } from "@fider/services"
+import "./DisplayError.scss"
+
const arrayToTag = (items: string[]) => {
return items.map((m) => <li key={m}>{m}</li>)
}
@@ -46,7 +48,7 @@ export const DisplayError = (props: DisplayErrorProps) => {
}
return items.length > 0 ? (
- <div className={`c-form-field-error`}>
+ <div className={`c-form-error`}>
<ul>{items}</ul>
</div>
) : null
diff --git a/public/components/common/form/Form.scss b/public/components/common/form/Form.scss
index 6c6edccfb..8f316e230 100644
--- a/public/components/common/form/Form.scss
+++ b/public/components/common/form/Form.scss
@@ -1,167 +1,16 @@
@import "~@fider/assets/styles/variables.scss";
-.c-form {
- position: relative;
- max-width: 100%;
-
- &.m-mini {
- font-size: 80%;
- input[type="text"],
- textarea,
- select {
- padding: 8px;
- }
- }
-}
-
.c-form-field {
- clear: both;
- margin: 0 0 10px;
+ margin-bottom: spacing(2);
- &.m-checkbox {
- label {
- font-weight: initial;
- }
- input[type="checkbox"] {
- vertical-align: middle;
- margin: 0 5px 3px 0;
- }
- }
-
- label {
+ > label {
display: block;
- margin: 0 0 5px;
- font-weight: 600;
-
- .info {
- padding: 5px 0px 0px 5px;
- }
- .info.clickable {
- color: $link-color;
- }
- }
-
- .c-form-field-wrapper {
- position: relative;
- margin: 0 0 5px;
- }
-
- input[type="text"],
- textarea,
- select {
- background-color: $white;
- -webkit-appearance: none;
- appearance: none;
- width: 100%;
- padding: 8px;
- margin: 0;
- resize: none !important;
- border: 1px solid $gray-300;
- border-radius: 3px;
-
-
- &:disabled {
- opacity: 0.45;
- cursor: not-allowed;
- }
-
- & + .icon {
- pointer-events: none;
- cursor: default;
- position: absolute;
- opacity: 0.5;
- width: 35px;
- height: 100%;
- padding: 12px 0px;
- margin: 0;
- top: 0;
- right: 0;
- position: absolute;
-
- &.link {
- cursor: pointer;
- pointer-events: inherit;
- }
- }
+ font-size: get("font.size.sm");
+ margin-bottom: spacing(1);
+ font-weight: 500;
}
- &.m-error {
- input[type="text"],
- textarea,
- select {
- border-color: $red-500;
- }
-
- label {
- color: $red-500;
- }
+ &:last-child {
+ margin-bottom: 0;
}
-
- &.m-icon {
- input[type="text"] {
- padding-right: 35px;
- }
- }
-
- &.m-suffix {
- .c-form-field-wrapper {
- display: inline-flex;
- width: 100%;
- }
- .c-button {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- }
- input[type="text"] {
- max-width: 100%;
- width: auto;
- flex: 1 0 auto;
- border-top-right-radius: 0px;
- border-bottom-right-radius: 0px;
- }
- .c-form-input-suffix {
- line-height: 20px;
- flex: 0 0 auto;
- padding: 8px 10px 9px 10px;
- font-weight: 600;
- background-color: $gray-200;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- }
- }
-
- .c-form-radio-option {
- label {
- display: inline-block;
- margin-left: 5px;
- font-size: $font-size-small;
- font-weight: 500;
- cursor: pointer;
- }
- }
-}
-
-.c-form-field-error {
- color: $red-400;
- font-weight: bold;
- font-size: $font-size-small;
- margin: 0 0 10px 0;
- ul {
- list-style: none;
- padding-left: 5px;
- margin: 0;
- }
-}
-
-::placeholder {
- color: $gray-500;
- opacity: 1;
-}
-
-:-ms-input-placeholder {
- color: $gray-500;
-}
-
-::-ms-input-placeholder {
- color: $gray-500;
}
diff --git a/public/components/common/form/Form.tsx b/public/components/common/form/Form.tsx
index b2a397a9b..c751c97d2 100644
--- a/public/components/common/form/Form.tsx
+++ b/public/components/common/form/Form.tsx
@@ -10,7 +10,6 @@ interface ValidationContext {
interface FormProps {
className?: string
- size?: "mini" | "normal"
error?: Failure
}
@@ -20,7 +19,6 @@ export const Form: React.FunctionComponent<FormProps> = (props) => {
const className = classSet({
"c-form": true,
[props.className || ""]: props.className,
- [`m-${props.size}`]: props.size,
})
return (
diff --git a/public/components/common/form/ImageUploader.scss b/public/components/common/form/ImageUploader.scss
index a6683e392..93ae455fd 100644
--- a/public/components/common/form/ImageUploader.scss
+++ b/public/components/common/form/ImageUploader.scss
@@ -5,13 +5,6 @@
display: none;
}
- .c-form-field-wrapper {
- .c-button {
- font-size: $font-size-big;
- padding: 4px 8px;
- }
- }
-
.preview {
position: relative;
display: inline-block;
@@ -19,15 +12,13 @@
padding: 5px;
min-width: 50px;
min-height: 50px;
- border: 1px solid $gray-300;
+ border: 1px solid get("colors.gray.300");
cursor: pointer;
}
.c-button {
- font-weight: 600;
position: absolute;
- border-color: $red-400;
top: 4px;
- right: 0px;
+ right: 4px;
border-radius: 50%;
padding: 4px 6px;
}
diff --git a/public/components/common/form/ImageUploader.tsx b/public/components/common/form/ImageUploader.tsx
index 8d4019875..fb038e9c7 100644
--- a/public/components/common/form/ImageUploader.tsx
+++ b/public/components/common/form/ImageUploader.tsx
@@ -4,9 +4,9 @@ import React from "react"
import { ValidationContext } from "./Form"
import { DisplayError, hasError } from "./DisplayError"
import { classSet, fileToBase64, uploadedImageURL } from "@fider/services"
-import { Button, Modal } from "@fider/components"
-import { FaRegImage } from "react-icons/fa"
+import { Button, Icon, Modal } from "@fider/components"
import { ImageUpload } from "@fider/models"
+import IconPhotograph from "@fider/assets/images/heroicons-photograph.svg"
const hardFileSizeLimit = 5 * 1024 * 1024
@@ -16,7 +16,6 @@ interface ImageUploaderProps {
label?: string
bkey?: string
disabled?: boolean
- previewMaxWidth: number
onChange(state: ImageUpload, instanceID?: string, previewURL?: string): void
}
@@ -34,7 +33,7 @@ export class ImageUploader extends React.Component<ImageUploaderProps, ImageUplo
upload: undefined,
remove: false,
showModal: false,
- previewURL: uploadedImageURL(this.props.bkey, this.props.previewMaxWidth),
+ previewURL: uploadedImageURL(this.props.bkey),
}
}
@@ -111,7 +110,7 @@ export class ImageUploader extends React.Component<ImageUploaderProps, ImageUplo
<Modal.Content>{this.props.bkey ? <img alt="" src={uploadedImageURL(this.props.bkey)} /> : <img alt="" src={this.state.previewURL} />}</Modal.Content>
<Modal.Footer>
- <Button color="cancel" onClick={this.closeModal}>
+ <Button variant="tertiary" onClick={this.closeModal}>
Close
</Button>
</Modal.Footer>
@@ -123,10 +122,6 @@ export class ImageUploader extends React.Component<ImageUploaderProps, ImageUplo
const isUploading = !!this.state.upload
const hasFile = (!this.state.remove && this.props.bkey) || isUploading
- const imgStyles: React.CSSProperties = {
- maxWidth: `${this.props.previewMaxWidth}px`,
- }
-
return (
<ValidationContext.Consumer>
{(ctx) => (
@@ -138,13 +133,13 @@ export class ImageUploader extends React.Component<ImageUploaderProps, ImageUplo
})}
>
{this.modal()}
- <label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>
+ {this.props.label && <label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>}
{hasFile && (
- <div className="preview">
- <img alt="" onClick={this.openModal} src={this.state.previewURL} style={imgStyles} />
+ <div className="preview h-20">
+ <img alt="" onClick={this.openModal} src={this.state.previewURL} />
{!this.props.disabled && (
- <Button onClick={this.removeFile} color="danger">
+ <Button onClick={this.removeFile} variant="danger">
X
</Button>
)}
@@ -152,14 +147,12 @@ export class ImageUploader extends React.Component<ImageUploaderProps, ImageUplo
)}
<input ref={(e) => (this.fileSelector = e)} type="file" onChange={this.fileChanged} accept="image/*" />
- <DisplayError fields={[this.props.field]} error={ctx.error} />
{!hasFile && (
- <div className="c-form-field-wrapper">
- <Button onClick={this.selectFile} disabled={this.props.disabled}>
- <FaRegImage />
- </Button>
- </div>
+ <Button onClick={this.selectFile} disabled={this.props.disabled}>
+ <Icon sprite={IconPhotograph} />
+ </Button>
)}
+ <DisplayError fields={[this.props.field]} error={ctx.error} />
{this.props.children}
</div>
)}
diff --git a/public/components/common/form/ImageViewer.tsx b/public/components/common/form/ImageViewer.tsx
index 160079b64..0b571a1d8 100644
--- a/public/components/common/form/ImageViewer.tsx
+++ b/public/components/common/form/ImageViewer.tsx
@@ -52,7 +52,7 @@ export class ImageViewer extends React.Component<ImageViewerProps, ImageViewerSt
</Modal.Content>
<Modal.Footer>
- <Button color="cancel" onClick={this.closeModal}>
+ <Button variant="tertiary" onClick={this.closeModal}>
Close
</Button>
</Modal.Footer>
diff --git a/public/components/common/form/Input.scss b/public/components/common/form/Input.scss
new file mode 100644
index 000000000..78525299b
--- /dev/null
+++ b/public/components/common/form/Input.scss
@@ -0,0 +1,52 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-input {
+ line-height: get("font.size.xl");
+ background-color: get("colors.white");
+ width: 100%;
+ padding: sizing(2);
+ border: 1px solid get("colors.gray.300");
+ border-radius: get("border.radius.medium");
+ -webkit-appearance: none;
+ appearance: none;
+
+ &:disabled {
+ @include disabled();
+ }
+
+ & + svg,
+ & + img {
+ position: absolute;
+ position: absolute;
+ width: 36px;
+ padding: spacing(2);
+ margin: 0;
+ right: 0;
+ }
+
+ &__suffix {
+ display: flex;
+ align-items: center;
+ background-color: get("colors.gray.200");
+ padding: spacing(2);
+ border-top-right-radius: get("border.radius.medium");
+ border-bottom-right-radius: get("border.radius.medium");
+ }
+
+ &--icon {
+ padding-right: spacing(8);
+ }
+
+ &--error {
+ border-color: get("colors.red.600");
+ }
+
+ &--suffixed {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ & + * {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ }
+ }
+}
diff --git a/public/components/common/form/Input.tsx b/public/components/common/form/Input.tsx
index a3eab1c1b..81e0fdd93 100644
--- a/public/components/common/form/Input.tsx
+++ b/public/components/common/form/Input.tsx
@@ -2,7 +2,10 @@ import React from "react"
import { classSet } from "@fider/services"
import { ValidationContext } from "./Form"
import { DisplayError, hasError } from "./DisplayError"
-import { IconType } from "react-icons"
+import { Icon } from "@fider/components"
+
+import "./Input.scss"
+import { HStack } from "@fider/components/layout"
interface InputProps {
field: string
@@ -12,7 +15,7 @@ interface InputProps {
autoFocus?: boolean
noTabFocus?: boolean
afterLabel?: JSX.Element
- icon?: IconType
+ icon?: SpriteSymbol
maxLength?: number
value?: string
disabled?: boolean
@@ -31,14 +34,9 @@ export const Input: React.FunctionComponent<InputProps> = (props) => {
}
}
- const suffix = typeof props.suffix === "string" ? <span className="c-form-input-suffix">{props.suffix}</span> : props.suffix
+ const suffix = typeof props.suffix === "string" ? <span className="c-input__suffix">{props.suffix}</span> : props.suffix
- const icon = props.icon
- ? React.createElement(props.icon, {
- onClick: props.onIconClick,
- className: classSet({ link: !!props.onIconClick }),
- })
- : undefined
+ const icon = props.icon ? <Icon sprite={props.icon} onClick={props.onIconClick} className={classSet({ clickable: !!props.onIconClick })} /> : undefined
return (
<ValidationContext.Consumer>
@@ -46,9 +44,6 @@ export const Input: React.FunctionComponent<InputProps> = (props) => {
<div
className={classSet({
"c-form-field": true,
- "m-suffix": props.suffix,
- "m-error": hasError(props.field, ctx.error),
- "m-icon": !!props.icon,
[`${props.className}`]: props.className,
})}
>
@@ -58,8 +53,14 @@ export const Input: React.FunctionComponent<InputProps> = (props) => {
{props.afterLabel}
</label>
)}
- <div className="c-form-field-wrapper">
+ <HStack spacing={0} center={!!props.icon} className="relative">
<input
+ className={classSet({
+ "c-input": true,
+ "c-input--icon": !!props.icon,
+ "c-input--error": hasError(props.field, ctx.error),
+ "c-input--suffixed": !!suffix,
+ })}
id={`input-${props.field}`}
type="text"
autoComplete={props.autoComplete}
@@ -75,7 +76,7 @@ export const Input: React.FunctionComponent<InputProps> = (props) => {
/>
{icon}
{suffix}
- </div>
+ </HStack>
<DisplayError fields={[props.field]} error={ctx.error} />
{props.children}
</div>
diff --git a/public/components/common/form/MultiImageUploader.tsx b/public/components/common/form/MultiImageUploader.tsx
index f66de2d58..e9cb8f3d0 100644
--- a/public/components/common/form/MultiImageUploader.tsx
+++ b/public/components/common/form/MultiImageUploader.tsx
@@ -10,7 +10,6 @@ interface MultiImageUploaderProps {
field: string
maxUploads: number
bkeys?: string[]
- previewMaxWidth: number
onChange?: (uploads: ImageUpload[]) => void
}
@@ -82,9 +81,7 @@ export class MultiImageUploader extends React.Component<MultiImageUploaderProps,
private addNewElement(instances: MultiImageUploaderInstances, bkey?: string) {
const id = btoa(Math.random().toString())
instances[id] = {
- element: (
- <ImageUploader key={id} bkey={bkey} instanceID={id} field="attachment" previewMaxWidth={this.props.previewMaxWidth} onChange={this.imageUploaded} />
- ),
+ element: <ImageUploader key={id} bkey={bkey} instanceID={id} field="attachment" onChange={this.imageUploaded} />,
}
}
diff --git a/public/components/common/form/RadioButton.scss b/public/components/common/form/RadioButton.scss
new file mode 100644
index 000000000..a57f45543
--- /dev/null
+++ b/public/components/common/form/RadioButton.scss
@@ -0,0 +1,25 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-radiobutton input {
+ margin: 0px;
+ appearance: none;
+ border: 1px solid get("colors.gray.300");
+ height: sizing(4);
+ width: sizing(4);
+ color: get("colors.primary.base");
+ border-radius: get("border.radius.full");
+ -webkit-appearance: none;
+ appearance: none;
+
+ &:checked {
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
+ }
+
+ &:checked {
+ border-color: transparent;
+ background-color: currentColor;
+ background-size: 100% 100%;
+ background-position: center;
+ background-repeat: no-repeat;
+ }
+}
diff --git a/public/components/common/form/RadioButton.tsx b/public/components/common/form/RadioButton.tsx
index f4bda7335..9c4a0a8ba 100644
--- a/public/components/common/form/RadioButton.tsx
+++ b/public/components/common/form/RadioButton.tsx
@@ -1,5 +1,8 @@
+import { HStack, VStack } from "@fider/components/layout"
import React from "react"
+import "./RadioButton.scss"
+
interface RadioButtonOption {
value: string
label: string
@@ -36,7 +39,7 @@ export class RadioButton extends React.Component<RadioButtonProps, RadioButtonSt
public render() {
const inputs = this.props.options.map((option) => {
return (
- <div key={option.value} className="c-form-radio-option">
+ <HStack key={option.value} className="text-sm">
<input
id={`visibility-${option.value}`}
type="radio"
@@ -45,14 +48,14 @@ export class RadioButton extends React.Component<RadioButtonProps, RadioButtonSt
onChange={this.onChange.bind(this, option)}
/>
<label htmlFor={`visibility-${option.value}`}>{option.label}</label>
- </div>
+ </HStack>
)
})
return (
<div className="c-form-field">
<label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>
- {inputs}
+ <VStack className="c-radiobutton">{inputs}</VStack>
</div>
)
}
diff --git a/public/components/common/form/Select.scss b/public/components/common/form/Select.scss
new file mode 100644
index 000000000..916f66b3f
--- /dev/null
+++ b/public/components/common/form/Select.scss
@@ -0,0 +1,25 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-select {
+ background-color: get("colors.white");
+ width: 100%;
+ line-height: get("font.size.xl");
+ padding: spacing(2);
+ border: 1px solid get("colors.gray.300");
+ border-radius: get("border.radius.medium");
+ appearance: none;
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
+ background-position: right 0.5rem center;
+ background-repeat: no-repeat;
+ background-size: 1.5em 1.5em;
+ -webkit-appearance: none;
+ appearance: none;
+
+ &:disabled {
+ @include disabled();
+ }
+
+ &--error {
+ border-color: get("colors.red.600");
+ }
+}
diff --git a/public/components/common/form/Select.tsx b/public/components/common/form/Select.tsx
index 89a2d8bd3..a45323a96 100644
--- a/public/components/common/form/Select.tsx
+++ b/public/components/common/form/Select.tsx
@@ -3,6 +3,8 @@ import { classSet } from "@fider/services"
import { ValidationContext } from "./Form"
import { DisplayError, hasError } from "./DisplayError"
+import "./Select.scss"
+
export interface SelectOption {
value: string
label: string
@@ -67,18 +69,19 @@ export class Select extends React.Component<SelectProps, SelectState> {
<ValidationContext.Consumer>
{(ctx) => (
<>
- <div
- className={classSet({
- "c-form-field": true,
- "m-error": hasError(this.props.field, ctx.error),
- })}
- >
+ <div className="c-form-field">
{!!this.props.label && <label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>}
- <div className="c-form-field-wrapper">
- <select id={`input-${this.props.field}`} defaultValue={this.props.defaultValue} onChange={this.onChange}>
- {options}
- </select>
- </div>
+ <select
+ className={classSet({
+ "c-select": true,
+ "c-select--error": hasError(this.props.field, ctx.error),
+ })}
+ id={`input-${this.props.field}`}
+ defaultValue={this.props.defaultValue}
+ onChange={this.onChange}
+ >
+ {options}
+ </select>
<DisplayError fields={[this.props.field]} error={ctx.error} />
{this.props.children}
</div>
diff --git a/public/components/common/form/Select2.scss b/public/components/common/form/Select2.scss
new file mode 100644
index 000000000..d381a398b
--- /dev/null
+++ b/public/components/common/form/Select2.scss
@@ -0,0 +1,39 @@
+// NOT USED, BUT WE MIGHT NEED IN FUTURE
+
+// @import "~@fider/assets/styles/variables.scss";
+
+// .c-select2 {
+// position: relative;
+
+// &__handle {
+// font-size: get("font.size.sm");
+// line-height: 20px;
+// text-align: left;
+// background-color: get("colors.white");
+// padding: sizing(2);
+// border-radius: get("border.radius.medium");
+// border: 1px solid get("colors.gray.300");
+// }
+
+// &__list {
+// font-size: get("font.size.sm");
+// margin-top: spacing(1);
+// position: absolute;
+// overflow: auto;
+// max-height: 15rem;
+// padding: spacing(1) 0;
+// background-color: get("colors.white");
+// border-radius: get("border.radius.medium");
+// border: 1px solid get("colors.gray.300");
+// list-style-type: none;
+// z-index: 10;
+
+// li {
+// padding: spacing(2);
+// &:hover {
+// cursor: pointer;
+// background-color: get("colors.gray.200");
+// }
+// }
+// }
+// }
diff --git a/public/components/common/form/Select2.tsx b/public/components/common/form/Select2.tsx
new file mode 100644
index 000000000..df8b2ead8
--- /dev/null
+++ b/public/components/common/form/Select2.tsx
@@ -0,0 +1,68 @@
+// NOT USED, BUT WE MIGHT NEED IN FUTURE
+
+// import "./Select2.scss"
+
+// import React, { useEffect, useRef, useState } from "react"
+// import IconSelector from "@fider/assets/images/heroicons-selector.svg"
+// import { HStack } from "@fider/components/layout"
+// import { Icon } from "@fider/components"
+
+// interface Select2Props<T> {
+// items: T[]
+// itemKey: keyof T
+// onSelect: (item: T) => void
+// renderItem: (item: T) => JSX.Element
+// renderHandle: () => JSX.Element
+// }
+
+// export const Select2 = <T extends unknown>(props: Select2Props<T>) => {
+// const node = useRef<HTMLDivElement | null>(null)
+// const [isOpen, setIsOpen] = useState(false)
+
+// const toggleIsOpen = () => {
+// setIsOpen(!isOpen)
+// }
+
+// const handleClick = (e: MouseEvent) => {
+// if (node.current && node.current.contains(e.target as Node)) {
+// return
+// }
+// setIsOpen(false)
+// }
+
+// useEffect(() => {
+// document.addEventListener("mousedown", handleClick)
+
+// return () => {
+// document.removeEventListener("mousedown", handleClick)
+// }
+// }, [])
+
+// const handleChange = (i: T) => () => {
+// props.onSelect(i)
+// setIsOpen(false)
+// }
+
+// return (
+// <div ref={node} className="c-select2">
+// <button type="button" className="c-select2__handle w-full" onClick={toggleIsOpen}>
+// <HStack justify="between">
+// {props.renderHandle()}
+// <Icon sprite={IconSelector} className="h-5 w-5 text-gray-500" />
+// </HStack>
+// </button>
+// {isOpen && (
+// <ul className="c-select2__list shadow-lg w-full">
+// {props.items.map((i) => {
+// const key = (i[props.itemKey] as unknown) as string
+// return (
+// <li onClick={handleChange(i)} key={key}>
+// {props.renderItem(i)}
+// </li>
+// )
+// })}
+// </ul>
+// )}
+// </div>
+// )
+// }
diff --git a/public/components/common/form/TextArea.scss b/public/components/common/form/TextArea.scss
new file mode 100644
index 000000000..eb346e78f
--- /dev/null
+++ b/public/components/common/form/TextArea.scss
@@ -0,0 +1,20 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-textarea {
+ background-color: get("colors.white");
+ width: 100%;
+ line-height: get("font.size.xl");
+ padding: spacing(2);
+ resize: none;
+ border: 1px solid get("colors.gray.300");
+ border-radius: get("border.radius.medium");
+ -webkit-appearance: none;
+ appearance: none;
+
+ &:disabled {
+ @include disabled();
+ }
+ &--error {
+ border-color: get("colors.red.600");
+ }
+}
diff --git a/public/components/common/form/TextArea.tsx b/public/components/common/form/TextArea.tsx
index 1ea1d6e9f..b4889ed81 100644
--- a/public/components/common/form/TextArea.tsx
+++ b/public/components/common/form/TextArea.tsx
@@ -4,6 +4,8 @@ import { ValidationContext } from "../"
import { DisplayError, hasError } from "./DisplayError"
import Textarea from "react-textarea-autosize"
+import "./TextArea.scss"
+
interface TextAreaProps {
label?: string
field: string
@@ -27,25 +29,22 @@ export const TextArea: React.FunctionComponent<TextAreaProps> = (props) => {
<ValidationContext.Consumer>
{(ctx) => (
<>
- <div
- className={classSet({
- "c-form-field": true,
- "m-error": hasError(props.field, ctx.error),
- })}
- >
+ <div className="c-form-field">
{!!props.label && <label htmlFor={`input-${props.field}`}>{props.label}</label>}
- <div className="c-form-field-wrapper">
- <Textarea
- id={`input-${props.field}`}
- disabled={props.disabled}
- onChange={onChange}
- value={props.value}
- minRows={props.minRows || 3}
- placeholder={props.placeholder}
- ref={props.inputRef}
- onFocus={props.onFocus}
- />
- </div>
+ <Textarea
+ className={classSet({
+ "c-textarea": true,
+ "c-textarea--error": hasError(props.field, ctx.error),
+ })}
+ id={`input-${props.field}`}
+ disabled={props.disabled}
+ onChange={onChange}
+ value={props.value}
+ minRows={props.minRows || 3}
+ placeholder={props.placeholder}
+ ref={props.inputRef}
+ onFocus={props.onFocus}
+ />
<DisplayError fields={[props.field]} error={ctx.error} />
{props.children}
</div>
diff --git a/public/components/common/index.tsx b/public/components/common/index.tsx
index 4c23cf8fa..a7e31c5d8 100644
--- a/public/components/common/index.tsx
+++ b/public/components/common/index.tsx
@@ -10,18 +10,16 @@ export * from "./form/Select"
export * from "./form/Field"
export * from "./form/Checkbox"
export * from "./form/ImageViewer"
-export * from "./MultiLineText"
-export * from "./EnvironmentInfo"
+export * from "./Markdown"
+export * from "./DevBanner"
+export * from "./Icon"
export * from "./Avatar"
+export * from "./AvatarStack"
export * from "./Message"
export * from "./Hint"
-export * from "./Header"
-export * from "./Heading"
export * from "./Legal"
export * from "./SocialSignInButton"
export * from "./SignInControl"
-export * from "./Segment"
-export * from "./List"
export * from "./Moment"
export * from "./Modal"
export * from "./UserName"
@@ -29,8 +27,9 @@ export * from "./Loader"
export * from "./Logo"
export * from "./Toggle"
export * from "./FiderVersion"
-export * from "./DropDown"
export * from "./PoweredByFider"
+export * from "./PageTitle"
+export * from "./Dropdown"
import Textarea from "react-textarea-autosize"
export { Textarea }
diff --git a/public/components/index.tsx b/public/components/index.tsx
index 1884a5630..ac679bb2c 100644
--- a/public/components/index.tsx
+++ b/public/components/index.tsx
@@ -1,6 +1,10 @@
export * from "./ErrorBoundary"
export * from "./ShowPostResponse"
+export * from "./ShowPostStatus"
export * from "./ShowTag"
+export * from "./Header"
export * from "./SignInModal"
export * from "./VoteCounter"
+export * from "./NotificationIndicator"
+export * from "./UserMenu"
export * from "./common"
diff --git a/public/components/layout/Divider.scss b/public/components/layout/Divider.scss
new file mode 100644
index 000000000..a7c7f62c7
--- /dev/null
+++ b/public/components/layout/Divider.scss
@@ -0,0 +1,22 @@
+.c-divider {
+ display: table;
+ font-weight: 500;
+ margin: 16px 0px;
+
+ &::before,
+ &::after {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC);
+ content: "";
+ display: table-cell;
+ position: relative;
+ top: 50%;
+ width: 50%;
+ background-repeat: no-repeat;
+ }
+ &::before {
+ background-position: right 1em top 50%;
+ }
+ &::after {
+ background-position: left 1em top 50%;
+ }
+}
diff --git a/public/components/layout/Divider.tsx b/public/components/layout/Divider.tsx
new file mode 100644
index 000000000..a207800fc
--- /dev/null
+++ b/public/components/layout/Divider.tsx
@@ -0,0 +1,7 @@
+import "./Divider.scss"
+
+import React from "react"
+
+export const Divider = () => {
+ return <div className="c-divider text-gray-600">OR</div>
+}
diff --git a/public/components/layout/Stack.tsx b/public/components/layout/Stack.tsx
new file mode 100644
index 000000000..9fe6a684f
--- /dev/null
+++ b/public/components/layout/Stack.tsx
@@ -0,0 +1,41 @@
+import React from "react"
+import { classSet } from "@fider/services"
+
+interface StackProps {
+ className?: string
+ children: React.ReactNode
+ onClick?: () => void
+ center?: boolean
+ divide?: boolean
+ justify?: "between" | "evenly"
+ spacing?: 0 | 1 | 2 | 4 | 6 | 8
+}
+
+const Stack = (props: StackProps, dir: "x" | "y") => {
+ const spacing = props.spacing === undefined ? 1 : props.spacing
+ const className = classSet({
+ [`${props.className}`]: props.className,
+ flex: true,
+ "flex flex-x": dir === "x",
+ "flex flex-y": dir === "y",
+ [`flex--spacing-${spacing}`]: spacing > 0 && !props.divide,
+ [`flex--divide-${spacing}`]: spacing > 0 && !!props.divide,
+ "flex-items-center": dir === "x" && props.center !== false,
+ "justify-between": props.justify === "between",
+ "justify-evenly": props.justify === "evenly",
+ })
+
+ return (
+ <div onClick={props.onClick} className={className}>
+ {props.children}
+ </div>
+ )
+}
+
+export const HStack = (props: StackProps) => {
+ return Stack(props, "x")
+}
+
+export const VStack = (props: StackProps) => {
+ return Stack(props, "y")
+}
diff --git a/public/components/layout/index.tsx b/public/components/layout/index.tsx
new file mode 100644
index 000000000..7504f16b2
--- /dev/null
+++ b/public/components/layout/index.tsx
@@ -0,0 +1,2 @@
+export * from "./Stack"
+export * from "./Divider"
diff --git a/public/index.tsx b/public/index.tsx
index a38441d9b..6aee01f3f 100644
--- a/public/index.tsx
+++ b/public/index.tsx
@@ -1,11 +1,10 @@
+import "@fider/assets/styles/index.scss"
+
import React, { Suspense } from "react"
import ReactDOM from "react-dom"
import { resolveRootComponent } from "@fider/router"
-import { Header, Loader } from "@fider/components/common"
-import { ErrorBoundary } from "@fider/components"
+import { Header, ErrorBoundary, Loader } from "@fider/components"
import { classSet, Fider, FiderContext, actions } from "@fider/services"
-import { IconContext } from "react-icons"
-import "@fider/assets/styles/index.scss"
const Loading = () => (
<div className="page">
@@ -48,10 +47,8 @@ window.addEventListener("error", (evt: ErrorEvent) => {
<React.StrictMode>
<ErrorBoundary onError={logProductionError}>
<FiderContext.Provider value={fider}>
- <IconContext.Provider value={{ className: "icon" }}>
- {config.showHeader && <Header />}
- <Suspense fallback={<Loading />}>{React.createElement(config.component, fider.session.props)}</Suspense>
- </IconContext.Provider>
+ {config.showHeader && <Header />}
+ <Suspense fallback={<Loading />}>{React.createElement(config.component, fider.session.props)}</Suspense>
</FiderContext.Provider>
</ErrorBoundary>
</React.StrictMode>,
diff --git a/public/pages/Administration/components/AdminBasePage.scss b/public/pages/Administration/components/AdminBasePage.scss
index e24b531b1..aabb8706f 100644
--- a/public/pages/Administration/components/AdminBasePage.scss
+++ b/public/pages/Administration/components/AdminBasePage.scss
@@ -1,7 +1,11 @@
@import "~@fider/assets/styles/variables.scss";
-@include media("sm") {
- .l-admin-heading .c-heading-subtitle {
- display: none;
+.c-admin-basepage {
+ display: grid;
+ grid-template-columns: 1fr;
+ gap: spacing(4);
+
+ @include media("lg") {
+ grid-template-columns: 1fr 5fr;
}
}
diff --git a/public/pages/Administration/components/AdminBasePage.tsx b/public/pages/Administration/components/AdminBasePage.tsx
index d5e279434..72272aa4a 100644
--- a/public/pages/Administration/components/AdminBasePage.tsx
+++ b/public/pages/Administration/components/AdminBasePage.tsx
@@ -1,39 +1,28 @@
import "./AdminBasePage.scss"
import React from "react"
-import { Heading } from "@fider/components"
+import { PageTitle } from "@fider/components"
import { SideMenu, SideMenuToggler } from "./SideMenu"
-import { IconType } from "react-icons"
+import { HStack } from "@fider/components/layout"
export abstract class AdminBasePage<P, S> extends React.Component<P, S> {
public abstract id: string
public abstract name: string
- public abstract icon: IconType
public abstract title: string
public abstract subtitle: string
public abstract content(): JSX.Element
- private toggleSideMenu = (active: boolean) => {
- const el = document.querySelector(".hidden-lg .c-side-menu") as HTMLElement
- if (el) {
- el.style.display = active ? "" : "none"
- }
- }
-
public render() {
return (
<div id={this.id} className="page container">
- <Heading title={this.title} icon={this.icon} subtitle={this.subtitle} className="l-admin-heading" />
- <SideMenuToggler onToggle={this.toggleSideMenu} />
+ <HStack justify="between">
+ <PageTitle title={this.title} subtitle={this.subtitle} />
+ <SideMenuToggler />
+ </HStack>
- <div className="row">
- <div className="col-lg-2 hidden-sm hidden-md">
- <SideMenu visible={true} activeItem={this.name} />
- </div>
- <div className="col-lg-10 col-md-12">
- <SideMenu className="hidden-lg hidden-xl" visible={false} activeItem={this.name} />
- {this.content()}
- </div>
+ <div className="c-admin-basepage">
+ <SideMenu activeItem={this.name} />
+ <div>{this.content()}</div>
</div>
</div>
)
diff --git a/public/pages/Administration/components/OAuthForm.tsx b/public/pages/Administration/components/OAuthForm.tsx
index a63edc2d2..b7d29f3e6 100644
--- a/public/pages/Administration/components/OAuthForm.tsx
+++ b/public/pages/Administration/components/OAuthForm.tsx
@@ -1,8 +1,9 @@
import React, { useState } from "react"
import { OAuthConfig, OAuthConfigStatus, ImageUpload } from "@fider/models"
import { Failure, actions } from "@fider/services"
-import { Form, Button, Input, Heading, SocialSignInButton, Field, ImageUploader, Toggle } from "@fider/components"
+import { Form, Button, Input, SocialSignInButton, Field, ImageUploader, Toggle } from "@fider/components"
import { useFider } from "@fider/hooks"
+import { HStack } from "@fider/components/layout"
interface OAuthFormProps {
config?: OAuthConfig
@@ -70,39 +71,29 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
const title = props.config ? `OAuth Provider: ${props.config.displayName}` : "New OAuth Provider"
return (
<>
- <Heading title={title} size="small" />
+ <h2 className="text-title mb-2">{title}</h2>
<Form error={error}>
- <div className="row">
- <div className="col-sm-9">
- <Input
- field="displayName"
- label="Display Name"
- maxLength={50}
- value={displayName}
- disabled={!fider.session.user.isAdministrator}
- onChange={setDisplayName}
- />
-
- <ImageUploader
- label="Logo"
- field="logo"
- bkey={logoBlobKey}
- previewMaxWidth={80}
- disabled={!fider.session.user.isAdministrator}
- onChange={handleLogoChange}
- >
- <p className="info">
- We accept JPG, GIF and PNG images, smaller than 50KB and with an aspect ratio of 1:1 with minimum dimensions of 24x24 pixels.
- </p>
- </ImageUploader>
- </div>
- <div className="col-sm-3">
- <Field label="Button Preview">
- <SocialSignInButton option={{ displayName, provider, logoBlobKey, logoURL }} />
- </Field>
- </div>
+ <div className="grid grid-cols-4 gap-4">
+ <Input
+ className="col-span-3"
+ field="displayName"
+ label="Display Name"
+ maxLength={50}
+ value={displayName}
+ disabled={!fider.session.user.isAdministrator}
+ onChange={setDisplayName}
+ />
+ <Field label="Button Preview">
+ <SocialSignInButton option={{ displayName: displayName || "Button", provider, logoBlobKey, logoURL }} />
+ </Field>
</div>
+ <ImageUploader label="Logo" field="logo" bkey={logoBlobKey} disabled={!fider.session.user.isAdministrator} onChange={handleLogoChange}>
+ <p className="text-muted">
+ We accept JPG, GIF and PNG images, smaller than 50KB and with an aspect ratio of 1:1 with minimum dimensions of 24x24 pixels.
+ </p>
+ </ImageUploader>
+
<Input field="clientID" label="Client ID" maxLength={100} value={clientID} disabled={!fider.session.user.isAdministrator} onChange={setClientID} />
<Input
@@ -115,8 +106,8 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
afterLabel={
!clientSecretEnabled ? (
<>
- <span className="info">omitted for security reasons.</span>
- <span className="info clickable" onClick={enableClientSecret}>
+ <span className="text-muted"> omitted for security reasons.</span>
+ <span className="text-link text-normal text-xs ml-1" onClick={enableClientSecret}>
change
</span>
</>
@@ -134,14 +125,14 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
<Input field="tokenURL" label="Token URL" maxLength={300} value={tokenURL} disabled={!fider.session.user.isAdministrator} onChange={setTokenURL} />
<Input field="scope" label="Scope" maxLength={100} value={scope} disabled={!fider.session.user.isAdministrator} onChange={setScope}>
- <p className="info">
+ <p className="text-muted">
It is recommended to only request the minimum scopes we need to fetch the user <strong>id</strong>, <strong>name</strong> and <strong>email</strong>
. Multiple scopes must be separated by space.
</p>
</Input>
- <h3>User Profile</h3>
- <p className="info">This section is used to configure how Fider will fetch user after the authentication process.</p>
+ <h3 className="text-title mt-8 mb-2">User Profile</h3>
+ <p className="text-muted">This section is used to configure how Fider will fetch user after the authentication process.</p>
<Input
field="profileURL"
@@ -151,22 +142,21 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
disabled={!fider.session.user.isAdministrator}
onChange={setProfileURL}
>
- <p className="info">The URL to fetch the authenticated user info. If empty, Fider will try to parse the user info from the Access Token.</p>
+ <p className="text-muted">The URL to fetch the authenticated user info. If empty, Fider will try to parse the user info from the Access Token.</p>
</Input>
- <h4>JSON Path</h4>
+ <h3 className="text-title mt-8 mb-2">JSON Path</h3>
- <div className="row">
+ <div className="grid grid-cols-3 gap-4">
<Input
field="jsonUserIDPath"
label="ID"
- className="col-sm-4"
maxLength={100}
value={jsonUserIDPath}
disabled={!fider.session.user.isAdministrator}
onChange={setJSONUserIDPath}
>
- <p className="info">
+ <p className="text-muted">
Path to extract User ID from the JSON. This ID <strong>must</strong> be unique within the provider or unexpected side effects might happen. For
example below, the path would be <strong>id</strong>.
</p>
@@ -174,13 +164,12 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
<Input
field="jsonUserNamePath"
label="Name"
- className="col-sm-4"
maxLength={100}
value={jsonUserNamePath}
disabled={!fider.session.user.isAdministrator}
onChange={setJSONUserNamePath}
>
- <p className="info">
+ <p className="text-muted">
Path to extract user Display Name from the JSON. This is optional, but <strong>highly</strong> recommended. For the example below, the path would
be <strong>profile.name</strong>.
</p>
@@ -188,22 +177,22 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
<Input
field="jsonUserEmailPath"
label="Email"
- className="col-sm-4"
maxLength={100}
value={jsonUserEmailPath}
disabled={!fider.session.user.isAdministrator}
onChange={setJSONUserEmailPath}
>
- <p className="info">
+ <p className="text-muted">
Path to extract user Email from the JSON. This is optional, but <strong>highly</strong> recommended. For the example below, the path would be{" "}
<strong>profile.emails[0]</strong>.
</p>
</Input>
</div>
+
+ <h3 className="text-title mb-2">Example Response</h3>
+
<pre>
- <h5>Example Response</h5>
- {`
- {
+ {`{
id: "35235"
title: "Sr. Account Manager",
profile: {
@@ -217,30 +206,27 @@ export const OAuthForm: React.FC<OAuthFormProps> = (props) => {
`}
</pre>
- <div className="row">
- <div className="col-sm-4">
- <Field label="Status">
- <Toggle active={enabled} onToggle={setEnabled} />
- <span>{enabled ? "Enabled" : "Disabled"}</span>
- {enabled && (
- <p className="info">
- This provider will be available for everyone to use during the sign in process. It is recommended that you keep it disable and test it before
- enabling it. The Test button is available after saving this configuration.
- </p>
- )}
- {!enabled && <p className="info">Users won&apos;t be able to sign in with this Provider.</p>}
- </Field>
+ <Field label="Status">
+ <Toggle active={enabled} onToggle={setEnabled} label={enabled ? "Enabled" : "Disabled"} />
+ <div className="mt-1">
+ {enabled && (
+ <p className="text-muted mt-1">
+ This provider will be available for everyone to use during the sign in process. It is recommended that you keep it disable and test it before
+ enabling it. The Test button is available after saving this configuration.
+ </p>
+ )}
+ {!enabled && <p className="text-muted">Users won&apos;t be able to sign in with this Provider.</p>}
</div>
- </div>
+ </Field>
- <div className="c-form-field">
- <Button color="positive" onClick={handleSave}>
+ <HStack className="mt-2">
+ <Button variant="primary" onClick={handleSave}>
Save
</Button>
- <Button color="cancel" onClick={handleCancel}>
+ <Button variant="tertiary" onClick={handleCancel}>
Cancel
</Button>
- </div>
+ </HStack>
</Form>
</>
)
diff --git a/public/pages/Administration/components/SideMenu.scss b/public/pages/Administration/components/SideMenu.scss
index 1a0d8f962..444f856d0 100644
--- a/public/pages/Administration/components/SideMenu.scss
+++ b/public/pages/Administration/components/SideMenu.scss
@@ -1,66 +1,26 @@
@import "~@fider/assets/styles/variables.scss";
-.c-side-menu-toggler {
- position: absolute;
- top: 0;
- right: 0;
- margin-top: 5px;
- cursor: pointer;
-
- @include media("md") {
- margin-top: 15px;
- }
-
- @include media(">=lg") {
- display: none;
- }
-
- > div {
- width: 30px;
- height: 4px;
- background-color: $gray-900;
- margin: 4px 0;
- transition: 0.4s;
- }
-
- &.active {
- .bar1 {
- transform: rotate(-45deg) translate(-4px, 3px);
- }
- .bar2 {
- opacity: 0;
- }
- .bar3 {
- transform: rotate(45deg) translate(-8px, -8px);
- }
- }
-}
-
.c-side-menu {
- display: block;
- border: 1px solid rgba(34, 36, 38, 0.1);
- box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.1);
- border-radius: 5px;
- background-color: $white;
- margin-bottom: 15px;
-
- .c-side-menu-item {
- display: block;
- padding: 12px;
- border-bottom: 1px solid rgba(34, 36, 38, 0.1);
- color: $gray-900;
+ &__item {
+ padding: spacing(3);
+ border-bottom: 1px solid get("colors.gray.200");
+ color: get("colors.gray.900");
&:hover {
- background-color: $gray-100;
+ background-color: get("colors.gray.100");
+ }
+
+ &:last-child {
+ border-bottom: none;
}
- &.m-active {
- color: $admin-color;
- border-left: 2px solid $admin-color;
+ &--active {
+ color: get("colors.primary.base");
+ border-left: 2px solid get("colors.primary.base");
font-weight: 600;
- background-color: $white;
+ background-color: get("colors.white");
&:hover {
- color: $admin-color;
+ color: get("colors.primary.base");
}
}
}
diff --git a/public/pages/Administration/components/SideMenu.tsx b/public/pages/Administration/components/SideMenu.tsx
index ce576c181..546dda520 100644
--- a/public/pages/Administration/components/SideMenu.tsx
+++ b/public/pages/Administration/components/SideMenu.tsx
@@ -1,13 +1,15 @@
import "./SideMenu.scss"
-import React from "react"
+import React, { useState } from "react"
import { classSet } from "@fider/services"
-import { FiderVersion } from "@fider/components"
+import { FiderVersion, Icon } from "@fider/components"
import { useFider } from "@fider/hooks"
+import IconX from "@fider/assets/images/heroicons-x.svg"
+import IconMenu from "@fider/assets/images/heroicons-menu.svg"
+import { VStack } from "@fider/components/layout"
interface SiteMenuProps {
activeItem: string
- visible: boolean
className?: string
}
@@ -20,18 +22,10 @@ interface SideMenuItemProps {
const SideMenuItem = (props: SideMenuItemProps) => {
const className = classSet({
- "c-side-menu-item": true,
- "m-active": props.isActive,
+ "c-side-menu__item": true,
+ "c-side-menu__item--active": props.isActive,
})
- if (props.isActive) {
- return (
- <span key={props.name} className={className}>
- {props.title}
- </span>
- )
- }
-
return (
<a key={props.name} className={className} href={props.href}>
{props.title}
@@ -42,11 +36,10 @@ const SideMenuItem = (props: SideMenuItemProps) => {
export const SideMenu = (props: SiteMenuProps) => {
const fider = useFider()
const activeItem = props.activeItem || "general"
- const style = { display: props.visible ? "" : "none" }
return (
- <div className={props.className}>
- <div className="c-side-menu" style={style}>
+ <div className="js-admin-menu sm:hidden md:hidden lg:block">
+ <VStack spacing={0} className="c-side-menu rounded-md shadow">
<SideMenuItem name="general" title="General" href="/admin" isActive={activeItem === "general"} />
<SideMenuItem name="privacy" title="Privacy" href="/admin/privacy" isActive={activeItem === "privacy"} />
<SideMenuItem name="members" title="Members" href="/admin/members" isActive={activeItem === "members"} />
@@ -59,47 +52,29 @@ export const SideMenu = (props: SiteMenuProps) => {
<SideMenuItem name="export" title="Export" href="/admin/export" isActive={activeItem === "export"} />
</>
)}
- </div>
+ </VStack>
<FiderVersion />
</div>
)
}
-interface SideMenuTogglerProps {
- onToggle: (active: boolean) => void
-}
-
-interface SideMenuTogglerState {
- active: boolean
-}
+export const SideMenuToggler = () => {
+ const [isActive, setIsActive] = useState(false)
-export class SideMenuToggler extends React.Component<SideMenuTogglerProps, SideMenuTogglerState> {
- constructor(props: SideMenuTogglerProps) {
- super(props)
- this.state = {
- active: false,
+ const toggle = () => {
+ const classes = ["sm:hidden", "md:hidden"]
+ const el = document.querySelector(".js-admin-menu") as HTMLElement
+ if (el && !isActive) {
+ el.classList.remove(...classes)
+ } else if (el && isActive) {
+ el.classList.add(...classes)
}
- }
- private toggle = () => {
- this.setState(
- (state) => ({ active: !state.active }),
- () => {
- this.props.onToggle(this.state.active)
- }
- )
+ setIsActive(!isActive)
}
- public render() {
- const className = classSet({
- "c-side-menu-toggler": true,
- active: this.state.active,
- })
- return (
- <div className={className} onClick={this.toggle}>
- <div className="bar1" />
- <div className="bar2" />
- <div className="bar3" />
- </div>
- )
- }
+ return (
+ <div className="h-8 w-8 lg:hidden xl:hidden" onClick={toggle}>
+ {isActive ? <Icon sprite={IconX} /> : <Icon sprite={IconMenu} />}
+ </div>
+ )
}
diff --git a/public/pages/Administration/components/TagForm.scss b/public/pages/Administration/components/TagForm.scss
deleted file mode 100644
index a5f1073f6..000000000
--- a/public/pages/Administration/components/TagForm.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-#tag-form {
- .form .grouped.fields .field {
- margin: 0.2em 0;
- }
-
- input.color {
- text-transform: uppercase;
- }
-}
diff --git a/public/pages/Administration/components/TagForm.tsx b/public/pages/Administration/components/TagForm.tsx
index a9bfabb50..f8ad35893 100644
--- a/public/pages/Administration/components/TagForm.tsx
+++ b/public/pages/Administration/components/TagForm.tsx
@@ -1,8 +1,7 @@
-import "./TagForm.scss"
-
import React from "react"
import { Button, Input, ShowTag, Form, RadioButton, Field, SelectOption } from "@fider/components"
import { Failure } from "@fider/services"
+import { HStack } from "@fider/components/layout"
interface TagFormProps {
name?: string
@@ -70,49 +69,43 @@ export class TagForm extends React.Component<TagFormProps, TagFormState> {
public render() {
const randomizer = (
- <span className="info clickable" onClick={this.randomize}>
+ <span className="text-link text-normal text-xs ml-1" onClick={this.randomize}>
randomize
</span>
)
return (
<Form error={this.state.error}>
- <div className="row">
- <div className="col-lg-3">
- <Input field="name" label="Name" value={this.state.name} onChange={this.setName} />
- </div>
- <div className="col-lg-2">
- <Input field="color" label="Color" afterLabel={randomizer} value={this.state.color} onChange={this.setColor} />
- </div>
- <div className="col-lg-2">
- <RadioButton
- label="Visibility"
- field="visibility"
- defaultOption={this.state.isPublic ? this.visibilityPublic : this.visibilityPrivate}
- options={[this.visibilityPublic, this.visibilityPrivate]}
- onSelect={this.setVisibility}
+ <div className="grid gap-2 lg:grid-cols-5">
+ <Input field="name" label="Name" value={this.state.name} onChange={this.setName} />
+ <Input field="color" label="Color" afterLabel={randomizer} value={this.state.color} onChange={this.setColor} />
+ <RadioButton
+ label="Visibility"
+ field="visibility"
+ defaultOption={this.state.isPublic ? this.visibilityPublic : this.visibilityPrivate}
+ options={[this.visibilityPublic, this.visibilityPrivate]}
+ onSelect={this.setVisibility}
+ />
+ <Field label="Preview">
+ <ShowTag
+ tag={{
+ id: 0,
+ slug: "",
+ name: this.state.name,
+ color: this.state.color,
+ isPublic: this.state.isPublic,
+ }}
/>
- </div>
- <div className="col-lg-5">
- <Field label="Preview">
- <ShowTag
- tag={{
- id: 0,
- slug: "",
- name: this.state.name,
- color: this.state.color,
- isPublic: this.state.isPublic,
- }}
- />
- </Field>
- </div>
+ </Field>
+ <HStack>
+ <Button variant="primary" onClick={this.handleSave}>
+ Save
+ </Button>
+ <Button onClick={this.handleCancel} variant="tertiary">
+ Cancel
+ </Button>
+ </HStack>
</div>
- <Button color="positive" onClick={this.handleSave}>
- Save
- </Button>
- <Button onClick={this.handleCancel} color="cancel">
- Cancel
- </Button>
</Form>
)
}
diff --git a/public/pages/Administration/components/TagListItem.tsx b/public/pages/Administration/components/TagListItem.tsx
index 3db71f8e7..c08abd57f 100644
--- a/public/pages/Administration/components/TagListItem.tsx
+++ b/public/pages/Administration/components/TagListItem.tsx
@@ -1,11 +1,14 @@
import React, { useState } from "react"
import { Tag } from "@fider/models"
-import { ListItem, ShowTag, Button } from "@fider/components"
+import { ShowTag, Button, Icon } from "@fider/components"
import { TagFormState, TagForm } from "./TagForm"
import { actions, Failure } from "@fider/services"
-import { FaTimes, FaEdit } from "react-icons/fa"
import { useFider } from "@fider/hooks"
+import IconX from "@fider/assets/images/heroicons-x.svg"
+import IconPencilAlt from "@fider/assets/images/heroicons-pencil-alt.svg"
+import { HStack, VStack } from "@fider/components/layout"
+
interface TagListItemProps {
tag: Tag
onTagEdited: (tag: Tag) => void
@@ -46,40 +49,42 @@ export const TagListItem = (props: TagListItemProps) => {
const renderDeleteMode = () => {
return (
- <>
- <div className="content">
+ <VStack spacing={2}>
+ <div>
<b>Are you sure?</b>{" "}
<span>
The tag <ShowTag tag={tag} /> will be removed from all posts.
</span>
</div>
- <Button className="right" onClick={resetState} color="cancel">
- Cancel
- </Button>
- <Button color="danger" className="right" onClick={deleteTag}>
- Delete tag
- </Button>
- </>
+ <div>
+ <Button variant="danger" onClick={deleteTag}>
+ Delete tag
+ </Button>
+ <Button onClick={resetState} variant="tertiary">
+ Cancel
+ </Button>
+ </div>
+ </VStack>
)
}
const renderViewMode = () => {
const buttons = fider.session.user.isAdministrator && [
- <Button size="mini" key={0} onClick={startDelete} className="right">
- <FaTimes />
- Delete
+ <Button size="small" key={0} onClick={startEdit}>
+ <Icon sprite={IconPencilAlt} />
+ <span>Edit</span>
</Button>,
- <Button size="mini" key={1} onClick={startEdit} className="right">
- <FaEdit />
- Edit
+ <Button size="small" key={1} onClick={startDelete}>
+ <Icon sprite={IconX} />
+ <span>Delete</span>
</Button>,
]
return (
- <>
+ <HStack justify="between">
<ShowTag tag={tag} />
- {buttons}
- </>
+ <HStack>{buttons}</HStack>
+ </HStack>
)
}
@@ -87,7 +92,5 @@ export const TagListItem = (props: TagListItemProps) => {
return <TagForm name={props.tag.name} color={props.tag.color} isPublic={props.tag.isPublic} onSave={updateTag} onCancel={resetState} />
}
- const view = state === "delete" ? renderDeleteMode() : state === "edit" ? renderEditMode() : renderViewMode()
-
- return <ListItem>{view}</ListItem>
+ return state === "delete" ? renderDeleteMode() : state === "edit" ? renderEditMode() : renderViewMode()
}
diff --git a/public/pages/Administration/pages/AdvancedSettings.page.scss b/public/pages/Administration/pages/AdvancedSettings.page.scss
deleted file mode 100644
index 14b206edf..000000000
--- a/public/pages/Administration/pages/AdvancedSettings.page.scss
+++ /dev/null
@@ -1,13 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-admin-advanced {
- #input-customCSS {
- font-size: $font-size-small;
- font-family: $font-code;
- }
- ul {
- li {
- padding-bottom: 5px;
- }
- }
-}
diff --git a/public/pages/Administration/pages/AdvancedSettings.page.tsx b/public/pages/Administration/pages/AdvancedSettings.page.tsx
index 85efcf99c..e8e0a6a18 100644
--- a/public/pages/Administration/pages/AdvancedSettings.page.tsx
+++ b/public/pages/Administration/pages/AdvancedSettings.page.tsx
@@ -1,10 +1,7 @@
-import "./AdvancedSettings.page.scss"
-
import React from "react"
import { TextArea, Form, Button } from "@fider/components"
import { Failure, actions, Fider } from "@fider/services"
-import { FaStar } from "react-icons/fa"
import { AdminBasePage } from "../components/AdminBasePage"
interface AdvancedSettingsPageProps {
@@ -19,7 +16,6 @@ interface AdvancedSettingsPageState {
export default class AdvancedSettingsPage extends AdminBasePage<AdvancedSettingsPageProps, AdvancedSettingsPageState> {
public id = "p-admin-advanced"
public name = "advanced"
- public icon = FaStar
public title = "Advanced"
public subtitle = "Manage your site settings"
@@ -55,13 +51,15 @@ export default class AdvancedSettingsPage extends AdminBasePage<AdvancedSettings
value={this.state.customCSS}
onChange={this.setCustomCSS}
>
- <p className="info">
+ <p className="text-muted">
Custom CSS allows you to change the look and feel of Fider and apply your own branding.
<br />
This is a powerful and flexible feature, but requires basic understanding of <a href="https://developer.mozilla.org/en-US/docs/Learn/CSS">CSS</a>.
</p>
- <p className="info">Custom CSS might break the design of your site as Fider evolves. You can minimize conflict by following these recommendations:</p>
- <ul className="info">
+ <p className="text-muted">
+ Custom CSS might break the design of your site as Fider evolves. You can minimize conflict by following these recommendations:
+ </p>
+ <ul className="text-muted">
<li>
<strong>Avoid nested selectors</strong>: Fider might change the structure of the HTML at any time. It&apos;s likely that such changes would
invalidate some rules.
@@ -74,7 +72,7 @@ export default class AdvancedSettingsPage extends AdminBasePage<AdvancedSettings
{Fider.session.user.isAdministrator && (
<div className="field">
- <Button color="positive" onClick={this.handleSave}>
+ <Button variant="primary" onClick={this.handleSave}>
Save
</Button>
</div>
diff --git a/public/pages/Administration/pages/Export.page.tsx b/public/pages/Administration/pages/Export.page.tsx
index 320f36230..8ba1c3f05 100644
--- a/public/pages/Administration/pages/Export.page.tsx
+++ b/public/pages/Administration/pages/Export.page.tsx
@@ -1,43 +1,39 @@
import React from "react"
-import { Button, Form, Field, Segment } from "@fider/components"
-import { FaRegFileExcel } from "react-icons/fa"
+import { Button, Icon } from "@fider/components"
import { AdminBasePage } from "../components/AdminBasePage"
+import IconDownload from "@fider/assets/images/heroicons-download.svg"
export default class ExportPage extends AdminBasePage<any, any> {
public id = "p-admin-export"
public name = "export"
- public icon = FaRegFileExcel
public title = "Export"
public subtitle = "Download your data"
public content() {
return (
- <Form>
- <Segment>
- <Field label="Export Posts">
- <p className="info">
- Use this button to download a CSV file with all posts in this site. This can be useful to analyse the data with an external tool or simply to back
- it up.
- </p>
- </Field>
- <Field>
- <Button color="positive" href="/admin/export/posts.csv">
- posts.csv
- </Button>
- </Field>
- </Segment>
- <Segment>
- <Field label="Backup your data">
- <p className="info">Use this button to download a ZIP file with your data in JSON format. This is a full backup and contains all of your data.</p>
- </Field>
- <Field>
- <Button color="positive" href="/admin/export/backup.zip">
- backup.zip
- </Button>
- </Field>
- </Segment>
- </Form>
+ <>
+ <h2 className="text-display">Export Posts</h2>
+ <p className="text-muted">
+ Use this button to download a CSV file with all posts in this site. This can be useful to analyse the data with an external tool or simply to back it
+ up.
+ </p>
+ <Button variant="secondary" href="/admin/export/posts.csv">
+ <Icon sprite={IconDownload} />
+ <span>posts.csv</span>
+ </Button>
+
+ <div className="mt-8">
+ <h2 className="text-display">Backup your data</h2>
+ <p className="text-muted">
+ Use this button to download a ZIP file with your data in JSON format. This is a full backup and contains all of your data.
+ </p>
+ <Button variant="secondary" href="/admin/export/backup.zip">
+ <Icon sprite={IconDownload} />
+ <span>backup.zip</span>
+ </Button>
+ </div>
+ </>
)
}
}
diff --git a/public/pages/Administration/pages/GeneralSettings.page.scss b/public/pages/Administration/pages/GeneralSettings.page.scss
deleted file mode 100644
index d6f877e7e..000000000
--- a/public/pages/Administration/pages/GeneralSettings.page.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-input[type="file"] {
- display: none;
-}
-
-.c-logo-upload {
- img {
- background-color: $white;
- padding: 10px;
- border: 1px solid rgba(34, 36, 38, 0.15);
- border-radius: 3px;
- max-width: 200px;
- min-width: 200px;
- margin-right: 10px;
- }
-}
diff --git a/public/pages/Administration/pages/GeneralSettings.page.tsx b/public/pages/Administration/pages/GeneralSettings.page.tsx
index 86b54fd59..553a1ee61 100644
--- a/public/pages/Administration/pages/GeneralSettings.page.tsx
+++ b/public/pages/Administration/pages/GeneralSettings.page.tsx
@@ -1,10 +1,7 @@
-import "./GeneralSettings.page.scss"
-
import React from "react"
-import { Button, ButtonClickEvent, TextArea, Form, Input, ImageUploader } from "@fider/components/common"
+import { Button, ButtonClickEvent, TextArea, Form, Input, ImageUploader } from "@fider/components"
import { actions, Failure, Fider } from "@fider/services"
-import { FaCogs } from "react-icons/fa"
import { AdminBasePage } from "../components/AdminBasePage"
import { ImageUpload } from "@fider/models"
@@ -20,7 +17,6 @@ interface GeneralSettingsPageState {
export default class GeneralSettingsPage extends AdminBasePage<any, GeneralSettingsPageState> {
public id = "p-admin-general"
public name = "general"
- public icon = FaCogs
public title = "General"
public subtitle = "Manage your site settings"
@@ -83,7 +79,7 @@ export default class GeneralSettingsPage extends AdminBasePage<any, GeneralSetti
return (
<Form error={this.state.error}>
<Input field="title" label="Title" maxLength={60} value={this.state.title} disabled={!Fider.session.user.isAdministrator} onChange={this.setTitle}>
- <p className="info">
+ <p className="text-muted">
The title is used on the header, emails, notifications and SEO content. Keep it short and simple. The product/service name is usually the best
choice.
</p>
@@ -96,7 +92,7 @@ export default class GeneralSettingsPage extends AdminBasePage<any, GeneralSetti
disabled={!Fider.session.user.isAdministrator}
onChange={this.setWelcomeMessage}
>
- <p className="info">
+ <p className="text-muted">
The message is shown on this site&apos;s home page. Use it to help visitors understad what this space is about and the importance of their feedback.
Leave it empty for a default message.
</p>
@@ -111,21 +107,14 @@ export default class GeneralSettingsPage extends AdminBasePage<any, GeneralSetti
placeholder="Enter your suggestion here..."
onChange={this.setInvitation}
>
- <p className="info">
+ <p className="text-muted">
This text is used as a placeholder for the suggestion&apos;s text box. Use it to invite your visitors into sharing their suggestions and feedback.
Leave it empty for a default message.
</p>
</Input>
- <ImageUploader
- label="Logo"
- field="logo"
- bkey={Fider.session.tenant.logoBlobKey}
- previewMaxWidth={200}
- disabled={!Fider.session.user.isAdministrator}
- onChange={this.setLogo}
- >
- <p className="info">
+ <ImageUploader label="Logo" field="logo" bkey={Fider.session.tenant.logoBlobKey} disabled={!Fider.session.user.isAdministrator} onChange={this.setLogo}>
+ <p className="text-muted">
We accept JPG, GIF and PNG images, smaller than 100KB and with an aspect ratio of 1:1 with minimum dimensions of 200x200 pixels.
</p>
</ImageUploader>
@@ -140,7 +129,7 @@ export default class GeneralSettingsPage extends AdminBasePage<any, GeneralSetti
disabled={!Fider.session.user.isAdministrator}
onChange={this.setCNAME}
>
- <div className="info">
+ <div className="text-muted">
{this.state.cname ? (
[
<p key={0}>Enter the following record into your DNS zone records:</p>,
@@ -158,7 +147,7 @@ export default class GeneralSettingsPage extends AdminBasePage<any, GeneralSetti
)}
<div className="field">
- <Button disabled={!Fider.session.user.isAdministrator} color="positive" onClick={this.handleSave}>
+ <Button disabled={!Fider.session.user.isAdministrator} variant="primary" onClick={this.handleSave}>
Save
</Button>
</div>
diff --git a/public/pages/Administration/pages/Invitations.page.tsx b/public/pages/Administration/pages/Invitations.page.tsx
index e1eb229d8..0656b7315 100644
--- a/public/pages/Administration/pages/Invitations.page.tsx
+++ b/public/pages/Administration/pages/Invitations.page.tsx
@@ -3,7 +3,6 @@ import React from "react"
import { Button, TextArea, Form, Input, Field } from "@fider/components"
import { actions, notify, Failure, Fider } from "@fider/services"
import { AdminBasePage } from "../components/AdminBasePage"
-import { FaEnvelope } from "react-icons/fa"
interface InvitationsPageState {
subject: string
@@ -17,7 +16,6 @@ interface InvitationsPageState {
export default class InvitationsPage extends AdminBasePage<any, InvitationsPageState> {
public id = "p-admin-invitations"
public name = "invitations"
- public icon = FaEnvelope
public title = "Invitations"
public subtitle = "Invite people to share their feedback"
@@ -85,12 +83,12 @@ ${Fider.session.user.name} (${Fider.session.tenant.name})`,
<TextArea
field="recipients"
label="Send invitations to"
minRows={1}
value={this.state.rawRecipients}
onChange={this.setRecipients}
>
- <div className="info">
+ <div className="text-muted">
<p>
Input the list of all email addresses you wish to invite. Separate each address with either <strong>semicolon</strong>, <strong>comma</strong>,{" "}
<strong>whitespace</strong> or <strong>line break</strong>.
@@ -100,11 +98,11 @@ ${Fider.session.user.name} (${Fider.session.tenant.name})`,
</TextArea>
<Input field="subject" label="Subject" value={this.state.subject} maxLength={70} onChange={this.setSubject}>
- <p className="info">This is the subject that will be used on the invitation email. Keep it short and sweet.</p>
+ <p className="text-muted">This is the subject that will be used on the invitation email. Keep it short and sweet.</p>
</Input>
<TextArea field="message" label="Message" minRows={8} value={this.state.message} onChange={this.setMessage}>
- <div className="info">
+ <div className="text-muted">
<p>
This is the content of the invite. Be polite and explain what this invite is for, otherwise there&apos;s a high change people will ignore your
message.
@@ -116,7 +114,7 @@ ${Fider.session.user.name} (${Fider.session.tenant.name})`,
</TextArea>
<Field label="Sample Invite">
- <p className="info">
+ <p className="text-muted">
We highly recommend to send yourself a sample email for you to verify if everything is correct before inviting your list of contacts.
</p>
{Fider.session.user.email ? (
@@ -127,8 +125,8 @@ ${Fider.session.user.name} (${Fider.session.tenant.name})`,
</Field>
<Field label="Confirmation">
- <p className="info">Whenever you&apos;re ready, click the following button to send out these invites.</p>
- <Button onClick={this.sendInvites} color="positive" disabled={this.state.numOfRecipients === 0}>
+ <p className="text-muted">Whenever you&apos;re ready, click the following button to send out these invites.</p>
+ <Button onClick={this.sendInvites} variant="primary" disabled={this.state.numOfRecipients === 0}>
Send {this.state.numOfRecipients} {this.state.numOfRecipients === 1 ? "invite" : "invites"}
</Button>
</Field>
diff --git a/public/pages/Administration/pages/ManageAuthentication.page.scss b/public/pages/Administration/pages/ManageAuthentication.page.scss
deleted file mode 100644
index 927be1b74..000000000
--- a/public/pages/Administration/pages/ManageAuthentication.page.scss
+++ /dev/null
@@ -1,25 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-admin-authentication {
- .l-provider {
- img,
- strong {
- vertical-align: middle;
- margin-right: 2px;
- }
- img {
- width: 24px;
- height: 24px;
- }
- .m-enabled {
- color: $green-700;
- font-weight: 500;
- font-size: $font-size-mini;
- }
- .m-disabled {
- color: $red-400;
- font-weight: 500;
- font-size: $font-size-mini;
- }
- }
-}
diff --git a/public/pages/Administration/pages/ManageAuthentication.page.tsx b/public/pages/Administration/pages/ManageAuthentication.page.tsx
index 13537aec3..4411b17aa 100644
--- a/public/pages/Administration/pages/ManageAuthentication.page.tsx
+++ b/public/pages/Administration/pages/ManageAuthentication.page.tsx
@@ -1,13 +1,15 @@
import React from "react"
-import { Segment, List, ListItem, Button, Heading, OAuthProviderLogo } from "@fider/components"
+import { Button, OAuthProviderLogo, Icon } from "@fider/components"
import { OAuthConfig, OAuthProviderOption } from "@fider/models"
import { OAuthForm } from "../components/OAuthForm"
import { actions, notify, Fider } from "@fider/services"
-import { FaEdit, FaPlay, FaSignInAlt } from "react-icons/fa"
import { AdminBasePage } from "../components/AdminBasePage"
-import "./ManageAuthentication.page.scss"
+import IconPlay from "@fider/assets/images/heroicons-play.svg"
+import IconPencilAlt from "@fider/assets/images/heroicons-pencil-alt.svg"
+
+import { HStack, VStack } from "@fider/components/layout"
interface ManageAuthenticationPageProps {
providers: OAuthProviderOption[]
@@ -21,7 +23,6 @@ interface ManageAuthenticationPageState {
export default class ManageAuthenticationPage extends AdminBasePage<ManageAuthenticationPageProps, ManageAuthenticationPageState> {
public id = "p-admin-authentication"
public name = "authentication"
- public icon = FaSignInAlt
public title = "Authentication"
public subtitle = "Manage your site authentication"
@@ -63,61 +64,59 @@ export default class ManageAuthenticationPage extends AdminBasePage<ManageAuthen
return <OAuthForm config={this.state.editing} onCancel={this.cancel} />
}
- const enabled = <p className="m-enabled">Enabled</p>
- const disabled = <p className="m-disabled">Disabled</p>
+ const enabled = <span className="text-green-700">Enabled</span>
+ const disabled = <span className="text-red-700">Disabled</span>
return (
<>
- <Heading
- title="OAuth Providers"
- subtitle="You can use these section to add any authentication provider thats supports the OAuth2 protocol."
- size="small"
- />
- <p className="info">
- Additional information is available in our{" "}
- <a rel="noopener" target="_blank" href="https://getfider.com/docs/configuring-oauth/">
+ <h2 className="text-display">OAuth Providers</h2>
+ <p>
+ You can use these section to add any authentication provider thats supports the OAuth2 protocol. Additional information is available in our{" "}
+ <a rel="noopener" className="text-link" target="_blank" href="https://getfider.com/docs/configuring-oauth/">
OAuth Documentation
</a>
.
</p>
- <Segment>
- <List divided={true}>
- {this.props.providers.map((o) => (
- <ListItem key={o.provider}>
+ <VStack spacing={6}>
+ {this.props.providers.map((o) => (
+ <div key={o.provider}>
+ <HStack justify="between">
+ <HStack className="h-6">
+ <OAuthProviderLogo option={o} />
+ <strong>{o.displayName}</strong>
+ </HStack>
{o.isCustomProvider && (
- <>
+ <HStack>
{Fider.session.user.isAdministrator && (
- <Button onClick={this.edit.bind(this, o.provider)} size="mini" className="right">
- <FaEdit />
- Edit
+ <Button onClick={this.edit.bind(this, o.provider)} size="small">
+ <Icon sprite={IconPencilAlt} />
+ <span>Edit</span>
</Button>
)}
- <Button onClick={this.startTest.bind(this, o.provider)} size="mini" className="right">
- <FaPlay />
- Test
+ <Button onClick={this.startTest.bind(this, o.provider)} size="small">
+ <Icon sprite={IconPlay} />
+ <span>Test</span>
</Button>
- </>
- )}
- <div className="l-provider">
- <OAuthProviderLogo option={o} />
- <strong>{o.displayName}</strong>
- {o.isEnabled ? enabled : disabled}
- </div>
- {o.isCustomProvider && (
- <span className="info">
- <strong>Client ID:</strong> {o.clientID} <br />
- <strong>Callback URL:</strong> {o.callbackURL}
- </span>
+ </HStack>
)}
- </ListItem>
- ))}
- </List>
- </Segment>
- {Fider.session.user.isAdministrator && (
- <Button color="positive" onClick={this.addNew}>
- Add new
- </Button>
- )}
+ </HStack>
+ <div className="text-xs block my-1">{o.isEnabled ? enabled : disabled}</div>
+ {o.isCustomProvider && (
+ <span className="text-muted">
+ <strong>Client ID:</strong> {o.clientID} <br />
+ <strong>Callback URL:</strong> {o.callbackURL}
+ </span>
+ )}
+ </div>
+ ))}
+ <div>
+ {Fider.session.user.isAdministrator && (
+ <Button variant="secondary" onClick={this.addNew}>
+ Add new
+ </Button>
+ )}
+ </div>
+ </VStack>
</>
)
}
diff --git a/public/pages/Administration/pages/ManageMembers.page.scss b/public/pages/Administration/pages/ManageMembers.page.scss
deleted file mode 100644
index 0fd43b821..000000000
--- a/public/pages/Administration/pages/ManageMembers.page.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-admin-members {
- @include media("<=md") {
- .col-left {
- .c-list-item:last-child {
- margin-bottom: 15px;
- }
- }
- .col-right {
- .c-list-item:first-child {
- padding-top: 15px;
- border-top: 1px solid $gray-200;
- }
- }
- }
-
- .l-legend {
- list-style-type: none;
- padding-left: 0;
- }
-
- .c-list-item {
- .c-avatar {
- margin-right: 5px;
- }
- .l-user-details {
- display: inline-block;
- vertical-align: middle;
- span {
- display: block;
- }
- }
- .l-user-actions {
- display: inline-block;
- cursor: pointer;
- vertical-align: middle;
- margin-left: 5px;
- .c-dropdown-text {
- color: $gray-500;
- }
- }
- .staff {
- font-size: $font-size-tiny;
- }
- .blocked {
- font-size: $font-size-tiny;
- color: $red-400;
- }
- }
-
- .l-show-more {
- cursor: pointer;
- font-weight: bold;
- padding-left: 5px;
- }
-}
diff --git a/public/pages/Administration/pages/ManageMembers.page.tsx b/public/pages/Administration/pages/ManageMembers.page.tsx
index 126f5ac92..37a44592c 100644
--- a/public/pages/Administration/pages/ManageMembers.page.tsx
+++ b/public/pages/Administration/pages/ManageMembers.page.tsx
@@ -1,11 +1,12 @@
-import "./ManageMembers.page.scss"
-
import React from "react"
-import { Segment, List, Input, ListItem, Avatar, UserName, DropDown, DropDownItem } from "@fider/components/common"
+import { Input, Avatar, UserName, Icon, Dropdown, Button } from "@fider/components"
import { User, UserRole, UserStatus } from "@fider/models"
import { AdminBasePage } from "../components/AdminBasePage"
-import { FaUsers, FaTimes, FaSearch } from "react-icons/fa"
+import IconSearch from "@fider/assets/images/heroicons-search.svg"
+import IconX from "@fider/assets/images/heroicons-x.svg"
+import IconDotsHorizontal from "@fider/assets/images/heroicons-dots-horizontal.svg"
import { actions, Fider } from "@fider/services"
+import { HStack, VStack } from "@fider/components/layout"
interface ManageMembersPageState {
query: string
@@ -23,57 +24,44 @@ interface UserListItemProps {
}
const UserListItem = (props: UserListItemProps) => {
- const admin = props.user.role === UserRole.Administrator && <span className="staff">administrator</span>
- const collaborator = props.user.role === UserRole.Collaborator && <span className="staff">collaborator</span>
- const blocked = props.user.status === UserStatus.Blocked && <span className="blocked">blocked</span>
+ const admin = props.user.role === UserRole.Administrator && <span>administrator</span>
+ const collaborator = props.user.role === UserRole.Collaborator && <span>collaborator</span>
+ const blocked = props.user.status === UserStatus.Blocked && <span className="text-red-700">blocked</span>
const isVisitor = props.user.role === UserRole.Visitor
- const renderEllipsis = () => {
- return (
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="16" height="16" focusable="false">
- <path d="M3 9.5A1.5 1.5 0 114.5 8 1.5 1.5 0 013 9.5zM11.5 8A1.5 1.5 0 1013 6.5 1.5 1.5 0 0011.5 8zm-5 0A1.5 1.5 0 108 6.5 1.5 1.5 0 006.5 8z"></path>
- </svg>
- )
- }
-
- const actionSelected = (item: DropDownItem) => {
- props.onAction(item.value, props.user)
+ const actionSelected = (actionName: string) => () => {
+ props.onAction(actionName, props.user)
}
return (
- <ListItem>
- <Avatar user={props.user} />
- <div className="l-user-details">
- <UserName user={props.user} />
- <span>
- {admin} {collaborator} {blocked}
- </span>
- </div>
+ <HStack spacing={4}>
+ <HStack spacing={4}>
+ <Avatar user={props.user} />
+ <VStack spacing={0}>
+ <UserName user={props.user} />
+ <span className="text-muted">
+ {admin} {collaborator} {blocked}
+ </span>
+ </VStack>
+ </HStack>
{Fider.session.user.id !== props.user.id && Fider.session.user.isAdministrator && (
- <DropDown
- className="l-user-actions"
- inline={true}
- highlightSelected={false}
- style="simple"
- items={[
- !blocked && (!!collaborator || isVisitor) && { label: "Promote to Administrator", value: "to-administrator" },
- !blocked && (!!admin || isVisitor) && { label: "Promote to Collaborator", value: "to-collaborator" },
- !blocked && (!!collaborator || !!admin) && { label: "Demote to Visitor", value: "to-visitor" },
- isVisitor && !blocked && { label: "Block User", value: "block" },
- isVisitor && !!blocked && { label: "Unblock User", value: "unblock" },
- ]}
- renderControl={renderEllipsis}
- onChange={actionSelected}
- />
+ <Dropdown renderHandle={<Icon sprite={IconDotsHorizontal} width="16" height="16" />}>
+ {!blocked && (!!collaborator || isVisitor) && (
+ <Dropdown.ListItem onClick={actionSelected("to-administrator")}>Promote to Administrator</Dropdown.ListItem>
+ )}
+ {!blocked && (!!admin || isVisitor) && <Dropdown.ListItem onClick={actionSelected("to-collaborator")}>Promote to Collaborator</Dropdown.ListItem>}
+ {!blocked && (!!collaborator || !!admin) && <Dropdown.ListItem onClick={actionSelected("to-visitor")}>Demote to Visitor</Dropdown.ListItem>}
+ {isVisitor && !blocked && <Dropdown.ListItem onClick={actionSelected("block")}>Block User</Dropdown.ListItem>}
+ {isVisitor && !!blocked && <Dropdown.ListItem onClick={actionSelected("unblock")}>Unblock User</Dropdown.ListItem>}
+ </Dropdown>
)}
- </ListItem>
+ </HStack>
)
}
export default class ManageMembersPage extends AdminBasePage<ManageMembersPageProps, ManageMembersPageState> {
public id = "p-admin-members"
public name = "members"
- public icon = FaUsers
public title = "Members"
public subtitle = "Manage your site administrators and collaborators"
@@ -88,8 +76,7 @@ export default class ManageMembersPage extends AdminBasePage<ManageMembersPagePr
}
}
- private showMore = (event: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>): void => {
- event.preventDefault()
+ private showMore = (): void => {
this.setState({
visibleUsers: this.state.users.slice(0, this.state.visibleUsers.length + 10),
})
@@ -156,46 +143,45 @@ export default class ManageMembersPage extends AdminBasePage<ManageMembersPagePr
<>
<Input
field="query"
- icon={this.state.query ? FaTimes : FaSearch}
+ icon={this.state.query ? IconX : IconSearch}
onIconClick={this.state.query ? this.clearSearch : undefined}
placeholder="Search for users by name..."
value={this.state.query}
onChange={this.handleSearchFilterChanged}
/>
- <Segment>
- {this.state.visibleUsers.length === 0 && <span>No users found.</span>}
- <List divided={true}>
+ <div className="p-2">
+ <VStack spacing={2} divide={true}>
{this.state.visibleUsers.map((user) => (
<UserListItem key={user.id} user={user} onAction={this.handleAction} />
))}
- </List>
- </Segment>
- <p className="info">
+ </VStack>
+ </div>
+ <p className="text-muted">
{!this.state.query && (
<>
- Showing {this.state.visibleUsers.length} of {this.state.users.length} registered users
+ Showing {this.state.visibleUsers.length} of {this.state.users.length} registered users.
</>
)}
{this.state.query && (
<>
- Showing {this.state.visibleUsers.length} of {this.state.users.length} users matching &apos;{this.state.query}&apos;
+ Showing {this.state.visibleUsers.length} of {this.state.users.length} users matching &apos;{this.state.query}&apos;.
</>
)}
{this.state.visibleUsers.length < this.state.users.length && (
- <a className="l-show-more" onTouchEnd={this.showMore} onClick={this.showMore}>
+ <Button variant="tertiary" onClick={this.showMore}>
view more
- </a>
+ </Button>
)}
</p>
- <ul className="l-legend info">
+ <ul className="text-muted">
<li>
- <strong>&middot; Administrators</strong>have full access to edit and manage content, permissions and all site settings.
+ <strong>Administrators</strong> have full access to edit and manage content, permissions and all site settings.
</li>
<li>
- <strong>&middot; Collaborators</strong> can edit and manage content, but not permissions and settings.
+ <strong>Collaborators</strong> can edit and manage content, but not permissions and settings.
</li>
<li>
- <strong>&middot; Blocked</strong> users are unable to log into this site.
+ <strong>Blocked</strong> users are unable to log into this site.
</li>
</ul>
</>
diff --git a/public/pages/Administration/pages/ManageTags.page.scss b/public/pages/Administration/pages/ManageTags.page.scss
deleted file mode 100644
index 3aebe4eed..000000000
--- a/public/pages/Administration/pages/ManageTags.page.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-#p-admin-tags {
- .c-list-item {
- .content {
- display: inline-block;
- margin-left: 5px;
- }
- }
-}
diff --git a/public/pages/Administration/pages/ManageTags.page.tsx b/public/pages/Administration/pages/ManageTags.page.tsx
index fa86d9365..09d5fb257 100644
--- a/public/pages/Administration/pages/ManageTags.page.tsx
+++ b/public/pages/Administration/pages/ManageTags.page.tsx
@@ -1,14 +1,12 @@
-import "./ManageTags.page.scss"
-
import React from "react"
-import { Button, Segment, List, ListItem, Heading } from "@fider/components"
+import { Button } from "@fider/components"
import { Tag } from "@fider/models"
import { actions, Failure, Fider } from "@fider/services"
-import { FaTags } from "react-icons/fa"
import { AdminBasePage } from "../components/AdminBasePage"
import { TagFormState, TagForm } from "../components/TagForm"
import { TagListItem } from "../components/TagListItem"
+import { VStack } from "@fider/components/layout"
interface ManageTagsPageProps {
tags: Tag[]
@@ -33,7 +31,6 @@ const tagSorter = (t1: Tag, t2: Tag) => {
export default class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTagsPageState> {
public id = "p-admin-tags"
public name = "tags"
- public icon = FaTags
public title = "Tags"
public subtitle = "Manage your site tags"
@@ -95,36 +92,31 @@ export default class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, M
const form =
Fider.session.user.isAdministrator &&
(this.state.isAdding ? (
- <Segment>
- <TagForm onSave={this.saveNewTag} onCancel={this.cancelAdd} />
- </Segment>
+ <TagForm onSave={this.saveNewTag} onCancel={this.cancelAdd} />
) : (
- <Button color="positive" onClick={this.addNew}>
+ <Button variant="secondary" onClick={this.addNew}>
Add new
</Button>
))
return (
- <>
- <Segment>
- <List divided={true}>
- <ListItem>
- <Heading size="small" title="Public Tags" subtitle="These tags are visible to all visitors." />
- </ListItem>
- {publicTaglist.length === 0 ? <ListItem>There aren’t any public tags yet.</ListItem> : publicTaglist}
- </List>
- </Segment>
-
- <Segment>
- <List divided={true}>
- <ListItem>
- <Heading size="small" title="Private Tags" subtitle="These tags are only visible for members of this site." />
- </ListItem>
- {privateTagList.length === 0 ? <ListItem>There aren’t any private tags yet.</ListItem> : privateTagList}
- </List>
- </Segment>
- {form}
- </>
+ <VStack spacing={8}>
+ <div>
+ <h2 className="text-display">Public Tags</h2>
+ <p className="text-muted">These tags are visible to all visitors.</p>
+ <VStack spacing={4} divide={true}>
+ {publicTaglist.length === 0 ? <p className="text-muted">There aren’t any public tags yet.</p> : publicTaglist}
+ </VStack>
+ </div>
+ <div>
+ <h2 className="text-display">Private Tags</h2>
+ <p className="text-muted">These tags are only visible for members of this site.</p>
+ <VStack spacing={4} divide={true}>
+ {privateTagList.length === 0 ? <p className="text-muted">There aren’t any private tags yet.</p> : privateTagList}
+ </VStack>
+ </div>
+ <div>{form}</div>
+ </VStack>
)
}
}
diff --git a/public/pages/Administration/pages/PrivacySettings.page.scss b/public/pages/Administration/pages/PrivacySettings.page.scss
deleted file mode 100644
index 7d7d31133..000000000
--- a/public/pages/Administration/pages/PrivacySettings.page.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-#p-admin-privacy {
- label .c-toggle {
- margin-left: 10px;
- }
-}
diff --git a/public/pages/Administration/pages/PrivacySettings.page.tsx b/public/pages/Administration/pages/PrivacySettings.page.tsx
index 0fba8e72e..5236c30b5 100644
--- a/public/pages/Administration/pages/PrivacySettings.page.tsx
+++ b/public/pages/Administration/pages/PrivacySettings.page.tsx
@@ -1,10 +1,7 @@
-import "./PrivacySettings.page.scss"
-
import React from "react"
-import { Toggle, Form } from "@fider/components/common"
+import { Toggle, Form, Field } from "@fider/components"
import { actions, notify, Fider } from "@fider/services"
import { AdminBasePage } from "@fider/pages/Administration/components/AdminBasePage"
-import { FaKey } from "react-icons/fa"
interface PrivacySettingsPageState {
isPrivate: boolean
@@ -13,7 +10,6 @@ interface PrivacySettingsPageState {
export default class PrivacySettingsPage extends AdminBasePage<any, PrivacySettingsPageState> {
public id = "p-admin-privacy"
public name = "privacy"
- public icon = FaKey
public title = "Privacy"
public subtitle = "Manage your site privacy"
@@ -42,14 +38,13 @@ export default class PrivacySettingsPage extends AdminBasePage<any, PrivacySetti
public content() {
return (
<Form>
- <div className="c-form-field">
- <label htmlFor="private">Private site</label>
+ <Field label="Private Site">
<Toggle disabled={!Fider.session.user.isAdministrator} active={this.state.isPrivate} onToggle={this.toggle} />
- <p className="info">
+ <p className="text-muted mt-1">
A private site prevents unauthenticated users from viewing or interacting with its content. <br /> If enabled, only already registered and invited
users will be able to sign in to this site.
</p>
- </div>
+ </Field>
</Form>
)
}
diff --git a/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx b/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
index fc838493e..69a35d801 100644
--- a/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
+++ b/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
@@ -52,7 +52,7 @@ export default class CompleteSignInProfilePage extends React.Component<HomePageP
maxLength={100}
placeholder="Name"
suffix={
- <Button type="submit" onClick={this.submit} color="positive" disabled={this.state.name === ""}>
+ <Button type="submit" onClick={this.submit} variant="primary" disabled={this.state.name === ""}>
Submit
</Button>
}
diff --git a/public/pages/DesignSystem/DesignSystem.page.scss b/public/pages/DesignSystem/DesignSystem.page.scss
new file mode 100644
index 000000000..5b0187b81
--- /dev/null
+++ b/public/pages/DesignSystem/DesignSystem.page.scss
@@ -0,0 +1,21 @@
+@import "~@fider/assets/styles/variables.scss";
+
+#p-ui-toolkit {
+ .color {
+ width: 40px;
+ height: 40px;
+ display: inline-block;
+ margin: 2px;
+ border-radius: 4px;
+
+ @each $name, $shades in $colors {
+ @if type-of($shades) == "map" {
+ @each $shade, $color in $shades {
+ &.#{$name}-#{$shade} {
+ background-color: $color;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/public/pages/DesignSystem/DesignSystem.page.tsx b/public/pages/DesignSystem/DesignSystem.page.tsx
new file mode 100644
index 000000000..a3e1b31c3
--- /dev/null
+++ b/public/pages/DesignSystem/DesignSystem.page.tsx
@@ -0,0 +1,457 @@
+import "./DesignSystem.page.scss"
+
+import React, { useState } from "react"
+import { PostStatus, UserStatus } from "@fider/models"
+import {
+ PageTitle,
+ Button,
+ UserName,
+ Toggle,
+ Avatar,
+ ShowTag,
+ ShowPostStatus,
+ Moment,
+ Loader,
+ Form,
+ Input,
+ TextArea,
+ RadioButton,
+ Select,
+ SelectOption,
+ ButtonClickEvent,
+ Message,
+ Hint,
+ AvatarStack,
+ SocialSignInButton,
+ Dropdown,
+ Icon,
+ Checkbox,
+ ImageUploader,
+} from "@fider/components"
+import { User, UserRole, Tag } from "@fider/models"
+import { notify, Failure } from "@fider/services"
+import { HStack, VStack } from "@fider/components/layout"
+import IconLightBulb from "@fider/assets/images/heroicons-light-bulb.svg"
+import IconSearch from "@fider/assets/images/heroicons-search.svg"
+
+const jonSnow: User = {
+ id: 0,
+ name: "Jon Snow",
+ role: UserRole.Administrator,
+ status: UserStatus.Active,
+ avatarURL:
+ "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&ixqx=1JzWlMeJDF&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
+}
+
+const aryaStark: User = {
+ id: 0,
+ name: "Arya Snow",
+ role: UserRole.Visitor,
+ status: UserStatus.Active,
+ avatarURL: "https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
+}
+
+const robStark: User = {
+ id: 0,
+ name: "Robert Stark",
+ role: UserRole.Visitor,
+ status: UserStatus.Active,
+ avatarURL:
+ "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1&ixqx=1JzWlMeJDF&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.25&w=256&h=256&q=80",
+}
+
+const easyTag: Tag = { id: 1, slug: "easy", name: "Easy", color: "82c460", isPublic: true }
+const normalTag: Tag = { id: 2, slug: "normal", name: "Normal", color: "ebb134", isPublic: false }
+const hardTag: Tag = { id: 3, slug: "hard", name: "Hard", color: "9c3630", isPublic: false }
+
+const visibilityPublic = { label: "Public", value: "public" }
+const visibilityPrivate = { label: "Private", value: "private" }
+
+const DesignSystemPage = () => {
+ const [error, setError] = useState<Failure | undefined>(undefined)
+
+ const notifyError = async () => {
+ notify.error("Something went wrong...")
+ }
+
+ const notifySuccess = async () => {
+ notify.success("Congratulations! It worked!")
+ }
+
+ const notifyStatusChange = (opt?: SelectOption) => {
+ if (opt) {
+ notify.success(opt.value)
+ }
+ }
+
+ const showLoading = (e: ButtonClickEvent): void => {
+ return e.preventEnable()
+ }
+
+ const forceError = async () => {
+ setError({
+ errors: [
+ { field: "title", message: "Title is mandatory" },
+ { field: "description", message: "Error #1" },
+ { field: "description", message: "Error #2" },
+ { field: "status", message: "Status is mandatory" },
+ { field: "logo", message: "Logo is mandatory" },
+ { field: "gdpr", message: "You have to agree!" },
+ ],
+ })
+ }
+
+ return (
+ <div id="p-ui-toolkit" className="page container">
+ <h2 className="text-display2 mb-2">1. Colors</h2>
+
+ <div className="color-scale">
+ <div className="color gray-900" />
+ <div className="color gray-800" />
+ <div className="color gray-700" />
+ <div className="color gray-600" />
+ <div className="color gray-500" />
+ <div className="color gray-400" />
+ <div className="color gray-300" />
+ <div className="color gray-200" />
+ <div className="color gray-100" />
+ <div className="color gray-50" />
+ </div>
+ <div className="color-scale">
+ <div className="color green-900" />
+ <div className="color green-800" />
+ <div className="color green-700" />
+ <div className="color green-600" />
+ <div className="color green-500" />
+ <div className="color green-400" />
+ <div className="color green-300" />
+ <div className="color green-200" />
+ <div className="color green-100" />
+ <div className="color green-50" />
+ </div>
+ <div className="color-scale">
+ <div className="color red-900" />
+ <div className="color red-800" />
+ <div className="color red-700" />
+ <div className="color red-600" />
+ <div className="color red-500" />
+ <div className="color red-400" />
+ <div className="color red-300" />
+ <div className="color red-200" />
+ <div className="color red-100" />
+ <div className="color red-50" />
+ </div>
+ <div className="color-scale">
+ <div className="color blue-900" />
+ <div className="color blue-800" />
+ <div className="color blue-700" />
+ <div className="color blue-600" />
+ <div className="color blue-500" />
+ <div className="color blue-400" />
+ <div className="color blue-300" />
+ <div className="color blue-200" />
+ <div className="color blue-100" />
+ <div className="color blue-50" />
+ </div>
+ <div className="color-scale">
+ <div className="color yellow-900" />
+ <div className="color yellow-800" />
+ <div className="color yellow-700" />
+ <div className="color yellow-600" />
+ <div className="color yellow-500" />
+ <div className="color yellow-400" />
+ <div className="color yellow-300" />
+ <div className="color yellow-200" />
+ <div className="color yellow-full" />
+ <div className="color yellow-50" />
+ </div>
+ <div className="color-scale">
+ <div className="color bg-primary-dark" />
+ <div className="color bg-primary-base" />
+ <div className="color bg-primary-light" />
+ </div>
+
+ <h2 className="text-display2 mb-3 mt-6">2. Text</h2>
+
+ <VStack>
+ <span className="text-display2">text-display2</span>
+ <span className="text-display">text-display</span>
+ <span className="text-title">text-title</span>
+ <span className="text-body">text-body</span>
+ <span className="text-sm">text-sm</span>
+ <span className="text-xs">text-xs</span>
+ <span className="text-2xs">text-2xs</span>
+ <span className="text-muted">text-muted</span>
+ <span className="text-category">text-category</span>
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">3. Avatars</h2>
+
+ <VStack>
+ <HStack>
+ <Avatar user={jonSnow} /> <UserName user={jonSnow} />
+ </HStack>
+ <HStack>
+ <Avatar user={aryaStark} /> <UserName user={aryaStark} />
+ </HStack>
+ <HStack>
+ <AvatarStack users={[jonSnow, aryaStark, robStark]} />
+ </HStack>
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">4. Page Title</h2>
+
+ <PageTitle title="Page Title" subtitle="This is a page subtitle" />
+
+ <h2 className="text-display2 mb-3 mt-6">5. Buttons</h2>
+
+ <VStack>
+ <HStack>
+ <Button variant="primary" size="large">
+ Primary
+ </Button>
+ <Button size="large">
+ <Icon sprite={IconLightBulb} /> <span>Secondary</span>
+ </Button>
+ <Button size="large">
+ <Icon sprite={IconLightBulb} />
+ </Button>
+ <Button size="large">Secondary</Button>
+ <Button variant="tertiary" size="large">
+ Tertiary
+ </Button>
+ <Button variant="danger" size="large">
+ Danger
+ </Button>
+ </HStack>
+
+ <HStack>
+ <Button variant="primary">Primary</Button>
+ <Button>
+ <Icon sprite={IconLightBulb} /> <span>Secondary</span>
+ </Button>
+ <Button>
+ <Icon sprite={IconLightBulb} />
+ </Button>
+ <Button>Secondary</Button>
+ <Button variant="tertiary">Tertiary</Button>
+ <Button variant="danger">Danger</Button>
+ </HStack>
+
+ <HStack>
+ <Button variant="primary" size="small">
+ Primary
+ </Button>
+ <Button size="small">
+ <Icon sprite={IconLightBulb} /> <span>Secondary</span>
+ </Button>
+ <Button size="small">
+ <Icon sprite={IconLightBulb} />
+ </Button>
+ <Button size="small">Secondary</Button>
+ <Button variant="tertiary" size="small">
+ Tertiary
+ </Button>
+ <Button variant="danger" size="small">
+ Danger
+ </Button>
+ </HStack>
+
+ <HStack>
+ <Button href="#" variant="primary">
+ Link
+ </Button>
+ <Button href="#">
+ <Icon sprite={IconLightBulb} /> <span>Link</span>
+ </Button>
+ <Button href="#">
+ <Icon sprite={IconLightBulb} />
+ </Button>
+ <Button>Link</Button>
+ <Button variant="tertiary" href="#">
+ Link
+ </Button>
+ <Button href="#" variant="danger">
+ Link
+ </Button>
+ </HStack>
+
+ <HStack>
+ <Button disabled={true} variant="primary">
+ Primary
+ </Button>
+ <Button disabled={true}>
+ <Icon sprite={IconLightBulb} /> <span>Secondary</span>
+ </Button>
+ <Button disabled={true}>
+ <Icon sprite={IconLightBulb} />
+ </Button>
+ <Button disabled={true}>Secondary</Button>
+ <Button disabled={true} variant="tertiary">
+ Tertiary
+ </Button>
+ <Button disabled={true} variant="danger">
+ Danger
+ </Button>
+ </HStack>
+
+ <HStack>
+ <Button variant="primary" onClick={showLoading}>
+ Loading
+ </Button>
+ <Button onClick={showLoading}>
+ <Icon sprite={IconLightBulb} /> <span>Loading</span>
+ </Button>
+ <Button onClick={showLoading}>
+ <Icon sprite={IconLightBulb} />
+ </Button>
+ <Button onClick={showLoading}>Loading</Button>
+ <Button variant="tertiary" onClick={showLoading}>
+ Loading
+ </Button>
+ <Button variant="danger" onClick={showLoading}>
+ Loading
+ </Button>
+ </HStack>
+
+ <HStack>
+ <SocialSignInButton option={{ displayName: "GitHub", provider: "github" }} />
+ <SocialSignInButton option={{ displayName: "Facebook", provider: "facebook" }} />
+ <SocialSignInButton option={{ displayName: "Google", provider: "google" }} />
+ </HStack>
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">6. Toggle</h2>
+
+ <VStack>
+ <Toggle active={true} label="Active" />
+ <Toggle active={false} label="Inactive" />
+ <Toggle active={true} disabled={true} label="Disabled" />
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">7. Statuses</h2>
+
+ <VStack>
+ <ShowPostStatus status={PostStatus.Open} />
+ <ShowPostStatus status={PostStatus.Planned} />
+ <ShowPostStatus status={PostStatus.Started} />
+ <ShowPostStatus status={PostStatus.Duplicate} />
+ <ShowPostStatus status={PostStatus.Completed} />
+ <ShowPostStatus status={PostStatus.Declined} />
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">8. Tags</h2>
+
+ <VStack>
+ <HStack>
+ <ShowTag tag={easyTag} />
+ <ShowTag tag={normalTag} />
+ <ShowTag tag={hardTag} />
+ </HStack>
+ <HStack>
+ <ShowTag tag={easyTag} circular={true} />
+ <ShowTag tag={normalTag} circular={true} />
+ <ShowTag tag={hardTag} circular={true} />
+ </HStack>
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">9. Notification</h2>
+
+ <HStack>
+ <Button onClick={notifySuccess}>Success</Button>
+ <Button onClick={notifyError}>Error</Button>
+ </HStack>
+
+ <h2 className="text-display2 mb-3 mt-6">10. Moment</h2>
+
+ <VStack>
+ <div>
+ Relative: <Moment date="2017-06-03T16:55:06.815042Z" format="relative" />
+ </div>
+ <div>
+ Short: <Moment date="2017-06-03T16:55:06.815042Z" format="short" />
+ </div>
+ <div>
+ Full: <Moment date="2017-06-03T16:55:06.815042Z" format="full" />
+ </div>
+ </VStack>
+
+ <h2 className="text-display2 mb-3 mt-6">11. Loader</h2>
+
+ <Loader />
+
+ <h2 className="text-display2 mb-3 mt-6">12. Message</h2>
+
+ <Message showIcon={true} type="error">
+ Something went wrong.
+ </Message>
+ <Message showIcon={true} type="warning">
+ Be careful!
+ </Message>
+ <Message showIcon={true} type="success">
+ Your order has been confirmed.
+ </Message>
+
+ <h2 className="text-display2 mb-3 mt-6">13. Hints</h2>
+
+ <Hint permanentCloseKey="ui-toolkip-example">Did you know that you can close this permanently?</Hint>
+ <Hint>You can&apos;t close this one :)</Hint>
+
+ <h2 className="text-display2 mb-3 mt-6">14. Form</h2>
+
+ <Form error={error}>
+ <Input label="Title" field="title">
+ <p className="text-muted">This is the explanation for the field above.</p>
+ </Input>
+ <Input label="Disabled!" field="unamed" disabled={true} value={"you can't change this!"} />
+ <Input label="Name" field="name" placeholder={"Your name goes here..."} />
+ <Input label="Subdomain" field="subdomain" suffix=".fider.io" />
+ <Input label="Email" field="email" suffix={<Button variant="primary">Sign in</Button>} />
+ <TextArea label="Description" field="description" minRows={5}>
+ <p className="text-muted">This textarea resizes as you type.</p>
+ </TextArea>
+ <Input field="age" placeholder="This field doesn't have a label" />
+
+ <div className="grid gap-4 grid-cols-4">
+ <Input label="Title1" field="title1" />
+ <Input label="Title2" field="title2" />
+ <Input label="Title3" field="title3" />
+ <RadioButton label="Visibility" field="visibility" defaultOption={visibilityPublic} options={[visibilityPrivate, visibilityPublic]} />
+ </div>
+
+ <Select
+ label="Status"
+ field="status"
+ options={[
+ { value: "open", label: "Open" },
+ { value: "started", label: "Started" },
+ { value: "planned", label: "Planned" },
+ ]}
+ onChange={notifyStatusChange}
+ />
+
+ <ImageUploader label="Logo" field="logo" onChange={console.log} />
+
+ <Checkbox field="gdpr">I agree with this policy.</Checkbox>
+
+ <Button onClick={forceError}>Save</Button>
+ </Form>
+
+ <h2 className="text-display2 mb-3 mt-6">15. Dropdown</h2>
+
+ <Dropdown renderHandle={<Avatar user={aryaStark} />}>
+ <div className="p-2 text-bold uppercase">Arya Stark</div>
+ <Dropdown.ListItem>Account Settings</Dropdown.ListItem>
+ <Dropdown.ListItem>My Profile</Dropdown.ListItem>
+ <Dropdown.Divider />
+ <Dropdown.ListItem>Sign Out</Dropdown.ListItem>
+ </Dropdown>
+
+ <h2 className="text-display2 mb-3 mt-6">16. Search</h2>
+
+ <Input field="search" placeholder="Search..." icon={IconSearch} />
+ </div>
+ )
+}
+
+export default DesignSystemPage
diff --git a/public/pages/DesignSystem/index.ts b/public/pages/DesignSystem/index.ts
new file mode 100644
index 000000000..b4a860d1a
--- /dev/null
+++ b/public/pages/DesignSystem/index.ts
@@ -0,0 +1 @@
+export * from "./DesignSystem.page"
diff --git a/public/pages/Error/Error.page.scss b/public/pages/Error/Error.page.scss
deleted file mode 100644
index 2f1921546..000000000
--- a/public/pages/Error/Error.page.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-error {
- .error {
- margin-top: 15px;
- }
-}
diff --git a/public/pages/Error/Error.page.tsx b/public/pages/Error/Error.page.tsx
index 0720e94c0..4a2a0ab4c 100644
--- a/public/pages/Error/Error.page.tsx
+++ b/public/pages/Error/Error.page.tsx
@@ -1,5 +1,3 @@
-import "./Error.page.scss"
-
import React from "react"
import { TenantLogo } from "@fider/components"
import { useFider } from "@fider/hooks"
@@ -14,17 +12,25 @@ export const ErrorPage = (props: ErrorPageProps) => {
const fider = useFider()
return (
- <div id="p-error" className="container failure-page">
- <TenantLogo size={100} useFiderIfEmpty={true} />
- <h1>Shoot! Well, this is unexpected…</h1>
- <p>An error has occurred and we&apos;re working to fix the problem!</p>
- {fider.settings && (
- <span>
- Take me back to <a href={fider.settings.baseURL}>{fider.settings.baseURL}</a> home page.
- </span>
- )}
+ <div id="p-error" className="container page">
+ <div className="w-max-7xl mx-auto">
+ <div className="h-20 text-center mb-4">
+ <TenantLogo size={100} useFiderIfEmpty={true} />
+ </div>
+ <h1 className="text-display">Shoot! Well, this is unexpected…</h1>
+ <p>An error has occurred and we&apos;re working to fix the problem!</p>
+ {fider.settings && (
+ <span>
+ Take me back to{" "}
+ <a className="text-link" href={fider.settings.baseURL}>
+ {fider.settings.baseURL}
+ </a>{" "}
+ home page.
+ </span>
+ )}
+ </div>
{props.showDetails && (
- <pre className="error">
+ <pre>
{props.error.toString()}
{props.errorInfo.componentStack}
</pre>
diff --git a/public/pages/Home/Home.page.scss b/public/pages/Home/Home.page.scss
index c9e70f5a2..46a301ca2 100644
--- a/public/pages/Home/Home.page.scss
+++ b/public/pages/Home/Home.page.scss
@@ -1,75 +1,31 @@
@import "~@fider/assets/styles/variables.scss";
#p-home {
- .welcome-message {
- margin-bottom: 10px;
- }
+ display: grid;
+ grid-template-columns: 1fr;
+ column-gap: 0;
+ row-gap: spacing(6);
- .l-lonely {
- .c-hint {
- max-width: 500px;
- text-align: left;
- margin: 0 auto 10px auto;
- }
+ @include media("lg") {
+ grid-template-columns: 1fr 1fr 1fr;
+ column-gap: spacing(6);
+ row-gap: 0;
}
- .l-welcome-col {
- @include media("sm") {
- background-color: $gray-100;
- box-shadow: 1px 2px 5px 1px $gray-300;
- border-radius: 3px;
- margin: 0px 10px 10px 10px;
- }
- }
+ .p-home {
+ &__welcome-col {
+ background-color: get("colors.gray.100");
+ padding: spacing(2);
+ border-radius: get("border.radius.medium");
- .l-filter-col {
- display: flex;
- align-items: center;
- @include media(">=md") {
- padding-left: 25px;
- }
- .c-form-field {
- > div {
- display: inline-block;
- .subtitle {
- display: inline-block;
- margin: 6px 0 0 0;
- }
- }
- }
- .c-dropdown {
- .c-dropdown-control {
+ @include media("lg") {
+ padding: 0;
background-color: transparent;
- font-weight: bold;
- border: none;
- font-size: $font-size-tiny;
- text-transform: uppercase;
- padding: 5px 25px 5px 5px;
- &:hover {
- background-color: $gray-200;
- }
}
}
- }
- .l-tags-filter {
- .selected.item {
- background-color: transparent;
- font-weight: normal;
- }
- .c-tag {
- margin: 0 5px 0 0;
- }
- .icon {
- height: 12px;
- margin-right: 2px;
- vertical-align: top;
- color: transparent;
- }
- .selected-tag {
- .icon {
- color: $green-400;
- }
+ &__posts-col {
+ grid-column: span 2 / span 2;
}
}
}
diff --git a/public/pages/Home/Home.page.tsx b/public/pages/Home/Home.page.tsx
index 5bc040926..b9d9634cf 100644
--- a/public/pages/Home/Home.page.tsx
+++ b/public/pages/Home/Home.page.tsx
@@ -3,11 +3,12 @@ import NoDataIllustration from "@fider/assets/images/undraw-no-data.svg"
import React, { useState } from "react"
import { Post, Tag, PostStatus } from "@fider/models"
-import { MultiLineText, Hint, PoweredByFider } from "@fider/components"
+import { Markdown, Hint, PoweredByFider, Icon } from "@fider/components"
import { SimilarPosts } from "./components/SimilarPosts"
import { PostInput } from "./components/PostInput"
import { PostsContainer } from "./components/PostsContainer"
import { useFider } from "@fider/hooks"
+import { VStack } from "@fider/components/layout"
export interface HomePageProps {
posts: Post[]
@@ -23,15 +24,15 @@ const Lonely = () => {
const fider = useFider()
return (
- <div className="l-lonely center">
+ <div className="text-center">
<Hint permanentCloseKey="at-least-3-posts" condition={fider.session.isAuthenticated && fider.session.user.isAdministrator}>
- It&apos;s recommended that you post <strong>at least 3</strong> suggestions here before sharing this site. The initial content is key to start the
- interactions with your audience.
+ <p>
+ It&apos;s recommended that you create <strong>at least 3</strong> suggestions here before sharing this site. The initial content is important to start
+ engaging your audience.
+ </p>
</Hint>
- <p>
- <img alt="No Posts" height="100" src={NoDataIllustration} />
- </p>
- <p>No posts have been created yet.</p>
+ <Icon sprite={NoDataIllustration} height="120" className="mt-6 mb-2" />
+ <p className="text-muted">No posts have been created yet.</p>
</div>
)
}
@@ -59,21 +60,22 @@ const HomePage = (props: HomePageProps) => {
return (
<div id="p-home" className="page container">
- <div className="row">
- <div className="l-welcome-col col-md-4">
- <MultiLineText className="welcome-message" text={fider.session.tenant.welcomeMessage || defaultWelcomeMessage} style="full" />
+ <div className="p-home__welcome-col">
+ <VStack spacing={2}>
+ <Markdown text={fider.session.tenant.welcomeMessage || defaultWelcomeMessage} style="full" />
<PostInput placeholder={fider.session.tenant.invitation || "Enter your suggestion here..."} onTitleChanged={setTitle} />
- <PoweredByFider />
- </div>
- <div className="l-posts-col col-md-8">
- {isLonely() ? (
- <Lonely />
- ) : title ? (
- <SimilarPosts title={title} tags={props.tags} />
- ) : (
- <PostsContainer posts={props.posts} tags={props.tags} countPerStatus={props.countPerStatus} />
- )}
- </div>
+ <PoweredByFider className="sm:hidden md:hidden lg:block" />
+ </VStack>
+ </div>
+ <div className="p-home__posts-col">
+ {isLonely() ? (
+ <Lonely />
+ ) : title ? (
+ <SimilarPosts title={title} tags={props.tags} />
+ ) : (
+ <PostsContainer posts={props.posts} tags={props.tags} countPerStatus={props.countPerStatus} />
+ )}
+ <PoweredByFider className="lg:hidden xl:hidden mt-8" />
</div>
</div>
)
diff --git a/public/pages/Home/components/ListPosts.scss b/public/pages/Home/components/ListPosts.scss
deleted file mode 100644
index 3f71bc5a8..000000000
--- a/public/pages/Home/components/ListPosts.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-post-list {
- .c-list-item {
- display: flex;
- border-top-width: 0.1px !important;
-
- .c-list-item-title {
- color: $gray-900;
- font-weight: 500;
- margin-bottom: 10px;
- font-size: $font-size-large;
- &:hover {
- color: $main-color;
- }
- }
-
- .c-list-item-content {
- flex-grow: 1;
- align-self: center;
-
- .c-tag {
- margin: 0 3px 3px 0;
- }
-
- svg.icon {
- vertical-align: middle;
- }
- }
-
- .c-list-item-description {
- color: $gray-700;
- margin-top: 10px;
- }
- }
-}
-
-.c-post-list-show-more {
- cursor: pointer;
- font-weight: 500;
- color: $main-color;
- margin-left: 55px;
-}
diff --git a/public/pages/Home/components/ListPosts.tsx b/public/pages/Home/components/ListPosts.tsx
index 58c2c0de2..4a27559d5 100644
--- a/public/pages/Home/components/ListPosts.tsx
+++ b/public/pages/Home/components/ListPosts.tsx
@@ -1,9 +1,8 @@
-import "./ListPosts.scss"
-
import React from "react"
import { Post, Tag, CurrentUser } from "@fider/models"
-import { ShowTag, ShowPostResponse, VoteCounter, MultiLineText, ListItem, List } from "@fider/components"
-import { FaRegComments } from "react-icons/fa"
+import { ShowTag, ShowPostResponse, VoteCounter, Markdown, Icon } from "@fider/components"
+import IconChatAlt2 from "@fider/assets/images/heroicons-chat-alt-2.svg"
+import { HStack, VStack } from "@fider/components/layout"
interface ListPostsProps {
posts?: Post[]
@@ -13,24 +12,30 @@ interface ListPostsProps {
const ListPostItem = (props: { post: Post; user?: CurrentUser; tags: Tag[] }) => {
return (
- <ListItem>
+ <HStack center={false}>
<VoteCounter post={props.post} />
- <div className="c-list-item-content">
- {props.post.commentsCount > 0 && (
- <div className="info right">
- {props.post.commentsCount} <FaRegComments />
- </div>
+ <VStack className="w-full" spacing={2}>
+ <HStack justify="between">
+ <a className="text-title hover:text-primary-base" href={`/posts/${props.post.number}/${props.post.slug}`}>
+ {props.post.title}
+ </a>
+ {props.post.commentsCount > 0 && (
+ <HStack className="text-muted">
+ {props.post.commentsCount} <Icon sprite={IconChatAlt2} className="h-4 ml-1" />
+ </HStack>
+ )}
+ </HStack>
+ <Markdown className="text-gray-600" maxLength={300} text={props.post.description} style="plainText" />
+ <ShowPostResponse status={props.post.status} response={props.post.response} />
+ {props.tags.length >= 1 && (
+ <HStack className="flex-wrap">
+ {props.tags.map((tag) => (
+ <ShowTag key={tag.id} tag={tag} />
+ ))}
+ </HStack>
)}
- <a className="c-list-item-title" href={`/posts/${props.post.number}/${props.post.slug}`}>
- {props.post.title}
- </a>
- <MultiLineText className="c-list-item-description" maxLength={300} text={props.post.description} style="plainText" />
- <ShowPostResponse showUser={false} status={props.post.status} response={props.post.response} />
- {props.tags.map((tag) => (
- <ShowTag key={tag.id} tag={tag} />
- ))}
- </div>
- </ListItem>
+ </VStack>
+ </HStack>
)
}
@@ -40,14 +45,14 @@ export const ListPosts = (props: ListPostsProps) => {
}
if (props.posts.length === 0) {
- return <p className="center">{props.emptyText}</p>
+ return <p className="text-center">{props.emptyText}</p>
}
return (
- <List className="c-post-list" divided={true}>
+ <VStack spacing={4} divide={true}>
{props.posts.map((post) => (
<ListPostItem key={post.id} post={post} tags={props.tags.filter((tag) => post.tags.indexOf(tag.slug) >= 0)} />
))}
- </List>
+ </VStack>
)
}
diff --git a/public/pages/Home/components/PostFilter.scss b/public/pages/Home/components/PostFilter.scss
deleted file mode 100644
index 8a742f340..000000000
--- a/public/pages/Home/components/PostFilter.scss
+++ /dev/null
@@ -1,25 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.l-post-filter {
- vertical-align: middle;
-
- .c-dropdown-menu {
- max-height: -webkit-max-content;
- max-height: -moz-max-content;
- max-height: max-content;
- }
-
- .counter {
- font-size: 8px;
- background-color: $gray-200;
- color: $gray-900;
- display: inline-block;
- min-width: 15px;
- padding: 0px 5px;
- margin-left: 5px;
- text-align: center;
- border-radius: 10px;
- vertical-align: top;
- font-weight: 600;
- }
-}
diff --git a/public/pages/Home/components/PostFilter.tsx b/public/pages/Home/components/PostFilter.tsx
index 658afb585..1900ae52e 100644
--- a/public/pages/Home/components/PostFilter.tsx
+++ b/public/pages/Home/components/PostFilter.tsx
@@ -1,8 +1,7 @@
-import "./PostFilter.scss"
-
-import React from "react"
+import React, { useState } from "react"
import { PostStatus } from "@fider/models"
-import { DropDown, DropDownItem } from "@fider/components"
+import { Dropdown } from "@fider/components"
+import { HStack } from "@fider/components/layout"
import { useFider } from "@fider/hooks"
interface PostFilterProps {
@@ -11,14 +10,22 @@ interface PostFilterProps {
viewChanged: (name: string) => void
}
+interface OptionItem {
+ value: string
+ label: string
+ count?: number
+}
+
export const PostFilter = (props: PostFilterProps) => {
const fider = useFider()
+ const [view, setView] = useState<string>(props.activeView)
- const handleChangeView = (item: DropDownItem) => {
- props.viewChanged(item.value as string)
+ const handleChangeView = (item: OptionItem) => () => {
+ setView(item.value)
+ props.viewChanged(item.value)
}
- const options: DropDownItem[] = [
+ const options: OptionItem[] = [
{ value: "trending", label: "Trending" },
{ value: "recent", label: "Recent" },
{ value: "most-wanted", label: "Most Wanted" },
@@ -33,29 +40,26 @@ export const PostFilter = (props: PostFilterProps) => {
options.push({
label: s.title,
value: s.value,
- render: (
- <span>
- {s.title} <a className="counter">{props.countPerStatus[s.value]}</a>
- </span>
- ),
+ count: props.countPerStatus[s.value],
})
})
- const viewExists = options.filter((x) => x.value === props.activeView).length > 0
- const activeView = viewExists ? props.activeView : "trending"
+ const selectedItem = options.filter((x) => x.value === view)
+ const label = selectedItem.length > 0 ? selectedItem[0].label : options[0].label
return (
- <div>
- <span className="subtitle">View</span>
- <DropDown
- header="What do you want to see?"
- className="l-post-filter"
- inline={true}
- style="simple"
- items={options}
- defaultValue={activeView}
- onChange={handleChangeView}
- />
- </div>
+ <HStack>
+ <span className="text-category">View</span>
+ <Dropdown renderHandle={<div className="text-medium text-xs uppercase rounded-md uppercase bg-gray-100 px-2 py-1">{label}</div>}>
+ {options.map((o) => (
+ <Dropdown.ListItem onClick={handleChangeView(o)} key={o.value}>
+ <HStack spacing={2}>
+ <span className={view === o.value ? "text-semibold" : ""}>{o.label}</span>
+ <div>{o.count && o.count > 0 && <span className="bg-gray-200 inline-block rounded-full px-1 w-min-4 text-2xs text-center">{o.count}</span>}</div>
+ </HStack>
+ </Dropdown.ListItem>
+ ))}
+ </Dropdown>
+ </HStack>
)
}
diff --git a/public/pages/Home/components/PostInput.tsx b/public/pages/Home/components/PostInput.tsx
index 7f830ff65..84d776835 100644
--- a/public/pages/Home/components/PostInput.tsx
+++ b/public/pages/Home/components/PostInput.tsx
@@ -71,8 +71,8 @@ export const PostInput = (props: PostInputProps) => {
const details = () => (
<>
<TextArea field="description" onChange={handleDescriptionChange} value={description} minRows={5} placeholder="Describe your suggestion (optional)" />
- <MultiImageUploader field="attachments" maxUploads={3} previewMaxWidth={100} onChange={setAttachments} />
- <Button type="submit" color="positive" onClick={submit}>
+ <MultiImageUploader field="attachments" maxUploads={3} onChange={setAttachments} />
+ <Button type="submit" variant="primary" onClick={submit}>
Submit
</Button>
</>
diff --git a/public/pages/Home/components/PostsContainer.scss b/public/pages/Home/components/PostsContainer.scss
new file mode 100644
index 000000000..859be367c
--- /dev/null
+++ b/public/pages/Home/components/PostsContainer.scss
@@ -0,0 +1,34 @@
+@import "~@fider/assets/styles/variables.scss";
+
+.c-posts-container {
+ &__header {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ row-gap: spacing(3);
+ }
+
+ &__filter-col {
+ grid-column: span 3 / span 3;
+ display: flex;
+ flex-direction: column;
+ & > * + * {
+ margin-left: 0;
+ margin-top: spacing(1);
+ }
+
+ @include media("md") {
+ flex-direction: row;
+ & > * + * {
+ margin-left: spacing(1);
+ margin-top: 0;
+ }
+ }
+ }
+
+ &__search-col {
+ grid-auto-columns: auto;
+ &:first-child {
+ grid-column: 1 / -1;
+ }
+ }
+}
diff --git a/public/pages/Home/components/PostsContainer.tsx b/public/pages/Home/components/PostsContainer.tsx
index cf349a223..3c0917109 100644
--- a/public/pages/Home/components/PostsContainer.tsx
+++ b/public/pages/Home/components/PostsContainer.tsx
@@ -1,9 +1,12 @@
+import "./PostsContainer.scss"
+
import React from "react"
import { Post, Tag, CurrentUser } from "@fider/models"
-import { Loader, Field, Input } from "@fider/components"
+import { Loader, Input } from "@fider/components"
import { actions, navigator, querystring } from "@fider/services"
-import { FaTimes, FaSearch } from "react-icons/fa"
+import IconSearch from "@fider/assets/images/heroicons-search.svg"
+import IconX from "@fider/assets/images/heroicons-x.svg"
import { PostFilter } from "./PostFilter"
import { ListPosts } from "./ListPosts"
import { TagsFilter } from "./TagsFilter"
@@ -96,21 +99,20 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsCo
public render() {
const showMoreLink = this.getShowMoreLink()
+
return (
- <>
- <div className="row">
+ <div className="c-posts-container">
+ <div className="c-posts-container__header mb-4">
{!this.state.query && (
- <div className="l-filter-col col-7 col-md-8 col-lg-9 mb-2">
- <Field>
- <PostFilter activeView={this.state.view} viewChanged={this.handleViewChanged} countPerStatus={this.props.countPerStatus} />
- <TagsFilter tags={this.props.tags} selectionChanged={this.handleTagsFilterChanged} defaultSelection={this.state.tags} />
- </Field>
+ <div className="c-posts-container__filter-col">
+ <PostFilter activeView={this.state.view} viewChanged={this.handleViewChanged} countPerStatus={this.props.countPerStatus} />
+ <TagsFilter tags={this.props.tags} selectionChanged={this.handleTagsFilterChanged} selected={this.state.tags} />
</div>
)}
- <div className={!this.state.query ? `l-search-col col-5 col-md-4 col-lg-3 mb-2` : "col-sm-12 mb-2"}>
+ <div className="c-posts-container__search-col">
<Input
field="query"
- icon={this.state.query ? FaTimes : FaSearch}
+ icon={this.state.query ? IconX : IconSearch}
onIconClick={this.state.query ? this.clearSearch : undefined}
placeholder="Search..."
value={this.state.query}
@@ -121,11 +123,13 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsCo
<ListPosts posts={this.state.posts} tags={this.props.tags} emptyText={"No results matched your search, try something different."} />
{this.state.loading && <Loader />}
{showMoreLink && (
- <a href={showMoreLink} className="c-post-list-show-more" onTouchEnd={this.showMore} onClick={this.showMore}>
- View more posts
- </a>
+ <div className="my-4 ml-4">
+ <a href={showMoreLink} className="text-primary-base text-medium hover:underline" onClick={this.showMore}>
+ View more posts
+ </a>
+ </div>
)}
- </>
+ </div>
)
}
}
diff --git a/public/pages/Home/components/SimilarPosts.tsx b/public/pages/Home/components/SimilarPosts.tsx
index 13c49c681..8c14f1b96 100644
--- a/public/pages/Home/components/SimilarPosts.tsx
+++ b/public/pages/Home/components/SimilarPosts.tsx
@@ -1,9 +1,8 @@
import React from "react"
import { Post, Tag, CurrentUser } from "@fider/models"
-import { Heading, Loader } from "@fider/components"
+import { PageTitle, Loader } from "@fider/components"
import { ListPosts } from "./ListPosts"
import { actions } from "@fider/services"
-import { FaRegLightbulb } from "react-icons/fa"
interface SimilarPostsProps {
title: string
@@ -59,7 +58,7 @@ export class SimilarPosts extends React.Component<SimilarPostsProps, SimilarPost
public render() {
return (
<>
- <Heading title="Similar posts" subtitle="Consider voting on existing posts instead." icon={FaRegLightbulb} size="small" dividing={true} />
+ <PageTitle title="Similar posts" subtitle="Consider voting on existing posts instead." />
{this.state.loading ? (
<Loader />
) : (
diff --git a/public/pages/Home/components/TagsFilter.scss b/public/pages/Home/components/TagsFilter.scss
deleted file mode 100644
index 7cb659b61..000000000
--- a/public/pages/Home/components/TagsFilter.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.l-tags-filter {
- vertical-align: middle;
-}
diff --git a/public/pages/Home/components/TagsFilter.tsx b/public/pages/Home/components/TagsFilter.tsx
index 84a88d3e6..4fd1e2761 100644
--- a/public/pages/Home/components/TagsFilter.tsx
+++ b/public/pages/Home/components/TagsFilter.tsx
@@ -1,78 +1,41 @@
-import "./TagsFilter.scss"
-
-import React from "react"
+import React, { useState } from "react"
import { Tag } from "@fider/models"
-import { ShowTag } from "@fider/components/ShowTag"
-import { DropDown, DropDownItem } from "@fider/components"
-import { FaCheck } from "react-icons/fa"
+import { Dropdown, Icon, ShowTag } from "@fider/components"
+import IconCheck from "@fider/assets/images/heroicons-check.svg"
+import { HStack } from "@fider/components/layout"
interface TagsFilterProps {
tags: Tag[]
- defaultSelection: string[]
- selectionChanged: (selected: string[]) => void
-}
-
-interface TagsFilterState {
selected: string[]
+ selectionChanged: (selected: string[]) => void
}
-export class TagsFilter extends React.Component<TagsFilterProps, TagsFilterState> {
- constructor(props: TagsFilterProps) {
- super(props)
- this.state = {
- selected: props.defaultSelection,
- }
- }
+export const TagsFilter = (props: TagsFilterProps) => {
+ const [selected, setSelected] = useState<string[]>(props.selected)
- private onChange = (item: DropDownItem) => {
- let selected = []
- const idx = this.state.selected.indexOf(item.value as string)
- if (idx >= 0) {
- selected = this.state.selected.splice(idx, 1) && this.state.selected
- } else {
- selected = this.state.selected.concat(item.value as string)
- }
- this.setState({ selected })
- this.props.selectionChanged(selected)
+ const toggle = (item: Tag) => () => {
+ const idx = selected.indexOf(item.slug)
+ const next = idx >= 0 ? selected.splice(idx, 1) && selected : selected.concat(item.slug)
+ setSelected(next)
+ props.selectionChanged(next)
}
- private renderText = () => {
- const text = this.state.selected.length === 0 ? "any tag" : this.state.selected.length === 1 ? "1 tag" : `${this.state.selected.length} tags`
- return <>{text}</>
- }
-
- public render() {
- if (this.props.tags.length === 0) {
- return null
- }
-
- const items = this.props.tags.map((t) => {
- return {
- value: t.slug,
- label: t.name,
- render: (
- <div className={this.state.selected.indexOf(t.slug) >= 0 ? "selected-tag" : ""}>
- <FaCheck />
- <ShowTag tag={t} circular={true} />
- {t.name}
- </div>
- ),
- }
- })
-
- return (
- <div>
- <span className="subtitle">with</span>
- <DropDown
- className="l-tags-filter"
- inline={true}
- style="simple"
- highlightSelected={false}
- items={items}
- onChange={this.onChange}
- renderText={this.renderText}
- />
- </div>
- )
- }
+ const label = selected.length === 1 ? "1 tag" : selected.length >= 2 ? `${selected.length} tags` : "Any Tag"
+
+ return (
+ <HStack>
+ <span className="text-category">with</span>
+ <Dropdown renderHandle={<div className="text-medium text-xs uppercase rounded-md uppercase bg-gray-100 px-2 py-1">{label}</div>}>
+ {props.tags.map((t) => (
+ <Dropdown.ListItem onClick={toggle(t)} key={t.id}>
+ <HStack spacing={2}>
+ <Icon sprite={IconCheck} className={`h-4 text-green-600 ${!selected.includes(t.slug) && "invisible"}`} />
+ <ShowTag tag={t} circular={true} />
+ <span>{t.name}</span>
+ </HStack>
+ </Dropdown.ListItem>
+ ))}
+ </Dropdown>
+ </HStack>
+ )
}
diff --git a/public/pages/Legal/Legal.page.scss b/public/pages/Legal/Legal.page.scss
new file mode 100644
index 000000000..b27e1fac8
--- /dev/null
+++ b/public/pages/Legal/Legal.page.scss
@@ -0,0 +1,48 @@
+@import "~@fider/assets/styles/variables.scss";
+/* purgecss start ignore */
+#p-legal {
+ padding: 50px 0;
+
+ h1 {
+ font-size: get("font.size.2xl");
+ font-weight: get("font.weight.bold");
+ letter-spacing: -1px;
+ margin-bottom: spacing(4);
+ }
+
+ h2 {
+ font-size: get("font.size.xl");
+ font-weight: get("font.weight.semibold");
+ margin-bottom: spacing(3);
+ }
+
+ h3 {
+ font-size: get("font.size.lg");
+ font-weight: get("font.weight.semibold");
+ margin-bottom: spacing(2);
+ }
+
+ a {
+ color: get("colors.blue.600");
+ }
+
+ a:hover {
+ color: get("colors.blue.800");
+ text-decoration: underline;
+ }
+
+ table {
+ margin-bottom: spacing(4);
+ tr {
+ th,
+ td {
+ padding: spacing(1);
+ border-bottom: 1px solid get("colors.gray.300");
+ }
+ th {
+ background-color: get("colors.gray.100");
+ }
+ }
+ }
+}
+/* purgecss end ignore */
diff --git a/public/pages/Legal/Legal.page.tsx b/public/pages/Legal/Legal.page.tsx
new file mode 100644
index 000000000..e2ef110f4
--- /dev/null
+++ b/public/pages/Legal/Legal.page.tsx
@@ -0,0 +1,17 @@
+import { Markdown } from "@fider/components"
+import React from "react"
+import "./Legal.page.scss"
+
+export interface LegalPageProps {
+ content: string
+}
+
+const LegalPage = (props: LegalPageProps) => {
+ return (
+ <div id="p-legal" className="page container w-max-10xl">
+ <Markdown text={props.content} style="full" />
+ </div>
+ )
+}
+
+export default LegalPage
diff --git a/public/pages/Legal/index.ts b/public/pages/Legal/index.ts
new file mode 100644
index 000000000..a0f088ed5
--- /dev/null
+++ b/public/pages/Legal/index.ts
@@ -0,0 +1 @@
+export * from "./Legal.page"
diff --git a/public/pages/MyNotifications/MyNotifications.page.scss b/public/pages/MyNotifications/MyNotifications.page.scss
deleted file mode 100644
index 6595354a8..000000000
--- a/public/pages/MyNotifications/MyNotifications.page.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-my-notifications {
- .mark-as-read {
- float: right;
- color: $link-color;
- font-size: 10px;
- cursor: pointer;
- font-weight: normal;
-
- &:hover {
- text-decoration: underline;
- }
- }
- .list {
- .item {
- a {
- padding: 5px;
- display: inline-block;
- }
- &:hover {
- background-color: #f1f8ff;
- }
- }
- }
-}
diff --git a/public/pages/MyNotifications/MyNotifications.page.tsx b/public/pages/MyNotifications/MyNotifications.page.tsx
index 47a5dc7b1..c17ce1cd5 100644
--- a/public/pages/MyNotifications/MyNotifications.page.tsx
+++ b/public/pages/MyNotifications/MyNotifications.page.tsx
@@ -1,11 +1,9 @@
-import "./MyNotifications.page.scss"
-
import React from "react"
import { Notification } from "@fider/models"
-import { MultiLineText, Moment, Heading, List, ListItem } from "@fider/components"
+import { Markdown, Moment, PageTitle } from "@fider/components"
import { actions } from "@fider/services"
-import { FaBell } from "react-icons/fa"
+import { HStack, VStack } from "@fider/components/layout"
interface MyNotificationsPageProps {
notifications: Notification[]
@@ -37,19 +35,21 @@ export default class MyNotificationsPage extends React.Component<MyNotifications
private items(notifications: Notification[]): JSX.Element[] {
return notifications.map((n) => {
return (
- <ListItem key={n.id}>
- <a href={`/notifications/${n.id}`}>
- <MultiLineText text={n.title} style="full" />
- <span className="info">
- <Moment date={n.createdAt} />
- </span>
+ <div key={n.id}>
+ <a className="text-link block" href={`/notifications/${n.id}`}>
+ <Markdown text={n.title} style="full" />
</a>
- </ListItem>
+ <span className="text-muted">
+ <Moment date={n.createdAt} />
+ </span>
+ </div>
)
})
}
- private markAllAsRead = async () => {
+ private markAllAsRead = async (e: React.MouseEvent) => {
+ e.preventDefault()
+
const response = await actions.markAllAsRead()
if (response.ok) {
location.reload()
@@ -59,26 +59,26 @@ export default class MyNotificationsPage extends React.Component<MyNotifications
public render() {
return (
<div id="p-my-notifications" className="page container">
- <Heading title="Notifications" subtitle="Stay up to date with what's happening" icon={FaBell} />
+ <PageTitle title="Notifications" subtitle="Stay up to date with what's happening" />
- <h4>
- Unread
+ <HStack spacing={4} className="mt-8 mb-2">
+ <h4 className="text-title">Unread</h4>
{this.state.unread.length > 0 && (
- <span className="mark-as-read" onClick={this.markAllAsRead}>
+ <a href="#" className="text-link text-xs" onClick={this.markAllAsRead}>
Mark All as Read
- </span>
+ </a>
)}
- </h4>
- <List>
+ </HStack>
+
+ <VStack spacing={4}>
{this.state.unread.length > 0 && this.items(this.state.unread)}
- {this.state.unread.length === 0 && <span className="info">No unread notifications.</span>}
- </List>
+ {this.state.unread.length === 0 && <span className="text-muted">No unread notifications.</span>}
+ </VStack>
+
{this.state.recent.length > 0 && (
<>
- <h4>Read on last 30 days</h4>
- <List>
- <ListItem>{this.items(this.state.recent)}</ListItem>
- </List>
+ <h4 className="text-title mt-8 mb-2">Read on last 30 days</h4>
+ <VStack spacing={4}>{this.items(this.state.recent)}</VStack>
</>
)}
</div>
diff --git a/public/pages/MySettings/MySettings.page.scss b/public/pages/MySettings/MySettings.page.scss
deleted file mode 100644
index af16c1ece..000000000
--- a/public/pages/MySettings/MySettings.page.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-my-settings {
- #confirmation-modal {
- text-align: center;
- }
-
- .notifications-settings {
- margin-bottom: 15px;
- .c-toggle {
- margin-right: 20px;
- }
- .event-title {
- display: block;
- margin-bottom: 5px;
- font-weight: 600;
- }
- }
-
- .l-danger-zone {
- h4 {
- margin-top: 50px;
- color: $red-400;
- }
- }
-
- .l-api-key {
- h4 {
- margin-top: 50px;
- }
- code {
- padding: 5px;
- background-color: $gray-200;
- }
- }
-}
diff --git a/public/pages/MySettings/MySettings.page.tsx b/public/pages/MySettings/MySettings.page.tsx
index 8ca52c7b0..6725896a0 100644
--- a/public/pages/MySettings/MySettings.page.tsx
+++ b/public/pages/MySettings/MySettings.page.tsx
@@ -1,12 +1,9 @@
-import "./MySettings.page.scss"
-
import React from "react"
-import { Modal, Form, Button, Heading, Input, Select, SelectOption, ImageUploader } from "@fider/components"
+import { Modal, Form, Button, PageTitle, Input, Select, SelectOption, ImageUploader } from "@fider/components"
import { UserSettings, UserAvatarType, ImageUpload } from "@fider/models"
import { Failure, actions, Fider } from "@fider/services"
-import { FaRegAddressCard } from "react-icons/fa"
import { NotificationSettings } from "./components/NotificationSettings"
import { APIKeyForm } from "./components/APIKeyForm"
import { DangerZone } from "./components/DangerZone"
@@ -106,9 +103,9 @@ export default class MySettingsPage extends React.Component<MySettingsPageProps,
public render() {
const changeEmail = (
- <span className="info clickable" onClick={this.startChangeEmail}>
+ <Button variant="tertiary" size="small" onClick={this.startChangeEmail}>
change
- </span>
+ </Button>
)
return (
@@ -129,88 +126,77 @@ export default class MySettingsPage extends React.Component<MySettingsPageProps,
</Modal.Content>
</Modal.Window>
- <Heading title="Settings" subtitle="Manage your profile settings" icon={FaRegAddressCard} />
-
- <div className="row">
- <div className="col-lg-7">
- <Form error={this.state.error}>
- <Input
- label="Email"
- field="email"
- value={this.state.changingEmail ? this.state.newEmail : Fider.session.user.email}
- maxLength={200}
- disabled={!this.state.changingEmail}
- afterLabel={this.state.changingEmail ? undefined : changeEmail}
- onChange={this.setNewEmail}
- >
- <p className="info">
- {Fider.session.user.email || this.state.changingEmail
- ? "Your email is private and will never be publicly displayed."
- : "Your account doesn't have an email."}
+ <PageTitle title="Settings" subtitle="Manage your profile settings" />
+
+ <div className="w-max-7xl">
+ <Form error={this.state.error}>
+ <Input
+ label="Email"
+ field="email"
+ value={this.state.changingEmail ? this.state.newEmail : Fider.session.user.email}
+ maxLength={200}
+ disabled={!this.state.changingEmail}
+ afterLabel={this.state.changingEmail ? undefined : changeEmail}
+ onChange={this.setNewEmail}
+ >
+ <p className="text-muted">
+ {Fider.session.user.email || this.state.changingEmail
+ ? "Your email is private and will never be publicly displayed."
+ : "Your account doesn't have an email."}
+ </p>
+ {this.state.changingEmail && (
+ <>
+ <Button variant="primary" size="small" onClick={this.submitNewEmail}>
+ Confirm
+ </Button>
+ <Button variant="tertiary" size="small" onClick={this.cancelChangeEmail}>
+ Cancel
+ </Button>
+ </>
+ )}
+ </Input>
+
+ <Input label="Name" field="name" value={this.state.name} maxLength={100} onChange={this.setName} />
+
+ <Select
+ label="Avatar"
+ field="avatarType"
+ defaultValue={this.state.avatarType}
+ options={[
+ { label: "Letter", value: UserAvatarType.Letter },
+ { label: "Gravatar", value: UserAvatarType.Gravatar },
+ { label: "Custom", value: UserAvatarType.Custom },
+ ]}
+ onChange={this.avatarTypeChanged}
+ >
+ {this.state.avatarType === UserAvatarType.Gravatar && (
+ <p className="text-muted mt-1">
+ A{" "}
+ <a className="text-link" rel="noopener" href="https://en.gravatar.com" target="_blank">
+ Gravatar
+ </a>{" "}
+ will be used based on your email. If you don&apos;t have a Gravatar, a letter avatar based on your initials is generated for you.
</p>
- {this.state.changingEmail && (
- <>
- <Button color="positive" size="mini" onClick={this.submitNewEmail}>
- Confirm
- </Button>
- <Button color="cancel" size="mini" onClick={this.cancelChangeEmail}>
- Cancel
- </Button>
- </>
- )}
- </Input>
-
- <Input label="Name" field="name" value={this.state.name} maxLength={100} onChange={this.setName} />
-
- <Select
- label="Avatar"
- field="avatarType"
- defaultValue={this.state.avatarType}
- options={[
- { label: "Letter", value: UserAvatarType.Letter },
- { label: "Gravatar", value: UserAvatarType.Gravatar },
- { label: "Custom", value: UserAvatarType.Custom },
- ]}
- onChange={this.avatarTypeChanged}
- >
- {this.state.avatarType === UserAvatarType.Gravatar && (
- <p className="info">
- A{" "}
- <a rel="noopener" href="https://en.gravatar.com" target="_blank">
- Gravatar
- </a>{" "}
- will be used based on your email. If you don&apos;t have a Gravatar, a letter avatar based on your initials is generated for you.
+ )}
+ {this.state.avatarType === UserAvatarType.Letter && <p className="text-muted">A letter avatar based on your initials is generated for you.</p>}
+ {this.state.avatarType === UserAvatarType.Custom && (
+ <ImageUploader field="avatar" onChange={this.setAvatar} bkey={Fider.session.user.avatarBlobKey}>
+ <p className="text-muted">
+ We accept JPG, GIF and PNG images, smaller than 100KB and with an aspect ratio of 1:1 with minimum dimensions of 50x50 pixels.
</p>
- )}
- {this.state.avatarType === UserAvatarType.Letter && <p className="info">A letter avatar based on your initials is generated for you.</p>}
- {this.state.avatarType === UserAvatarType.Custom && (
- <ImageUploader field="avatar" previewMaxWidth={80} onChange={this.setAvatar} bkey={Fider.session.user.avatarBlobKey}>
- <p className="info">
- We accept JPG, GIF and PNG images, smaller than 100KB and with an aspect ratio of 1:1 with minimum dimensions of 50x50 pixels.
- </p>
- </ImageUploader>
- )}
- </Select>
-
- <NotificationSettings userSettings={this.props.userSettings} settingsChanged={this.setNotificationSettings} />
-
- <Button color="positive" onClick={this.confirm}>
- Save
- </Button>
- </Form>
- </div>
- </div>
+ </ImageUploader>
+ )}
+ </Select>
- {Fider.session.user.isCollaborator && (
- <div className="row">
- <div className="col-lg-7">
- <APIKeyForm />
- </div>
- </div>
- )}
+ <NotificationSettings userSettings={this.props.userSettings} settingsChanged={this.setNotificationSettings} />
+
+ <Button variant="primary" onClick={this.confirm}>
+ Save
+ </Button>
+ </Form>
- <div className="row">
- <div className="col-lg-7">
+ <div className="mt-8">{Fider.session.user.isCollaborator && <APIKeyForm />}</div>
+ <div className="mt-8">
<DangerZone />
</div>
</div>
diff --git a/public/pages/MySettings/components/APIKeyForm.tsx b/public/pages/MySettings/components/APIKeyForm.tsx
index e05eed94c..9b57133e5 100644
--- a/public/pages/MySettings/components/APIKeyForm.tsx
+++ b/public/pages/MySettings/components/APIKeyForm.tsx
@@ -22,30 +22,30 @@ export class APIKeyForm extends React.Component<any, APIKeyFormState> {
private showAPIKey() {
return (
<>
- <p className="info">
+ <p className="text-muted">
Your new API Key is: <code>{this.state.apiKey}</code>
</p>
- <p className="info">Stored it securely on your servers and never store it in the client side of your app.</p>
+ <p className="text-muted">Stored it securely on your servers and never store it in the client side of your app.</p>
</>
)
}
public render() {
return (
- <div className="l-api-key">
- <h4>API Key</h4>
- <p className="info">
+ <div>
+ <h4 className="text-title mb-1">API Key</h4>
+ <p className="text-muted">
The API Key is only shown whenever generated. If your Key is lost or has been compromised, generated a new one and take note of it.
</p>
- <p className="info">
+ <p className="text-muted">
To learn how to use the API, read the{" "}
- <a rel="noopener" href="https://getfider.com/docs/api" target="_blank">
+ <a className="text-link" rel="noopener" href="https://getfider.com/docs/api" target="_blank">
official documentation
</a>
.
</p>
<p>
- <Button size="tiny" onClick={this.regenerate}>
+ <Button size="small" onClick={this.regenerate}>
Regenerate API Key
</Button>
</p>
diff --git a/public/pages/MySettings/components/DangerZone.tsx b/public/pages/MySettings/components/DangerZone.tsx
index e4026308d..de326368a 100644
--- a/public/pages/MySettings/components/DangerZone.tsx
+++ b/public/pages/MySettings/components/DangerZone.tsx
@@ -35,7 +35,7 @@ export class DangerZone extends React.Component<any, DangerZoneState> {
public render() {
return (
- <div className="l-danger-zone">
+ <div>
<Modal.Window isOpen={this.state.clicked} center={false} onClose={this.onCancel}>
<Modal.Header>Delete account</Modal.Header>
<Modal.Content>
@@ -48,22 +48,22 @@ export class DangerZone extends React.Component<any, DangerZoneState> {
</p>
</Modal.Content>
<Modal.Footer>
- <Button color="danger" size="tiny" onClick={this.onConfirm}>
+ <Button variant="danger" size="small" onClick={this.onConfirm}>
Confirm
</Button>
- <Button color="cancel" size="tiny" onClick={this.onCancel}>
+ <Button variant="tertiary" size="small" onClick={this.onCancel}>
Cancel
</Button>
</Modal.Footer>
</Modal.Window>
- <h4>Delete account</h4>
- <p className="info">
+ <h4 className="text-title mb-1">Delete account</h4>
+ <p className="text-muted">
When you choose to delete your account, we will erase all your personal information forever. The content you have published will remain, but it will
be anonymised.
</p>
- <p className="info">This process is irreversible. Please be certain.</p>
- <Button color="danger" size="tiny" onClick={this.onClickDelete}>
+ <p className="text-muted">This process is irreversible. Please be certain.</p>
+ <Button variant="danger" size="small" onClick={this.onClickDelete}>
Delete My Account
</Button>
</div>
diff --git a/public/pages/MySettings/components/NotificationSettings.tsx b/public/pages/MySettings/components/NotificationSettings.tsx
index 988d4b67a..b29ac35c0 100644
--- a/public/pages/MySettings/components/NotificationSettings.tsx
+++ b/public/pages/MySettings/components/NotificationSettings.tsx
@@ -1,8 +1,9 @@
import React, { useState } from "react"
import { UserSettings } from "@fider/models"
-import { Toggle, Segment, Segments, Field } from "@fider/components"
+import { Toggle, Field } from "@fider/components"
import { useFider } from "@fider/hooks"
+import { HStack, VStack } from "@fider/components/layout"
interface NotificationSettingsProps {
userSettings: UserSettings
@@ -47,25 +48,25 @@ export const NotificationSettings = (props: NotificationSettingsProps) => {
if (!webEnabled && !emailEnabled) {
return (
- <p className="info">
+ <p className="text-muted">
You&apos;ll <strong>NOT</strong> receive any notification about this event.
</p>
)
} else if (webEnabled && !emailEnabled) {
return (
- <p className="info">
+ <p className="text-muted">
You&apos;ll receive <strong>web</strong> notifications about {about}.
</p>
)
} else if (!webEnabled && emailEnabled) {
return (
- <p className="info">
+ <p className="text-muted">
You&apos;ll receive <strong>email</strong> notifications about {about}.
</p>
)
} else if (webEnabled && emailEnabled) {
return (
- <p className="info">
+ <p className="text-muted">
You&apos;ll receive <strong>web</strong> and <strong>email</strong> notifications about {about}.
</p>
)
@@ -76,41 +77,41 @@ export const NotificationSettings = (props: NotificationSettingsProps) => {
return (
<>
<Field label="Notifications">
- <p className="info">Use following panel to choose which events you&apos;d like to receive notification</p>
- </Field>
+ <p className="text-muted">Use following panel to choose which events you&apos;d like to receive notification</p>
- <div className="notifications-settings">
- <Segments>
- <Segment>
- <span className="event-title">New Post</span>
- {info("event_notification_new_post", "new posts on this site", "new posts on this site")}
- <p>
- {icon("event_notification_new_post", WebChannel)}
- {icon("event_notification_new_post", EmailChannel)}
- </p>
- </Segment>
- <Segment>
- <span className="event-title">Discussion</span>
- {info("event_notification_new_comment", "comments on posts you've subscribed to", "comments on all posts unless individually unsubscribed")}
- <p>
- {icon("event_notification_new_comment", WebChannel)}
- {icon("event_notification_new_comment", EmailChannel)}
- </p>
- </Segment>
- <Segment>
- <span className="event-title">Status Changed</span>
- {info(
- "event_notification_change_status",
- "status change on posts you've subscribed to",
- "status change on all posts unless individually unsubscribed"
- )}
- <p>
- {icon("event_notification_change_status", WebChannel)}
- {icon("event_notification_change_status", EmailChannel)}
- </p>
- </Segment>
- </Segments>
- </div>
+ <div className="notifications-settings">
+ <VStack spacing={4} divide={true} className="p-2 bg-gray-50 rounded">
+ <div>
+ <div className="mb-1">New Post</div>
+ {info("event_notification_new_post", "new posts on this site", "new posts on this site")}
+ <HStack spacing={6}>
+ {icon("event_notification_new_post", WebChannel)}
+ {icon("event_notification_new_post", EmailChannel)}
+ </HStack>
+ </div>
+ <div>
+ <div className="mb-1">Discussion</div>
+ {info("event_notification_new_comment", "comments on posts you've subscribed to", "comments on all posts unless individually unsubscribed")}
+ <HStack spacing={6}>
+ {icon("event_notification_new_comment", WebChannel)}
+ {icon("event_notification_new_comment", EmailChannel)}
+ </HStack>
+ </div>
+ <div>
+ <div className="mb-1">Status Changed</div>
+ {info(
+ "event_notification_change_status",
+ "status change on posts you've subscribed to",
+ "status change on all posts unless individually unsubscribed"
+ )}
+ <HStack spacing={6}>
+ {icon("event_notification_change_status", WebChannel)}
+ {icon("event_notification_change_status", EmailChannel)}
+ </HStack>
+ </div>
+ </VStack>
+ </div>
+ </Field>
</>
)
}
diff --git a/public/pages/OAuthEcho/OAuthEcho.page.scss b/public/pages/OAuthEcho/OAuthEcho.page.scss
deleted file mode 100644
index 006d0d4a6..000000000
--- a/public/pages/OAuthEcho/OAuthEcho.page.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-oauth-echo {
- .icon {
- margin-right: 5px;
- margin-bottom: 5px;
- }
- .icon.error {
- color: $red-400;
- }
- .icon.check {
- color: $green-400;
- }
- .icon.warn {
- color: $orange;
- }
-}
diff --git a/public/pages/OAuthEcho/OAuthEcho.page.tsx b/public/pages/OAuthEcho/OAuthEcho.page.tsx
index b8fef6a50..8ada76f11 100644
--- a/public/pages/OAuthEcho/OAuthEcho.page.tsx
+++ b/public/pages/OAuthEcho/OAuthEcho.page.tsx
@@ -1,9 +1,11 @@
-import "./OAuthEcho.page.scss"
-
import React from "react"
import { navigator } from "@fider/services"
-import { Segments, Segment } from "@fider/components"
-import { FaCheckCircle, FaTimesCircle, FaExclamationTriangle } from "react-icons/fa"
+import { Icon } from "@fider/components"
+
+import IconXCircle from "@fider/assets/images/heroicons-x-circle.svg"
+import IconCheckCircle from "@fider/assets/images/heroicons-check-circle.svg"
+import IconExclamation from "@fider/assets/images/heroicons-exclamation.svg"
+import { HStack, VStack } from "@fider/components/layout"
interface OAuthEchoPageProps {
err: string | undefined
@@ -15,9 +17,9 @@ interface OAuthEchoPageProps {
}
}
-const ok = <FaCheckCircle className="check" />
-const error = <FaTimesCircle className="error" />
-const warn = <FaExclamationTriangle className="warn" />
+const ok = <Icon sprite={IconCheckCircle} className="h-4 text-green-500" />
+const error = <Icon sprite={IconXCircle} className="h-4 text-red-500" />
+const warn = <Icon sprite={IconExclamation} className="h-4 text-yellow-500" />
export default class OAuthEchoPage extends React.Component<OAuthEchoPageProps, any> {
public componentDidMount() {
@@ -27,7 +29,7 @@ export default class OAuthEchoPage extends React.Component<OAuthEchoPageProps, a
private renderError() {
return (
<>
- <h5>Error</h5>
+ <h5 className="text-display">Error</h5>
<pre>{this.props.err}</pre>
</>
)
@@ -47,40 +49,40 @@ export default class OAuthEchoPage extends React.Component<OAuthEchoPageProps, a
return (
<>
- <h5>Raw Body</h5>
+ <h5 className="text-display mb-2">Raw Body</h5>
<pre>{responseBody}</pre>
- <h5>Parsed Profile</h5>
- <Segments>
- <Segment>
- <p>
+ <h5 className="text-display mb-2 mt-8">Parsed Profile</h5>
+ <VStack divide={true} spacing={2}>
+ <VStack>
+ <HStack>
{idOk ? ok : error}
- <strong>ID:</strong> {this.props.profile && this.props.profile.id}
- {!idOk && <p className="info">ID is required. If not found, users will see an error during sign in process.</p>}
- </p>
- </Segment>
- <Segment>
- <p>
+ <strong>ID:</strong> <span>{this.props.profile && this.props.profile.id}</span>
+ </HStack>
+ {!idOk && <span className="text-muted">ID is required. If not found, users will see an error during sign in process.</span>}
+ </VStack>
+ <VStack>
+ <HStack>
{nameOk ? ok : warn}
- <strong>Name:</strong> {this.props.profile && this.props.profile.name}
- {!nameOk && (
- <p className="info">
- Name is required, if not found we&apos;ll use <strong>Anonymous</strong> as the name of every new user.
- </p>
- )}
- </p>
- </Segment>
- <Segment>
- <p>
+ <strong>Name:</strong> <span>{this.props.profile && this.props.profile.name}</span>
+ </HStack>
+ {!nameOk && (
+ <span className="text-muted">
+ Name is required, if not found we&apos;ll use <strong>Anonymous</strong> as the name of every new user.
+ </span>
+ )}
+ </VStack>
+ <VStack>
+ <HStack>
{emailOk ? ok : warn}
<strong>Email:</strong> {this.props.profile && this.props.profile.email}
- {!emailOk && (
- <p className="info">
- Email is not required, but highly recommended. If invalid or not found, new users won&apos;t be able to receive notifications.
- </p>
- )}
- </p>
- </Segment>
- </Segments>
+ </HStack>
+ {!emailOk && (
+ <span className="text-muted">
+ Email is not required, but highly recommended. If invalid or not found, new users won&apos;t receive notifications.
+ </span>
+ )}
+ </VStack>
+ </VStack>
</>
)
}
diff --git a/public/pages/ShowPost/ShowPost.page.scss b/public/pages/ShowPost/ShowPost.page.scss
index f3236f74a..c2efacbf9 100644
--- a/public/pages/ShowPost/ShowPost.page.scss
+++ b/public/pages/ShowPost/ShowPost.page.scss
@@ -2,79 +2,30 @@
#p-show-post {
.post-header {
- width: 100%;
- h1 {
- font-weight: 400;
- margin: 0px;
- font-size: $font-size-xlarge;
- margin-bottom: 2px;
- @include media("sm") {
- font-size: $font-size-big;
- }
- }
- .c-avatar {
- width: 24px;
- height: 24px;
- }
- }
-
- @include media(">=md") {
- .header-col,
- .comments-col {
- float: left;
- width: calc(100% - 300px);
- }
- .action-col {
- float: right;
- }
+ flex-grow: 1;
}
- .header-col {
- margin-bottom: 20px;
- .c-list-item {
- display: flex;
- }
- }
+ @include media("lg") {
+ .p-show-post {
+ display: grid;
+ gap: spacing(4);
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ grid-template-rows: auto;
+ grid-template-areas:
+ "Header Header Header Action"
+ "Discussion Discussion Discussion Action";
- .action-col {
- margin-bottom: 20px;
- @include media(">=md") {
- width: 240px;
- }
-
- .subtitle + .c-list {
- margin-bottom: 10px;
- }
- }
+ &__header-col {
+ grid-area: Header;
+ }
- .c-tag-list {
- .m-selectable {
- .icon {
- height: 12px;
- margin-right: 2px;
- color: $green-400;
+ &__action-col {
+ grid-area: Action;
}
- }
- span {
- margin-left: 5px;
- }
- }
-}
-.c-response-form {
- .c-post-search {
- .votes {
- text-align: center;
- width: 50px;
- display: inline-block;
- .icon {
- margin: 0;
+ &__discussion_col {
+ grid-area: Discussion;
}
}
- .status-label {
- width: 65px;
- margin-right: 5px;
- text-align: center;
- }
}
}
diff --git a/public/pages/ShowPost/ShowPost.page.tsx b/public/pages/ShowPost/ShowPost.page.tsx
index 7e7a3fa80..abcb83210 100644
--- a/public/pages/ShowPost/ShowPost.page.tsx
+++ b/public/pages/ShowPost/ShowPost.page.tsx
@@ -11,16 +11,14 @@ import {
Button,
UserName,
Moment,
- MultiLineText,
- List,
- ListItem,
+ Markdown,
Input,
Form,
TextArea,
MultiImageUploader,
ImageViewer,
+ Icon,
} from "@fider/components"
-import { FaSave, FaTimes, FaEdit } from "react-icons/fa"
import { ResponseForm } from "./components/ResponseForm"
import { TagsPanel } from "./components/TagsPanel"
import { NotificationsPanel } from "./components/NotificationsPanel"
@@ -28,6 +26,11 @@ import { ModerationPanel } from "./components/ModerationPanel"
import { DiscussionPanel } from "./components/DiscussionPanel"
import { VotesPanel } from "./components/VotesPanel"
+import IconX from "@fider/assets/images/heroicons-x.svg"
+import IconPencilAlt from "@fider/assets/images/heroicons-pencil-alt.svg"
+import IconCheck from "@fider/assets/images/heroicons-check.svg"
+import { HStack, VStack } from "@fider/components/layout"
+
interface ShowPostPageProps {
post: Post
subscribed: boolean
@@ -91,86 +94,84 @@ export default class ShowPostPage extends React.Component<ShowPostPageProps, Sho
public render() {
return (
<div id="p-show-post" className="page container">
- <div className="header-col">
- <List>
- <ListItem>
- <VoteCounter post={this.props.post} />
-
- <div className="post-header">
+ <VStack className="p-show-post" spacing={4}>
+ <div className="p-show-post__header-col">
+ <VStack spacing={4}>
+ <HStack>
+ <VoteCounter post={this.props.post} />
+
+ <div className="flex-grow">
+ {this.state.editMode ? (
+ <Form error={this.state.error}>
+ <Input field="title" maxLength={100} value={this.state.newTitle} onChange={this.setNewTitle} />
+ </Form>
+ ) : (
+ <h1 className="text-display2">{this.props.post.title}</h1>
+ )}
+
+ <span className="text-muted">
+ Posted by <UserName user={this.props.post.user} /> &middot; <Moment date={this.props.post.createdAt} />
+ </span>
+ </div>
+ </HStack>
+ <VStack>
+ <span className="text-category">Description</span>
{this.state.editMode ? (
<Form error={this.state.error}>
- <Input field="title" maxLength={100} value={this.state.newTitle} onChange={this.setNewTitle} />
+ <TextArea field="description" value={this.state.newDescription} onChange={this.setNewDescription} />
+ <MultiImageUploader field="attachments" bkeys={this.props.attachments} maxUploads={3} onChange={this.setAttachments} />
</Form>
) : (
- <h1>{this.props.post.title}</h1>
+ <>
+ {this.props.post.description && <Markdown className="description" text={this.props.post.description} style="full" />}
+ {!this.props.post.description && <em className="text-muted">No description provided.</em>}
+ {this.props.attachments.map((x) => (
+ <ImageViewer key={x} bkey={x} />
+ ))}
+ </>
)}
-
- <span className="info">
- Posted by <UserName user={this.props.post.user} /> &middot; <Moment date={this.props.post.createdAt} />
+ </VStack>
+ <ShowPostResponse status={this.props.post.status} response={this.props.post.response} />
+ </VStack>
+ </div>
+
+ <VStack spacing={4} className="p-show-post__action-col">
+ <VotesPanel post={this.props.post} votes={this.props.votes} />
+
+ {Fider.session.isAuthenticated && Fider.session.user.isCollaborator && (
+ <VStack>
+ <span key={0} className="text-category">
+ Actions
</span>
- </div>
- </ListItem>
- </List>
-
- <span className="subtitle">Description</span>
- {this.state.editMode ? (
- <Form error={this.state.error}>
- <TextArea field="description" value={this.state.newDescription} onChange={this.setNewDescription} />
- <MultiImageUploader field="attachments" bkeys={this.props.attachments} maxUploads={3} previewMaxWidth={100} onChange={this.setAttachments} />
- </Form>
- ) : (
- <>
- {this.props.post.description && <MultiLineText className="description" text={this.props.post.description} style="full" />}
- {!this.props.post.description && <em className="info">No description provided.</em>}
- {this.props.attachments.map((x) => (
- <ImageViewer key={x} bkey={x} />
- ))}
- </>
- )}
- <ShowPostResponse showUser={true} status={this.props.post.status} response={this.props.post.response} />
- </div>
-
- <div className="action-col">
- <VotesPanel post={this.props.post} votes={this.props.votes} />
-
- {Fider.session.isAuthenticated &&
- Fider.session.user.isCollaborator && [
- <span key={0} className="subtitle">
- Actions
- </span>,
- this.state.editMode ? (
- <List key={1}>
- <ListItem>
- <Button className="save" color="positive" fluid={true} onClick={this.saveChanges}>
- <FaSave /> Save
+ {this.state.editMode ? (
+ <VStack>
+ <Button variant="primary" onClick={this.saveChanges}>
+ <Icon sprite={IconCheck} /> <span>Save</span>
</Button>
- </ListItem>
- <ListItem>
- <Button className="cancel" fluid={true} onClick={this.cancelEdit}>
- <FaTimes /> Cancel
+ <Button onClick={this.cancelEdit}>
+ <Icon sprite={IconX} /> <span>Cancel</span>
</Button>
- </ListItem>
- </List>
- ) : (
- <List key={1}>
- <ListItem>
- <Button className="edit" fluid={true} onClick={this.startEdit}>
- <FaEdit /> Edit
+ </VStack>
+ ) : (
+ <VStack>
+ <Button onClick={this.startEdit}>
+ <Icon sprite={IconPencilAlt} /> <span>Edit</span>
</Button>
- </ListItem>
- <ListItem>
<ResponseForm post={this.props.post} />
- </ListItem>
- </List>
- ),
- ]}
-
- <TagsPanel post={this.props.post} tags={this.props.tags} />
- <NotificationsPanel post={this.props.post} subscribed={this.props.subscribed} />
- <ModerationPanel post={this.props.post} />
- </div>
-
- <DiscussionPanel post={this.props.post} comments={this.props.comments} />
+ </VStack>
+ )}
+ </VStack>
+ )}
+
+ <TagsPanel post={this.props.post} tags={this.props.tags} />
+ <NotificationsPanel post={this.props.post} subscribed={this.props.subscribed} />
+ <ModerationPanel post={this.props.post} />
+ </VStack>
+
+ <div className="p-show-post__discussion_col">
+ <DiscussionPanel post={this.props.post} comments={this.props.comments} />
+ </div>
+ </VStack>
</div>
)
}
diff --git a/public/pages/ShowPost/components/CommentInput.tsx b/public/pages/ShowPost/components/CommentInput.tsx
index 6d33c5aa3..8de4ff712 100644
--- a/public/pages/ShowPost/components/CommentInput.tsx
+++ b/public/pages/ShowPost/components/CommentInput.tsx
@@ -1,11 +1,12 @@
import React, { useState, useRef } from "react"
import { Post, ImageUpload } from "@fider/models"
-import { Avatar, UserName, Button, TextArea, Form, MultiImageUploader } from "@fider/components/common"
+import { Avatar, UserName, Button, TextArea, Form, MultiImageUploader } from "@fider/components"
import { SignInModal } from "@fider/components"
import { cache, actions, Failure, Fider } from "@fider/services"
import { useFider } from "@fider/hooks"
+import { HStack } from "@fider/components/layout"
interface CommentInputProps {
post: Post
@@ -53,29 +54,35 @@ export const CommentInput = (props: CommentInputProps) => {
return (
<>
<SignInModal isOpen={isSignInModalOpen} onClose={hideModal} />
- <div className={`c-comment-input ${Fider.session.isAuthenticated && "m-authenticated"}`}>
- {Fider.session.isAuthenticated && <Avatar size="large" user={Fider.session.user} />}
- <Form error={error}>
- {Fider.session.isAuthenticated && <UserName user={Fider.session.user} />}
- <TextArea
- placeholder="Leave a comment"
- field="content"
- value={content}
- minRows={1}
- onChange={commentChanged}
- onFocus={handleOnFocus}
- inputRef={inputRef}
- />
- {content && (
- <>
- <MultiImageUploader field="attachments" maxUploads={2} previewMaxWidth={100} onChange={setAttachments} />
- <Button color="positive" onClick={submit}>
- Submit
- </Button>
- </>
- )}
- </Form>
- </div>
+ <HStack spacing={2} center={false} className="c-comment-input">
+ {Fider.session.isAuthenticated && <Avatar user={Fider.session.user} />}
+ <div className="flex-grow bg-gray-50 rounded-md p-2">
+ <Form error={error}>
+ {Fider.session.isAuthenticated && (
+ <div className="mb-1">
+ <UserName user={Fider.session.user} />
+ </div>
+ )}
+ <TextArea
+ placeholder="Leave a comment"
+ field="content"
+ value={content}
+ minRows={1}
+ onChange={commentChanged}
+ onFocus={handleOnFocus}
+ inputRef={inputRef}
+ />
+ {content && (
+ <>
+ <MultiImageUploader field="attachments" maxUploads={2} onChange={setAttachments} />
+ <Button variant="primary" onClick={submit}>
+ Submit
+ </Button>
+ </>
+ )}
+ </Form>
+ </div>
+ </HStack>
</>
)
}
diff --git a/public/pages/ShowPost/components/Comments.scss b/public/pages/ShowPost/components/Comments.scss
deleted file mode 100644
index 92d8fdc46..000000000
--- a/public/pages/ShowPost/components/Comments.scss
+++ /dev/null
@@ -1,87 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-comment-list {
-
- .c-comment {
- margin: 20px 0 0 0;
- display: flex;
- .c-avatar {
- margin: 8px 8px 0 0;
- }
-
- .c-comment-content {
- flex-grow: 1;
- background-color: $gray-50;
- border-radius: 4px;
- padding: 8px;
-
- .c-comment-header {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
-
- .c-comment-author {
- .c-comment-metadata {
- display: inline-block;
- font-size: $font-size-tiny;
- color: $gray-700;
- }
- }
-
- .c-comment-menu {
- align-self: center;
- }
- }
-
- .c-comment-body {
- margin-top: 5px;
- }
-
- .l-more-actions {
- .c-dropdown-control {
- padding: 0px 0px 0px 5px;
- }
-
- .c-dropdown-menu {
- border-radius: 5px;
- width: 100px;
- }
-
- .icon {
- color: $gray-500;
- font-size: 12px;
- }
-
- &:hover {
- .icon {
- color: $gray-900;
- }
- }
-
- &.is-open {
- display: inline-block !important;
- .icon {
- color: $gray-900;
- }
- }
- }
- }
- }
-}
-
-.c-comment-input {
- display: flex;
- margin-top: 10px;
- .c-avatar {
- margin-top: 8px;
- margin-right: 8px;
- }
-
- .c-form {
- padding: 8px;
- flex-grow: 1;
- textarea {
- margin-top: 5px;
- }
- }
-}
diff --git a/public/pages/ShowPost/components/DiscussionPanel.tsx b/public/pages/ShowPost/components/DiscussionPanel.tsx
index 51ac5eac6..a0bc68dc4 100644
--- a/public/pages/ShowPost/components/DiscussionPanel.tsx
+++ b/public/pages/ShowPost/components/DiscussionPanel.tsx
@@ -1,10 +1,10 @@
-import "./Comments.scss"
-
import React from "react"
import { CurrentUser, Comment, Post } from "@fider/models"
import { ShowComment } from "./ShowComment"
import { CommentInput } from "./CommentInput"
import PostIllustration from "@fider/assets/images/undraw-post.svg"
+import { Icon } from "@fider/components"
+import { VStack } from "@fider/components/layout"
interface DiscussionPanelProps {
user?: CurrentUser
@@ -14,22 +14,22 @@ interface DiscussionPanelProps {
export const DiscussionPanel = (props: DiscussionPanelProps) => {
return (
- <div className="comments-col">
- <div className="c-comment-list">
- <span className="subtitle">Discussion</span>
- <CommentInput post={props.post} />
- {props.comments.map((c) => (
- <ShowComment key={c.id} post={props.post} comment={c} />
- ))}
+ <>
+ <VStack spacing={2} className="c-comment-list">
+ <span className="text-category">Discussion</span>
+ <VStack spacing={4} className="c-comment-list">
+ {props.comments.map((c) => (
+ <ShowComment key={c.id} post={props.post} comment={c} />
+ ))}
+ <CommentInput post={props.post} />
+ </VStack>
{props.comments.length === 0 && (
- <div className="center">
- <p>
- <img alt="No Posts" height="100" src={PostIllustration} />
- </p>
- <p>No one has commented yet.</p>
+ <div className="text-center mt-4">
+ <Icon sprite={PostIllustration} height="120" />
+ <p className="text-xs">No one has commented yet.</p>
</div>
)}
- </div>
- </div>
+ </VStack>
+ </>
)
}
diff --git a/public/pages/ShowPost/components/ModerationPanel.tsx b/public/pages/ShowPost/components/ModerationPanel.tsx
index 15def63b0..d94f03a04 100644
--- a/public/pages/ShowPost/components/ModerationPanel.tsx
+++ b/public/pages/ShowPost/components/ModerationPanel.tsx
@@ -1,8 +1,9 @@
import React, { useState } from "react"
import { PostStatus, Post } from "@fider/models"
import { actions, navigator, Failure } from "@fider/services"
-import { Form, Modal, Button, List, ListItem, TextArea } from "@fider/components"
+import { Form, Modal, Button, TextArea } from "@fider/components"
import { useFider } from "@fider/hooks"
+import { VStack } from "@fider/components/layout"
interface ModerationPanelProps {
post: Post
@@ -37,7 +38,7 @@ export const ModerationPanel = (props: ModerationPanelProps) => {
<Modal.Content>
<Form error={error}>
<TextArea field="text" onChange={setText} value={text} placeholder="Why are you deleting this post? (optional)">
- <span className="info">
+ <span className="text-muted">
This operation <strong>cannot</strong> be undone.
</span>
</TextArea>
@@ -45,10 +46,10 @@ export const ModerationPanel = (props: ModerationPanelProps) => {
</Modal.Content>
<Modal.Footer>
- <Button color="danger" onClick={handleDelete}>
+ <Button variant="danger" onClick={handleDelete}>
Delete
</Button>
- <Button color="cancel" onClick={hideModal}>
+ <Button variant="tertiary" onClick={hideModal}>
Cancel
</Button>
</Modal.Footer>
@@ -56,16 +57,12 @@ export const ModerationPanel = (props: ModerationPanelProps) => {
)
return (
- <>
+ <VStack>
{modal}
- <span className="subtitle">Moderation</span>
- <List>
- <ListItem>
- <Button color="danger" size="tiny" fluid={true} onClick={showModal}>
- Delete
- </Button>
- </ListItem>
- </List>
- </>
+ <span className="text-category">Moderation</span>
+ <Button variant="danger" size="small" className="w-full" onClick={showModal}>
+ Delete
+ </Button>
+ </VStack>
)
}
diff --git a/public/pages/ShowPost/components/NotificationsPanel.tsx b/public/pages/ShowPost/components/NotificationsPanel.tsx
index ba8203ddb..a9511f204 100644
--- a/public/pages/ShowPost/components/NotificationsPanel.tsx
+++ b/public/pages/ShowPost/components/NotificationsPanel.tsx
@@ -1,9 +1,11 @@
import React, { useState } from "react"
import { Post } from "@fider/models"
-import { Button, List, ListItem } from "@fider/components"
+import { Button, Icon } from "@fider/components"
import { actions } from "@fider/services"
-import { FaVolumeUp, FaVolumeMute } from "react-icons/fa"
import { useFider } from "@fider/hooks"
+import IconVolumeOn from "@fider/assets/images/heroicons-volume-on.svg"
+import IconVolumeOff from "@fider/assets/images/heroicons-volume-off.svg"
+import { VStack } from "@fider/components/layout"
interface NotificationsPanelProps {
post: Post
@@ -28,30 +30,26 @@ export const NotificationsPanel = (props: NotificationsPanelProps) => {
}
const button = subscribed ? (
- <Button fluid={true} onClick={subscribeOrUnsubscribe}>
- <FaVolumeMute /> Unsubscribe
+ <Button className="w-full" onClick={subscribeOrUnsubscribe}>
+ <Icon sprite={IconVolumeOff} /> <span>Unsubscribe</span>
</Button>
) : (
- <Button fluid={true} onClick={subscribeOrUnsubscribe}>
- <FaVolumeUp /> Subscribe
+ <Button className="w-full" onClick={subscribeOrUnsubscribe}>
+ <Icon sprite={IconVolumeOn} /> <span>Subscribe</span>
</Button>
)
const text = subscribed ? (
- <span className="info">You’re receiving notifications about activity on this post.</span>
+ <span className="text-muted">You’re receiving notifications about activity on this post.</span>
) : (
- <span className="info">You&apos;ll not receive any notification about this post.</span>
+ <span className="text-muted">You&apos;ll not receive any notification about this post.</span>
)
return (
- <>
- <span className="subtitle">Notifications</span>
- <List>
- <ListItem>
- {button}
- {text}
- </ListItem>
- </List>
- </>
+ <VStack>
+ <span className="text-category">Notifications</span>
+ {button}
+ {text}
+ </VStack>
)
}
diff --git a/public/pages/ShowPost/components/PostSearch.tsx b/public/pages/ShowPost/components/PostSearch.tsx
index 7c0a4255e..84e2e25bd 100644
--- a/public/pages/ShowPost/components/PostSearch.tsx
+++ b/public/pages/ShowPost/components/PostSearch.tsx
@@ -1,83 +1,59 @@
-import React from "react"
-import { Post, PostStatus } from "@fider/models"
+import React, { useEffect, useState } from "react"
+import IconSearch from "@fider/assets/images/heroicons-search.svg"
+import { Input, ShowPostStatus } from "@fider/components"
import { actions } from "@fider/services"
-import { DropDown, DropDownItem } from "@fider/components"
-import { FaCaretUp } from "react-icons/fa"
+import { Post, PostStatus } from "@fider/models"
+import { HStack, VStack } from "@fider/components/layout"
interface PostSearchProps {
exclude?: number[]
onChanged(postNumber: number): void
}
-interface PostSearchState {
- posts: Post[]
-}
-
-export class PostSearch extends React.Component<PostSearchProps, PostSearchState> {
- private timer?: number
+export const PostSearch = (props: PostSearchProps) => {
+ const [query, setQuery] = useState("")
+ const [posts, setPosts] = useState<Post[]>([])
+ const [selectedPost, setSelectedPost] = useState<Post>()
- constructor(props: PostSearchProps) {
- super(props)
- this.state = {
- posts: [],
+ useEffect(() => {
+ if (!query) {
+ return
}
- }
-
- public componentDidMount() {
- this.search("")
- }
- private onSearchChange = (e: React.SyntheticEvent<HTMLInputElement>) => {
- this.search(e.currentTarget.value)
- }
-
- private onChange = (item: DropDownItem) => {
- this.props.onChanged(item.value as number)
- }
-
- private search = (searchQuery: string) => {
- window.clearTimeout(this.timer)
- this.timer = window.setTimeout(() => {
- actions.searchPosts({ query: searchQuery }).then((res) => {
+ const timer = setTimeout(() => {
+ actions.searchPosts({ query, limit: 6 }).then((res) => {
if (res.ok) {
- const posts =
- this.props.exclude && this.props.exclude.length > 0
- ? res.data.filter((i) => this.props.exclude && this.props.exclude.indexOf(i.number) === -1)
- : res.data
- this.setState({ posts })
+ const filteredPosts =
+ props.exclude && props.exclude.length > 0 ? res.data.filter((i) => props.exclude && props.exclude.indexOf(i.number) === -1) : res.data
+ setPosts(filteredPosts)
}
})
}, 500)
- }
- public render() {
- const items = this.state.posts.map((p) => {
- const status = PostStatus.Get(p.status)
- return {
- label: p.title,
- value: p.number,
- render: (
- <>
- <span className="votes">
- <FaCaretUp />
- {p.votesCount}
- </span>
- <span className={`status-label status-${status.value}`}>{status.title}</span>
- {p.title}
- </>
- ),
- }
- })
+ return () => {
+ clearTimeout(timer)
+ }
+ }, [query])
- return (
- <DropDown
- className="c-post-search"
- searchable={true}
- items={items}
- placeholder="Search original post"
- onChange={this.onChange}
- onSearchChange={this.onSearchChange}
- />
- )
+ const selectPost = (post: Post) => () => {
+ props.onChanged(post.number)
+ setSelectedPost(post)
}
+
+ return (
+ <>
+ <Input field="query" icon={IconSearch} placeholder="Search original post..." value={query} onChange={setQuery} />
+ <div className="grid gap-2 grid-cols-1 lg:grid-cols-3">
+ {posts.map((p) => (
+ <VStack onClick={selectPost(p)} className={`bg-gray-50 p-4 clickable border-2 rounded ${selectedPost === p ? "border-primary-base" : ""}`} key={p.id}>
+ <HStack className="text-2xs">
+ <span>#{p.number}</span> <span>&middot;</span> <ShowPostStatus status={PostStatus.Get(p.status)} /> <span>&middot;</span>{" "}
+ <span>{p.votesCount} votes</span>
+ </HStack>
+ <span>{p.title}</span>
+ </VStack>
+ ))}
+ </div>
+ </>
+ )
}
diff --git a/public/pages/ShowPost/components/ResponseForm.tsx b/public/pages/ShowPost/components/ResponseForm.tsx
index 3c0e53cbd..1dd3354b9 100644
--- a/public/pages/ShowPost/components/ResponseForm.tsx
+++ b/public/pages/ShowPost/components/ResponseForm.tsx
@@ -1,11 +1,11 @@
import React from "react"
-import { Modal, Button, DisplayError, Select, Form, TextArea, Field, SelectOption } from "@fider/components"
+import { Modal, Button, DisplayError, Select, Form, TextArea, Field, SelectOption, Icon } from "@fider/components"
import { Post, PostStatus } from "@fider/models"
import { actions, Failure } from "@fider/services"
-import { FaBullhorn } from "react-icons/fa"
import { PostSearch } from "./PostSearch"
+import IconSpeakerPhone from "@fider/assets/images/heroicons-speakerphone.svg"
interface ResponseFormProps {
post: Post
@@ -66,8 +66,8 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
public render() {
const button = (
- <Button className="respond" fluid={true} onClick={this.showModal}>
- <FaBullhorn /> Respond
+ <Button className="w-full" onClick={this.showModal}>
+ <Icon sprite={IconSpeakerPhone} /> <span>Respond</span>
</Button>
)
@@ -87,7 +87,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
<PostSearch exclude={[this.props.post.number]} onChanged={this.setOriginalNumber} />
</Field>
<DisplayError fields={["originalNumber"]} error={this.state.error} />
- <span className="info">Votes from this post will be merged into original post.</span>
+ <span className="text-muted">Votes from this post will be merged into original post.</span>
</>
) : (
<TextArea
@@ -102,10 +102,10 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
</Modal.Content>
<Modal.Footer>
- <Button color="positive" onClick={this.submit}>
+ <Button variant="primary" onClick={this.submit}>
Submit
</Button>
- <Button color="cancel" onClick={this.closeModal}>
+ <Button variant="tertiary" onClick={this.closeModal}>
Cancel
</Button>
</Modal.Footer>
diff --git a/public/pages/ShowPost/components/ShowComment.tsx b/public/pages/ShowPost/components/ShowComment.tsx
index 772ab28e1..53c8ccab5 100644
--- a/public/pages/ShowPost/components/ShowComment.tsx
+++ b/public/pages/ShowPost/components/ShowComment.tsx
@@ -1,21 +1,10 @@
import React, { useState } from "react"
import { Comment, Post, ImageUpload } from "@fider/models"
-import {
- Avatar,
- UserName,
- Moment,
- Form,
- TextArea,
- Button,
- MultiLineText,
- DropDown,
- DropDownItem,
- Modal,
- ImageViewer,
- MultiImageUploader,
-} from "@fider/components"
+import { Avatar, UserName, Moment, Form, TextArea, Button, Markdown, Modal, ImageViewer, MultiImageUploader, Dropdown, Icon } from "@fider/components"
+import { HStack } from "@fider/components/layout"
import { formatDate, Failure, actions } from "@fider/services"
import { useFider } from "@fider/hooks"
+import IconDotsHorizontal from "@fider/assets/images/heroicons-dots-horizontal.svg"
interface ShowCommentProps {
post: Post
@@ -54,14 +43,6 @@ export const ShowComment = (props: ShowCommentProps) => {
}
}
- const renderEllipsis = () => {
- return (
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="16" height="16" focusable="false">
- <path d="M3 9.5A1.5 1.5 0 114.5 8 1.5 1.5 0 013 9.5zM11.5 8A1.5 1.5 0 1013 6.5 1.5 1.5 0 0011.5 8zm-5 0A1.5 1.5 0 108 6.5 1.5 1.5 0 006.5 8z"></path>
- </svg>
- )
- }
-
const closeModal = async () => {
setIsDeleteConfirmationModalOpen(false)
}
@@ -73,12 +54,12 @@ export const ShowComment = (props: ShowCommentProps) => {
}
}
- const onActionSelected = (item: DropDownItem) => {
- if (item.value === "edit") {
+ const onActionSelected = (action: string) => () => {
+ if (action === "edit") {
setIsEditing(true)
setNewContent(props.comment.content)
clearError()
- } else if (item.value === "delete") {
+ } else if (action === "delete") {
setIsDeleteConfirmationModalOpen(true)
}
}
@@ -94,10 +75,10 @@ export const ShowComment = (props: ShowCommentProps) => {
</Modal.Content>
<Modal.Footer>
- <Button color="danger" onClick={deleteComment}>
+ <Button variant="danger" onClick={deleteComment}>
Delete
</Button>
- <Button color="cancel" onClick={closeModal}>
+ <Button variant="tertiary" onClick={closeModal}>
Cancel
</Button>
</Modal.Footer>
@@ -112,55 +93,50 @@ export const ShowComment = (props: ShowCommentProps) => {
)
return (
- <div className="c-comment">
+ <HStack spacing={2} center={false} className="c-comment flex-items-baseline">
{modal()}
- <Avatar size="large" user={comment.user} />
- <div className="c-comment-content">
- <div className="c-comment-header">
- <div className="c-comment-author">
- <UserName user={comment.user} />{" "}
- <div className="c-comment-metadata">
- · <Moment date={comment.createdAt} /> {editedMetadata}
- </div>
- </div>
- <div className="c-comment-menu">
+ <div className="pt-4">
+ <Avatar user={comment.user} />
+ </div>
+ <div className="flex-grow bg-gray-50 rounded-md p-2">
+ <div className="mb-1">
+ <HStack justify="between">
+ <HStack>
+ <UserName user={comment.user} />{" "}
+ <div className="text-xs">
+ · <Moment date={comment.createdAt} /> {editedMetadata}
+ </div>
+ </HStack>
{!isEditing && canEditComment() && (
- <DropDown
- className="l-more-actions"
- direction="left"
- inline={true}
- style="simple"
- highlightSelected={false}
- items={[
- { label: "Edit", value: "edit" },
- { label: "Delete", value: "delete", render: <span style={{ color: "red" }}>Delete</span> },
- ]}
- onChange={onActionSelected}
- renderControl={renderEllipsis}
- />
+ <Dropdown position="left" renderHandle={<Icon sprite={IconDotsHorizontal} width="16" height="16" />}>
+ <Dropdown.ListItem onClick={onActionSelected("edit")}>Edit</Dropdown.ListItem>
+ <Dropdown.ListItem onClick={onActionSelected("delete")} className="text-red-700">
+ Delete
+ </Dropdown.ListItem>
+ </Dropdown>
)}
- </div>
+ </HStack>
</div>
- <div className="c-comment-body">
+ <div>
{isEditing ? (
<Form error={error}>
<TextArea field="content" minRows={1} value={newContent} placeholder={comment.content} onChange={setNewContent} />
- <MultiImageUploader field="attachments" bkeys={comment.attachments} maxUploads={2} previewMaxWidth={100} onChange={setAttachments} />
- <Button size="tiny" onClick={saveEdit} color="positive">
+ <MultiImageUploader field="attachments" bkeys={comment.attachments} maxUploads={2} onChange={setAttachments} />
+ <Button size="small" onClick={saveEdit} variant="primary">
Save
</Button>
- <Button color="cancel" size="tiny" onClick={cancelEdit}>
+ <Button variant="tertiary" size="small" onClick={cancelEdit}>
Cancel
</Button>
</Form>
) : (
<>
- <MultiLineText text={comment.content} style="full" />
+ <Markdown text={comment.content} style="full" />
{comment.attachments && comment.attachments.map((x) => <ImageViewer key={x} bkey={x} />)}
</>
)}
</div>
</div>
- </div>
+ </HStack>
)
}
diff --git a/public/pages/ShowPost/components/TagListItem.tsx b/public/pages/ShowPost/components/TagListItem.tsx
index 0fe951944..cc78eddd0 100644
--- a/public/pages/ShowPost/components/TagListItem.tsx
+++ b/public/pages/ShowPost/components/TagListItem.tsx
@@ -1,7 +1,8 @@
import React from "react"
import { Tag } from "@fider/models"
-import { ListItem, ShowTag } from "@fider/components"
-import { FaCheck } from "react-icons/fa"
+import { Icon, ShowTag } from "@fider/components"
+import IconCheck from "@fider/assets/images/heroicons-check.svg"
+import { HStack } from "@fider/components/layout"
interface TagListItemProps {
tag: Tag
@@ -15,10 +16,10 @@ export const TagListItem = (props: TagListItemProps) => {
}
return (
- <ListItem onClick={onClick}>
- {props.assigned ? <FaCheck /> : <svg className="icon" />}
+ <HStack className="clickable hover:bg-gray-100 rounded py-1" onClick={onClick}>
+ <Icon sprite={IconCheck} className={`h-4 text-green-600 ${!props.assigned && "invisible"}`} />
<ShowTag tag={props.tag} circular={true} />
<span>{props.tag.name}</span>
- </ListItem>
+ </HStack>
)
}
diff --git a/public/pages/ShowPost/components/TagsPanel.tsx b/public/pages/ShowPost/components/TagsPanel.tsx
index 0292605cf..c2208a140 100644
--- a/public/pages/ShowPost/components/TagsPanel.tsx
+++ b/public/pages/ShowPost/components/TagsPanel.tsx
@@ -1,11 +1,14 @@
import React, { useState } from "react"
import { Tag, Post } from "@fider/models"
import { actions } from "@fider/services"
-import { ShowTag, List, ListItem } from "@fider/components"
+import { ShowTag, Icon } from "@fider/components"
import { TagListItem } from "./TagListItem"
-import { FaCheckCircle, FaCog } from "react-icons/fa"
import { useFider } from "@fider/hooks"
+import IconPencilAlt from "@fider/assets/images/heroicons-pencil-alt.svg"
+import IconCheckCircle from "@fider/assets/images/heroicons-check-circle.svg"
+import { HStack, VStack } from "@fider/components/layout"
+
interface TagsPanelProps {
post: Post
tags: Tag[]
@@ -50,36 +53,33 @@ export const TagsPanel = (props: TagsPanelProps) => {
const tagsList =
assignedTags.length > 0 ? (
- <List className="c-tag-list">
+ <VStack spacing={2} className="flex-items-baseline">
{assignedTags.map((tag) => (
- <ListItem key={tag.id}>
- <ShowTag tag={tag} />
- </ListItem>
+ <ShowTag key={tag.id} tag={tag} />
))}
- </List>
+ </VStack>
) : (
- <span className="info">None</span>
+ <span className="text-muted">None</span>
)
const editTagsList = props.tags.length > 0 && (
- <List className="c-tag-list">
+ <VStack>
{props.tags.map((tag) => (
<TagListItem key={tag.id} tag={tag} assigned={assignedTags.indexOf(tag) >= 0} onClick={assignOrUnassignTag} />
))}
- </List>
+ </VStack>
)
- const subtitleClasses = `subtitle ${canEdit && "active"}`
- const icon = canEdit && (isEditing ? <FaCheckCircle /> : <FaCog />)
+ const icon = canEdit && (isEditing ? <Icon sprite={IconCheckCircle} className="h-4" /> : <Icon sprite={IconPencilAlt} className="h-4" />)
return (
- <>
- <span className={subtitleClasses} onClick={onSubtitleClick}>
- Tags {icon}
- </span>
+ <VStack>
+ <HStack spacing={2} className="text-category clickable" onClick={onSubtitleClick}>
+ <span>Tags</span> {icon}
+ </HStack>
{!isEditing && tagsList}
{isEditing && editTagsList}
- </>
+ </VStack>
)
}
diff --git a/public/pages/ShowPost/components/VotesModal.scss b/public/pages/ShowPost/components/VotesModal.scss
deleted file mode 100644
index b2e11efa8..000000000
--- a/public/pages/ShowPost/components/VotesModal.scss
+++ /dev/null
@@ -1,31 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.c-votes-modal {
- .c-modal-content {
- height: 300px;
- overflow-y: scroll;
-
- .c-list-item {
- margin: 2px 0px;
- display: flex;
- align-items: center;
-
- .l-user {
- margin-left: 5px;
- flex-grow: 1;
-
- span {
- display: block;
- max-width: 250px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- }
-
- .l-date {
- text-align: right;
- }
- }
- }
-}
diff --git a/public/pages/ShowPost/components/VotesModal.tsx b/public/pages/ShowPost/components/VotesModal.tsx
index 49bf3053c..bac6cd23a 100644
--- a/public/pages/ShowPost/components/VotesModal.tsx
+++ b/public/pages/ShowPost/components/VotesModal.tsx
@@ -1,10 +1,10 @@
-import "./VotesModal.scss"
-
import React from "react"
import { Post, Vote } from "@fider/models"
-import { Modal, Button, Loader, List, ListItem, Avatar, UserName, Moment, Input } from "@fider/components"
+import { Modal, Button, Loader, Avatar, UserName, Moment, Input } from "@fider/components"
import { actions } from "@fider/services"
-import { FaTimes, FaSearch } from "react-icons/fa"
+import IconSearch from "@fider/assets/images/heroicons-search.svg"
+import IconX from "@fider/assets/images/heroicons-x.svg"
+import { HStack, VStack } from "@fider/components/layout"
interface VotesModalProps {
isOpen: boolean
@@ -63,39 +63,42 @@ export class VotesModal extends React.Component<VotesModalProps, VotesModalState
public render() {
return (
- <Modal.Window className="c-votes-modal" isOpen={this.props.isOpen} center={false} onClose={this.closeModal}>
+ <Modal.Window isOpen={this.props.isOpen} center={false} onClose={this.closeModal}>
<Modal.Content>
{this.state.isLoading && <Loader />}
{!this.state.isLoading && (
<>
<Input
field="query"
- icon={this.state.query ? FaTimes : FaSearch}
+ icon={this.state.query ? IconX : IconSearch}
onIconClick={this.state.query ? this.clearSearch : undefined}
placeholder="Search for users by name..."
value={this.state.query}
onChange={this.handleSearchFilterChanged}
/>
- <List hover={true}>
+ <VStack spacing={2} className="h-max-5xl overflow-scroll">
{this.state.filteredVotes.map((x) => (
- <ListItem key={x.user.id}>
- <Avatar user={x.user} />
- <span className="l-user">
- <UserName user={x.user} />
- <span className="info">{x.user.email}</span>
- </span>
- <span className="l-date info">
+ <HStack key={x.user.id} justify="between">
+ <HStack>
+ <Avatar user={x.user} />
+ <VStack spacing={0}>
+ <UserName user={x.user} />
+ <span className="text-muted">{x.user.email}</span>
+ </VStack>
+ </HStack>
+ <span className="text-muted">
<Moment date={x.createdAt} />
</span>
- </ListItem>
+ </HStack>
))}
- </List>
+ {this.state.filteredVotes.length === 0 && <p className="text-muted">No users found matching &apos;{this.state.query}&apos;.</p>}
+ </VStack>
</>
)}
</Modal.Content>
<Modal.Footer>
- <Button color="cancel" onClick={this.closeModal}>
+ <Button variant="tertiary" onClick={this.closeModal}>
Close
</Button>
</Modal.Footer>
diff --git a/public/pages/ShowPost/components/VotesPanel.scss b/public/pages/ShowPost/components/VotesPanel.scss
deleted file mode 100644
index 5d850f93b..000000000
--- a/public/pages/ShowPost/components/VotesPanel.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-.l-votes-list {
- .c-avatar {
- margin: 0 -8px 0 -2px;
- padding: 0;
- }
-}
-
-.l-votes-more {
- margin-left: 14px;
- font-weight: 600;
- font-size: $font-size-tiny;
- &.clickable:hover {
- text-decoration: underline;
- }
-}
diff --git a/public/pages/ShowPost/components/VotesPanel.tsx b/public/pages/ShowPost/components/VotesPanel.tsx
index 4b8063b45..c9985f8dc 100644
--- a/public/pages/ShowPost/components/VotesPanel.tsx
+++ b/public/pages/ShowPost/components/VotesPanel.tsx
@@ -1,11 +1,10 @@
-import "./VotesPanel.scss"
-
import React, { useState } from "react"
import { Post, Vote } from "@fider/models"
-import { Avatar } from "@fider/components"
-import { Fider, classSet } from "@fider/services"
+import { AvatarStack, Button } from "@fider/components"
+import { Fider } from "@fider/services"
import { useFider } from "@fider/hooks"
import { VotesModal } from "./VotesModal"
+import { HStack, VStack } from "@fider/components/layout"
interface VotesPanelProps {
post: Post
@@ -15,42 +14,36 @@ interface VotesPanelProps {
export const VotesPanel = (props: VotesPanelProps) => {
const fider = useFider()
const [isVotesModalOpen, setIsVotesModalOpen] = useState(false)
+ const canShowAll = fider.session.isAuthenticated && Fider.session.user.isCollaborator
const openModal = () => {
- if (canShowAll()) {
+ if (canShowAll) {
setIsVotesModalOpen(true)
}
}
const closeModal = () => setIsVotesModalOpen(false)
- const canShowAll = () => fider.session.isAuthenticated && Fider.session.user.isCollaborator
const extraVotesCount = props.post.votesCount - props.votes.length
- const moreVotesClassName = classSet({
- "l-votes-more": true,
- clickable: canShowAll(),
- })
return (
- <>
+ <VStack>
<VotesModal post={props.post} isOpen={isVotesModalOpen} onClose={closeModal} />
- <span className="subtitle">Voters</span>
- <div className="l-votes-list">
- {props.votes.map((x) => (
- <Avatar key={x.user.id} user={x.user} />
- ))}
+ <span className="text-category">Voters</span>
+ <HStack>
+ {props.votes.length > 0 && <AvatarStack users={props.votes.map((x) => x.user)} />}
{extraVotesCount > 0 && (
- <span onClick={openModal} className={moreVotesClassName}>
+ <Button variant="tertiary" disabled={!canShowAll} size="small" onClick={openModal}>
+{extraVotesCount} more
- </span>
+ </Button>
)}
- {props.votes.length > 0 && extraVotesCount === 0 && canShowAll() && (
- <span onClick={openModal} className={moreVotesClassName}>
+ {props.votes.length > 0 && extraVotesCount === 0 && canShowAll && (
+ <Button variant="tertiary" size="small" disabled={!canShowAll} onClick={openModal}>
see details
- </span>
+ </Button>
)}
- {props.votes.length === 0 && <span className="info">None</span>}
- </div>
- </>
+ {props.votes.length === 0 && <span className="text-muted">None</span>}
+ </HStack>
+ </VStack>
)
}
diff --git a/public/pages/SignIn/SignIn.page.scss b/public/pages/SignIn/SignIn.page.scss
deleted file mode 100644
index 1fde13824..000000000
--- a/public/pages/SignIn/SignIn.page.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-signin {
- margin-top: 20px;
- text-align: center;
-
- @include media(">=md") {
- margin-top: 60px;
- max-width: 500px !important;
- }
-
- .message {
- max-width: 300px;
- margin: 0 auto;
- margin-bottom: 20px;
- img {
- max-height: 100px;
- margin-bottom: 10px;
- }
- .welcome {
- font-size: $font-size-big;
- }
- }
-}
diff --git a/public/pages/SignIn/SignIn.page.tsx b/public/pages/SignIn/SignIn.page.tsx
index b6dd2c194..b737d7c8a 100644
--- a/public/pages/SignIn/SignIn.page.tsx
+++ b/public/pages/SignIn/SignIn.page.tsx
@@ -1,12 +1,10 @@
-import "./SignIn.page.scss"
-
import React from "react"
import { SignInControl, TenantLogo, LegalNotice } from "@fider/components"
import { notify, Fider } from "@fider/services"
const Locked = (): JSX.Element => (
<>
- <p className="welcome">
+ <p className="text-title">
<strong>{Fider.session.tenant.name}</strong> is currently locked.
</p>
<p>To reactivate this site, sign in with an administrator account and update the required settings.</p>
@@ -15,7 +13,7 @@ const Locked = (): JSX.Element => (
const Private = (): JSX.Element => (
<>
- <p className="welcome">
+ <p className="text-title">
<strong>{Fider.session.tenant.name}</strong> is a private space and requires an invitation to join it.
</p>
<p>If you have an account or an invitation, you may use following options to sign in.</p>
@@ -33,11 +31,12 @@ export default class SignInPage extends React.Component<any, any> {
public render() {
return (
- <div id="p-signin" className="page container">
- <div className="message">
+ <div id="p-signin" className="page container w-max-6xl">
+ <div className="h-20 text-center mb-4">
<TenantLogo size={100} />
- {Fider.session.tenant.isPrivate ? <Private /> : <Locked />}
</div>
+ <div className="text-center w-max-4xl mx-auto mb-4">{Fider.session.tenant.isPrivate ? <Private /> : <Locked />}</div>
+
<SignInControl onEmailSent={this.onEmailSent} useEmail={true} redirectTo={Fider.settings.baseURL} />
<LegalNotice />
</div>
diff --git a/public/pages/SignUp/SignUp.page.scss b/public/pages/SignUp/SignUp.page.scss
deleted file mode 100644
index a9a76030a..000000000
--- a/public/pages/SignUp/SignUp.page.scss
+++ /dev/null
@@ -1,20 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-#p-signup {
- margin-top: 20px;
-
- @include media(">=md") {
- margin-top: 60px;
- max-width: 500px !important;
- }
-
- .logo {
- max-height: 100px;
- margin: 0 auto;
- display: block;
- }
-
- .c-button.m-positive {
- margin-top: 20px;
- }
-}
diff --git a/public/pages/SignUp/SignUp.page.tsx b/public/pages/SignUp/SignUp.page.tsx
index 35b4ec41f..6036f4895 100644
--- a/public/pages/SignUp/SignUp.page.tsx
+++ b/public/pages/SignUp/SignUp.page.tsx
@@ -1,5 +1,3 @@
-import "./SignUp.page.scss"
-
import React from "react"
import { SignInControl, Modal, Button, DisplayError, Form, Input, Message, LegalAgreement } from "@fider/components"
import { jwt, actions, Failure, querystring, Fider } from "@fider/services"
@@ -133,18 +131,21 @@ export default class SignUpPage extends React.Component<any, SignUpPageState> {
<Modal.Header>Thank you for registering!</Modal.Header>
<Modal.Content>
<p>
- We have just sent a confirmation link to <b>{this.state.email}</b>. <br /> Click the link to finish your registration.
+ We have just sent a confirmation link to <b>{this.state.email}</b>.
</p>
+ <p>Click the link to complete the registration.</p>
</Modal.Content>
</Modal.Window>
)
return (
- <div id="p-signup" className="page container">
+ <div id="p-signup" className="page container w-max-6xl">
{modal}
- <img className="logo" alt="Logo" src="https://getfider.com/images/logo-100x100.png" />
+ <div className="h-20 text-center mb-4">
+ <img className="logo" alt="Logo" src="https://getfider.com/images/logo-100x100.png" />
+ </div>
- <h3>1. Who are you?</h3>
+ <h3 className="text-display mb-2">1. Who are you?</h3>
<DisplayError fields={["token"]} error={this.state.error} />
{this.user ? (
@@ -162,19 +163,19 @@ export default class SignUpPage extends React.Component<any, SignUpPageState> {
</>
)}
- <h3>2. What is this Feedback Forum for?</h3>
+ <h3 className="text-display mb-2 mt-8">2. What is this Feedback Forum for?</h3>
- <Form error={this.state.error}>
+ <Form error={this.state.error} className="mb-8">
<Input field="tenantName" maxLength={60} onChange={this.setTenantName} placeholder="your company or product name" />
{!Fider.isSingleHostMode() && (
<Input field="subdomain" maxLength={40} onChange={this.setSubdomain} placeholder="subdomain" suffix={Fider.settings.domain}>
{this.state.subdomain.available && (
- <Message type="success" showIcon={true}>
+ <Message className="mt-2" type="success" showIcon={true}>
This subdomain is available!
</Message>
)}
{this.state.subdomain.message && (
- <Message type="error" showIcon={true}>
+ <Message className="mt-2" type="error" showIcon={true}>
{this.state.subdomain.message}
</Message>
)}
@@ -182,15 +183,11 @@ export default class SignUpPage extends React.Component<any, SignUpPageState> {
)}
</Form>
- <h3>3. Review</h3>
-
- <p>Make sure information provided above is correct.</p>
-
- <Form error={this.state.error}>
+ <Form error={this.state.error} className="mb-4">
<LegalAgreement onChange={this.onAgree} />
</Form>
- <Button color="positive" size="large" onClick={this.confirm}>
+ <Button variant="primary" size="large" onClick={this.confirm}>
Confirm
</Button>
</div>
diff --git a/public/pages/UI/UIToolkit.page.scss b/public/pages/UI/UIToolkit.page.scss
deleted file mode 100644
index 11915d3be..000000000
--- a/public/pages/UI/UIToolkit.page.scss
+++ /dev/null
@@ -1,82 +0,0 @@
-@import "~@fider/assets/styles/variables.scss";
-
-$color-box-size: 100px;
-
-#p-ui-toolkit {
- .color-scale {
- margin-bottom: 10px;
- }
- .color {
- width: $color-box-size;
- height: $color-box-size;
- display: inline-block;
- margin: 0px 2px;
- border-radius: 5px;
- &:before {
- width: $color-box-size;
- height: $color-box-size;
- line-height: $color-box-size;
- text-align: center;
- display: block;
- }
-
- @each $name, $color in $gray-scale {
- &.gray-#{$name} {
- color: textColorFor($color);
- box-shadow: 0px 1px 1px 0px rgba(textColorFor($color), 0.2);
- background-color: $color;
- &:before {
- content: "#{$color}";
- }
- }
- }
-
- @each $name, $color in $green-scale {
- &.green-#{$name} {
- color: textColorFor($color);
- box-shadow: 0px 1px 1px 0px rgba(textColorFor($color), 0.2);
- background-color: $color;
- &:before {
- content: "#{$color}";
- }
- }
- }
-
- @each $name, $color in $yellow-scale {
- &.yellow-#{$name} {
- color: textColorFor($color);
- box-shadow: 0px 1px 1px 0px rgba(textColorFor($color), 0.2);
- background-color: $color;
- &:before {
- content: "#{$color}";
- }
- }
- }
-
- @each $name, $color in $red-scale {
- &.red-#{$name} {
- color: textColorFor($color);
- box-shadow: 0px 1px 1px 0px rgba(textColorFor($color), 0.2);
- background-color: $color;
- &:before {
- content: "#{$color}";
- }
- }
- }
-
- @each $name, $color in $blue-scale {
- &.blue-#{$name} {
- color: textColorFor($color);
- box-shadow: 0px 1px 1px 0px rgba(textColorFor($color), 0.2);
- background-color: $color;
- &:before {
- content: "#{$color}";
- }
- }
- }
- }
-
- .c-tag {
- margin-right: 5px;
- }
-}
diff --git a/public/pages/UI/UIToolkit.page.tsx b/public/pages/UI/UIToolkit.page.tsx
deleted file mode 100644
index 6eaa1a36c..000000000
--- a/public/pages/UI/UIToolkit.page.tsx
+++ /dev/null
@@ -1,492 +0,0 @@
-import "./UIToolkit.page.scss"
-
-import React, { useState } from "react"
-import { PostStatus, UserStatus } from "@fider/models"
-import {
- Heading,
- Button,
- List,
- UserName,
- ListItem,
- Toggle,
- Avatar,
- ShowTag,
- Segment,
- Segments,
- ShowPostStatus,
- Moment,
- Loader,
- Form,
- Input,
- TextArea,
- RadioButton,
- Select,
- Field,
- SelectOption,
- ButtonClickEvent,
- Message,
- Hint,
-} from "@fider/components"
-import { User, UserRole, Tag } from "@fider/models"
-import { notify, Failure } from "@fider/services"
-import { DropDown, DropDownItem } from "@fider/components"
-import { FaSearch, FaRegLightbulb, FaCogs } from "react-icons/fa"
-
-const jonSnow: User = {
- id: 0,
- name: "Jon Snow",
- role: UserRole.Administrator,
- status: UserStatus.Active,
- avatarURL: "/avatars/letter/0/Jon%20Snow",
-}
-
-const aryaStark: User = {
- id: 0,
- name: "Arya Snow",
- role: UserRole.Visitor,
- status: UserStatus.Active,
- avatarURL: "/avatars/letter/0/Arya%20Snow",
-}
-
-const easyTag: Tag = { id: 2, slug: "easy", name: "easy", color: "FB3A62", isPublic: true }
-const hardTag: Tag = { id: 3, slug: "hard", name: "hard", color: "fbca04", isPublic: false }
-
-const visibilityPublic = { label: "Public", value: "public" }
-const visibilityPrivate = { label: "Private", value: "private" }
-
-const UIToolkitPage = () => {
- const [error, setError] = useState<Failure | undefined>(undefined)
-
- const notifyError = async () => {
- notify.error("Something went wrong...")
- }
-
- const notifySuccess = async () => {
- notify.success("Congratulations! It worked!")
- }
-
- const notifyStatusChange = (opt?: SelectOption) => {
- if (opt) {
- notify.success(opt.value)
- }
- }
-
- const showLoading = async (e: ButtonClickEvent) => {
- return e.preventEnable()
- }
-
- const forceError = async () => {
- setError({
- errors: [
- { field: "title", message: "Title is mandatory" },
- { field: "description", message: "Error #1" },
- { field: "description", message: "Error #2" },
- { field: "status", message: "Status is mandatory" },
- ],
- })
- }
-
- const renderText = (item?: DropDownItem) => {
- if (item) {
- return `${item.label} (value: ${item.value})`
- }
- return <span>No country is selected</span>
- }
-
- const renderControl = (item?: DropDownItem) => {
- if (item) {
- return item.render
- }
- return <span>...</span>
- }
-
- return (
- <div id="p-ui-toolkit" className="page container">
- <div className="color-scale">
- <div className="color gray-900" />
- <div className="color gray-700" />
- <div className="color gray-500" />
- <div className="color gray-400" />
- <div className="color gray-300" />
- <div className="color gray-200" />
- <div className="color gray-100" />
- <div className="color gray-50" />
- </div>
- <div className="color-scale">
- <div className="color green-900" />
- <div className="color green-700" />
- <div className="color green-500" />
- <div className="color green-400" />
- <div className="color green-300" />
- <div className="color green-200" />
- <div className="color green-100" />
- <div className="color green-50" />
- </div>
- <div className="color-scale">
- <div className="color red-900" />
- <div className="color red-700" />
- <div className="color red-500" />
- <div className="color red-400" />
- <div className="color red-300" />
- <div className="color red-200" />
- <div className="color red-100" />
- <div className="color red-50" />
- </div>
- <div className="color-scale">
- <div className="color blue-900" />
- <div className="color blue-700" />
- <div className="color blue-500" />
- <div className="color blue-400" />
- <div className="color blue-300" />
- <div className="color blue-200" />
- <div className="color blue-100" />
- <div className="color blue-50" />
- </div>
- <div className="color-scale">
- <div className="color yellow-900" />
- <div className="color yellow-700" />
- <div className="color yellow-500" />
- <div className="color yellow-400" />
- <div className="color yellow-300" />
- <div className="color yellow-200" />
- <div className="color yellow-100" />
- <div className="color yellow-50" />
- </div>
-
- <h1>Heading 1</h1>
- <h2>Heading 2</h2>
- <h3>Heading 3</h3>
- <h4>Heading 4</h4>
- <h5>Heading 5</h5>
- <h6>Heading 6</h6>
- <p>General Text Paragraph</p>
- <p className="info">Info Text</p>
-
- <Segment>
- <h2>The title</h2>
- <p>The content goes here</p>
- </Segment>
-
- <Segments>
- <Segment>
- <p>First Segment</p>
- </Segment>
- <Segment>
- <p>Second Segment</p>
- </Segment>
- <Segment>
- <p>Third Segment</p>
- </Segment>
- </Segments>
-
- <List>
- <ListItem>
- <Avatar user={jonSnow} /> <UserName user={jonSnow} />
- </ListItem>
- <ListItem>
- <Avatar user={aryaStark} /> <UserName user={aryaStark} />
- </ListItem>
- </List>
-
- <Heading title="Page Heading" icon={FaCogs} subtitle="This is a page heading" />
-
- <Heading title="Section Heading" icon={FaRegLightbulb} subtitle="This is a page heading" size="small" dividing={true} />
-
- <h1>Buttons</h1>
- <List>
- <ListItem>
- <Button size="large">
- <FaRegLightbulb /> Large Icon
- </Button>
- <Button size="large">Large Default</Button>
- <Button color="positive" size="large">
- Large Positive
- </Button>
- <Button color="danger" size="large">
- Large Danger
- </Button>
- <Button color="cancel" size="large">
- Large Cancel
- </Button>
- </ListItem>
-
- <ListItem>
- <Button size="normal">
- <FaRegLightbulb /> Normal Icon
- </Button>
- <Button size="normal">Normal Default</Button>
- <Button color="positive" size="normal">
- Normal Positive
- </Button>
- <Button color="danger" size="normal">
- Normal Danger
- </Button>
- <Button color="cancel" size="normal">
- Normal Cancel
- </Button>
- </ListItem>
-
- <ListItem>
- <Button size="small">
- <FaRegLightbulb /> Small Icon
- </Button>
- <Button size="small">Small Default</Button>
- <Button color="positive" size="small">
- Small Positive
- </Button>
- <Button color="danger" size="small">
- Small Danger
- </Button>
- <Button color="cancel" size="small">
- Small Cancel
- </Button>
- </ListItem>
-
- <ListItem>
- <Button size="tiny">
- <FaRegLightbulb /> Tiny Icon
- </Button>
- <Button size="tiny">Tiny Default</Button>
- <Button color="positive" size="tiny">
- Tiny Positive
- </Button>
- <Button color="danger" size="tiny">
- Tiny Danger
- </Button>
- <Button color="cancel" size="tiny">
- Tiny Cancel
- </Button>
- </ListItem>
-
- <ListItem>
- <Button size="mini">
- <FaRegLightbulb /> Mini Icon
- </Button>
- <Button size="mini">Mini Default</Button>
- <Button color="positive" size="mini">
- Mini Positive
- </Button>
- <Button color="danger" size="mini">
- Mini Danger
- </Button>
- <Button color="cancel" size="mini">
- Mini Cancel
- </Button>
- </ListItem>
-
- <ListItem>
- <Button href="#">
- <FaRegLightbulb /> Link
- </Button>
- <Button href="#">Link</Button>
- <Button href="#" color="positive">
- Link
- </Button>
- <Button href="#" color="danger">
- Link
- </Button>
- </ListItem>
-
- <ListItem>
- <Button disabled={true}>
- <FaRegLightbulb /> Default
- </Button>
- <Button disabled={true}>Default</Button>
- <Button disabled={true} color="positive">
- Positive
- </Button>
- <Button disabled={true} color="danger">
- Danger
- </Button>
- </ListItem>
-
- <ListItem>
- <Button onClick={showLoading}>
- <FaRegLightbulb /> Loading
- </Button>
- <Button onClick={showLoading}>Loading</Button>
- <Button color="positive" onClick={showLoading}>
- Loading
- </Button>
- <Button color="danger" onClick={showLoading}>
- Loading
- </Button>
- </ListItem>
- </List>
-
- <h1>Toggle</h1>
- <List>
- <ListItem>
- <Toggle active={true} label="Active" />
- </ListItem>
- <ListItem>
- <Toggle active={false} label="Inactive" />
- </ListItem>
- <ListItem>
- <Toggle active={true} disabled={true} label="Disabled" />
- </ListItem>
- </List>
-
- <h1>Statuses</h1>
- <List>
- <ListItem>
- <ShowPostStatus status={PostStatus.Open} />
- </ListItem>
- <ListItem>
- <ShowPostStatus status={PostStatus.Planned} />
- </ListItem>
- <ListItem>
- <ShowPostStatus status={PostStatus.Started} />
- </ListItem>
- <ListItem>
- <ShowPostStatus status={PostStatus.Duplicate} />
- </ListItem>
- <ListItem>
- <ShowPostStatus status={PostStatus.Completed} />
- </ListItem>
- <ListItem>
- <ShowPostStatus status={PostStatus.Declined} />
- </ListItem>
- </List>
-
- <h1>Tags</h1>
- <List>
- <ListItem>
- <ShowTag tag={easyTag} />
- <ShowTag tag={hardTag} />
- <ShowTag tag={easyTag} circular={true} />
- <ShowTag tag={hardTag} circular={true} />
- </ListItem>
- </List>
-
- <h1>Notification</h1>
- <List>
- <ListItem>
- <Button onClick={notifySuccess}>Success</Button>
- <Button onClick={notifyError}>Error</Button>
- </ListItem>
- </List>
-
- <h1>Moment</h1>
- <List>
- <ListItem>
- Relative: <Moment date="2017-06-03T16:55:06.815042Z" format="relative" />
- </ListItem>
- <ListItem>
- Short: <Moment date="2017-06-03T16:55:06.815042Z" format="short" />
- </ListItem>
- <ListItem>
- Full: <Moment date="2017-06-03T16:55:06.815042Z" format="full" />
- </ListItem>
- </List>
-
- <h1>Loader</h1>
- <Loader />
-
- <h1>Message Box</h1>
- <Message showIcon={true} type="error">
- Something went wrong.
- </Message>
- <Message showIcon={true} type="warning">
- Be careful!
- </Message>
- <Message showIcon={true} type="success">
- Your order has been confirmed.
- </Message>
-
- <h1>Hints</h1>
- <Hint permanentCloseKey="ui-toolkip-example">Did you know that you can close this permanently?</Hint>
- <Hint>You can&apos;t close this one :)</Hint>
-
- <h1>Form</h1>
- <Form error={error}>
- <Input label="Title" field="title">
- <p className="info">This is the explanation for the field above.</p>
- </Input>
- <Input label="Disabled!" field="unamed" disabled={true} value={"you can't change this!"} />
- <Input label="Name" field="name" placeholder={"Your name goes here..."} />
- <Input label="Subdomain" field="subdomain" suffix="fider.io" />
- <Input label="Email" field="email" suffix={<Button color="positive">Sign in</Button>} />
- <TextArea label="Description" field="description" minRows={5}>
- <p className="info">This textarea resizes as you type.</p>
- </TextArea>
- <Input field="age" placeholder="This field doesn't have a label" />
-
- <div className="row">
- <div className="col-md-3">
- <Input label="Title1" field="title1" />
- </div>
- <div className="col-md-3">
- <Input label="Title2" field="title2" />
- </div>
- <div className="col-md-3">
- <Input label="Title3" field="title3" />
- </div>
- <div className="col-md-3">
- <RadioButton label="Visibility" field="visibility" defaultOption={visibilityPublic} options={[visibilityPrivate, visibilityPublic]} />
- </div>
- </div>
-
- <Select
- label="Status"
- field="status"
- options={[
- { value: "open", label: "Open" },
- { value: "started", label: "Started" },
- { value: "planned", label: "Planned" },
- ]}
- onChange={notifyStatusChange}
- />
-
- <Field label="Number">
- <DropDown
- items={[
- { label: "One", value: "1" },
- { label: "Two", value: "2" },
- { label: "Three", value: "3" },
- ]}
- defaultValue={"1"}
- placeholder="Select a number"
- />
- </Field>
-
- <Field label="Country (custom render text)">
- <DropDown
- items={[
- { label: "Brazil", value: "br" },
- { label: "United States", value: "us" },
- { label: "Ireland", value: "ie" },
- ]}
- defaultValue={"1"}
- renderText={renderText}
- placeholder="Select a number"
- />
- </Field>
-
- <Field label="Color (custom render control)">
- <DropDown
- items={[
- { label: "Green", value: "green", render: <span style={{ color: "green" }}>Green</span> },
- { label: "Red", value: "red", render: <span style={{ color: "red" }}>Red</span> },
- { label: "Blue", value: "blue", render: <span style={{ color: "blue" }}>Blue</span> },
- ]}
- placeholder="Select a color"
- inline={true}
- style="simple"
- header="What color do you like the most?"
- renderControl={renderControl}
- />
- </Field>
-
- <Button onClick={forceError}>Save</Button>
- </Form>
-
- <Segment>
- <h1>Search</h1>
- <Input field="search" placeholder="Search..." icon={FaSearch} />
- </Segment>
- </div>
- )
-}
-
-export default UIToolkitPage
diff --git a/public/pages/UI/index.ts b/public/pages/UI/index.ts
deleted file mode 100644
index be74474cb..000000000
--- a/public/pages/UI/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./UIToolkit.page"
diff --git a/public/router.tsx b/public/router.tsx
index 673edf1d4..b453c2167 100644
--- a/public/router.tsx
+++ b/public/router.tsx
@@ -24,6 +24,8 @@ const defaultRoutes = [
route("/admin/authentication", Pages.AsyncManageAuthenticationPage),
route("/admin/advanced", Pages.AsyncAdvancedSettingsPage),
route("/admin", Pages.AsyncGeneralSettingsPage),
+ route("/terms", Pages.AsyncLegalPage, false),
+ route("/privacy", Pages.AsyncLegalPage, false),
route("/signin", Pages.AsyncSignInPage, false),
route("/signup", Pages.AsyncSignUpPage, false),
route("/signin/verify", Pages.AsyncCompleteSignInProfilePage),
@@ -31,7 +33,7 @@ const defaultRoutes = [
route("/notifications", Pages.AsyncMyNotificationsPage),
route("/settings", Pages.AsyncMySettingsPage),
route("/oauth/:string/echo", Pages.AsyncOAuthEchoPage, false),
- route("/-/ui", Pages.AsyncUIToolkitPage),
+ route("/_design", Pages.AsyncDesignSystemPage),
]
export const resolveRootComponent = (path: string, routes: PageConfiguration[] = defaultRoutes): PageConfiguration => {
diff --git a/public/services/markdown.spec.ts b/public/services/markdown.spec.ts
index dda15b9c0..1c8d4e1e4 100644
--- a/public/services/markdown.spec.ts
+++ b/public/services/markdown.spec.ts
@@ -3,7 +3,7 @@ import * as markdown from "./markdown"
const testCases = [
{
input: "Visit [GitHub](https://github.com) to learn more.",
- expectedFull: '<p>Visit <a target="_blank" rel="noopener" href="https://github.com">GitHub</a> to learn more.</p>',
+ expectedFull: '<p>Visit <a target="_blank" rel="noopener" href="https://github.com" class="text-link">GitHub</a> to learn more.</p>',
expectedPlainText: "Visit GitHub to learn more.",
},
{
@@ -24,7 +24,7 @@ const testCases = [
},
{
input: `[Uh oh...]("onerror="alert('XSS'))`,
- expectedFull: '<p><a target="_blank" rel="noopener" href="">Uh oh...</a></p>',
+ expectedFull: '<p><a target="_blank" rel="noopener" href="" class="text-link">Uh oh...</a></p>',
expectedPlainText: "Uh oh...",
},
{
diff --git a/public/services/markdown.ts b/public/services/markdown.ts
index 9daf2257f..2e1e7aaa8 100644
--- a/public/services/markdown.ts
+++ b/public/services/markdown.ts
@@ -20,7 +20,7 @@ if (DOMPurify.isSupported) {
const link = (href: string, title: string, text: string) => {
const titleAttr = title ? ` title=${title}` : ""
- return `<a href="${href}"${titleAttr} rel="noopener" target="_blank">${text}</a>`
+ return `<a class="text-link" href="${href}"${titleAttr} rel="noopener" target="_blank">${text}</a>`
}
const fullRenderer = new marked.Renderer()
diff --git a/public/services/toastify.tsx b/public/services/toastify.tsx
index c2962b015..a99ce4c19 100644
--- a/public/services/toastify.tsx
+++ b/public/services/toastify.tsx
@@ -9,7 +9,7 @@ let hasContainer = false
const setup = () => {
if (!hasContainer) {
hasContainer = true
- ReactDOM.render(<ToastContainer position={toast.POSITION.TOP_RIGHT} toastClassName="c-toast" />, document.getElementById("root-toastify"))
+ ReactDOM.render(<ToastContainer position={toast.POSITION.TOP_RIGHT} />, document.getElementById("root-toastify"))
}
}
diff --git a/public/ssr.tsx b/public/ssr.tsx
index ec6177c08..4df25b446 100644
--- a/public/ssr.tsx
+++ b/public/ssr.tsx
@@ -1,7 +1,6 @@
import React from "react"
import { renderToStaticMarkup } from "react-dom/server"
import { Fider, FiderContext } from "./services/fider"
-import { IconContext } from "react-icons"
import { Header } from "./components"
import { resolveRootComponent, route } from "./router"
@@ -9,7 +8,8 @@ import HomePage from "./pages/Home/Home.page"
import ShowPostPage from "./pages/ShowPost/ShowPost.page"
import SignInPage from "./pages/SignIn/SignIn.page"
import SignUpPage from "./pages/SignUp/SignUp.page"
-import UIToolkitPage from "./pages/UI/UIToolkit.page"
+import DesignSystemPage from "./pages/DesignSystem/DesignSystem.page"
+import LegalPage from "./pages/Legal/Legal.page"
// Only public routes should be here
// Routes behind authentication are not crawled
@@ -18,7 +18,9 @@ const routes = [
route("/posts/:number*", ShowPostPage),
route("/signin", SignInPage, false),
route("/signup", SignUpPage, false),
- route("/-/ui", UIToolkitPage),
+ route("/terms", LegalPage, false),
+ route("/privacy", LegalPage, false),
+ route("/_design", DesignSystemPage),
]
function ssrRender(url: string, pathname: string, args: any) {
@@ -28,10 +30,8 @@ function ssrRender(url: string, pathname: string, args: any) {
return renderToStaticMarkup(
<FiderContext.Provider value={fider}>
- <IconContext.Provider value={{ className: "icon" }}>
- {config.showHeader && <Header />}
- {React.createElement(config.component, args.props)}
- </IconContext.Provider>
+ {config.showHeader && <Header />}
+ {React.createElement(config.component, args.props)}
</FiderContext.Provider>
)
}
diff --git a/robots.txt b/robots.txt
index 7c1412ff5..5bd818145 100644
--- a/robots.txt
+++ b/robots.txt
@@ -5,4 +5,4 @@ Disallow: /admin/
Disallow: /oauth/
Disallow: /terms
Disallow: /privacy
-Disallow: /-/ui
\ No newline at end of file
+Disallow: /_design
\ No newline at end of file
diff --git a/views/403.html b/views/403.html
index ee1e8dfc9..614ae1fc5 100644
--- a/views/403.html
+++ b/views/403.html
@@ -1,17 +1,15 @@
-{{define "server-data"}}{{end}}
-
-{{define "content"}}
- <div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>NOT AUTHORIZED</h1>
- <p>
- You are not authorized to view this page.
- </p>
+{{define "server-data"}}{{end}} {{define "content"}}
+<div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}" />
+ </div>
+ <h1 class="text-display">NOT AUTHORIZED</h1>
+ <p>You are not authorized to view this page.</p>
{{ if .public.tenant }}
- <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
+ <span>Take me back to <a class="text-link" href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
+</div>
+{{end}} {{define "end-of-body"}}{{end}}
diff --git a/views/404.html b/views/404.html
index 2bb839e47..b545e2d05 100644
--- a/views/404.html
+++ b/views/404.html
@@ -1,18 +1,18 @@
-{{define "server-data"}}{{end}}
-
-{{define "content"}}
- <div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>PAGE NOT FOUND</h1>
+{{define "server-data"}}{{end}} {{define "content"}}
+<div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}" />
+ </div>
+ <h1 class="text-display">PAGE NOT FOUND</h1>
<p>
The link you clicked may be broken or <br />
the page may have been removed.
</p>
{{ if .public.tenant }}
- <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
+ <span>Take me back to <a class="text-link" href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
+</div>
+{{end}} {{define "end-of-body"}}{{end}}
diff --git a/views/410.html b/views/410.html
index d2438d5a8..f3f036419 100644
--- a/views/410.html
+++ b/views/410.html
@@ -1,15 +1,15 @@
-{{define "server-data"}}{{end}}
-
-{{define "content"}}
- <div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>EXPIRED</h1>
+{{define "server-data"}}{{end}} {{define "content"}}
+<div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}" />
+ </div>
+ <h1 class="text-display">EXPIRED</h1>
<p>The link you clicked has expired.</p>
{{ if .public.tenant }}
- <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
+ <span>Take me back to <a class="text-link" href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
+</div>
+{{end}} {{define "end-of-body"}}{{end}}
diff --git a/views/500.html b/views/500.html
index d0e9ef0c5..7a5732cee 100644
--- a/views/500.html
+++ b/views/500.html
@@ -1,14 +1,18 @@
{{define "server-data"}}{{end}}
{{define "content"}}
- <div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>Shoot! Well, this is unexpected…</h1>
- <p>An error has occurred and we're working to fix the problem! </br> We’ll be up and running shortly.</p>
+ <div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}"/>
+ </div>
+ <h1 class="text-display">Shoot! Well, this is unexpected…</h1>
+ <p>An error has occurred and we're working to fix the problem! </br> We’ll be up and running shortly.</p>
- {{ if .public.tenant }}
- <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
- {{ end }}
+ {{ if .public.tenant }}
+ <span>Take me back to <a class="text-link" href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
+ {{ end }}
+ </div>
</div>
{{end}}
diff --git a/views/index.html b/views/index.html
index c255a5e98..53ee7221c 100644
--- a/views/index.html
+++ b/views/index.html
@@ -10,11 +10,10 @@
{{end}}
{{define "noscript"}}
-<noscript class="container">
- <div class="c-segment">
- <h2>Please enable JavaScript</h2>
- <p>This website relies on JavaScript-based technologies and services.</p>
- <p>Please enable JavaScript and then reload the page.</p>
+<noscript class="container page">
+ <div class="mt-8">
+ <h2 class="text-display2">Please enable JavaScript</h2>
+ <p>This website requires JavaScript, please enable and reload the page.</p>
</div>
</noscript>
{{end}}
diff --git a/views/legal.html b/views/legal.html
deleted file mode 100644
index 535616d3e..000000000
--- a/views/legal.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{{define "server-data"}}{{end}}
-
-{{define "content"}}
- <div class="container legal-page">
- {{ .public.props.Content | markdown }}
- </div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
diff --git a/views/maintenance.html b/views/maintenance.html
index 175ca8602..923ab0983 100644
--- a/views/maintenance.html
+++ b/views/maintenance.html
@@ -1,17 +1,17 @@
-{{define "server-data"}}{{end}}
-
-{{define "content"}}
- <div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>UNDER MAINTENANCE</h1>
+{{define "server-data"}}{{end}} {{define "content"}}
+<div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}" />
+ </div>
+ <h1 class="text-display">UNDER MAINTENANCE</h1>
<p>{{ .public.props.message }}</p>
- {{ if .public.props.until }}
- <p>We'll be back at <strong>{{ .public.props.until }}</strong>.</p>
+ {{ if .public.props.until }}
+ <p>We'll be back at <strong>{{ .public.props.until }}</strong>.</p>
{{ else }}
- <p>We'll be back soon.</p>
+ <p>We'll be back soon.</p>
{{ end }}
</div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
+</div>
+{{end}} {{define "end-of-body"}}{{end}}
diff --git a/views/not-invited.html b/views/not-invited.html
index 3b311ebc7..58c8f8ec5 100644
--- a/views/not-invited.html
+++ b/views/not-invited.html
@@ -1,21 +1,15 @@
-{{define "title"}}
-Not Invited &middot; Fider
-{{end}}
-
-{{define "server-data"}}{{end}}
+{{define "title"}} Not Invited &middot; Fider {{end}} {{define "server-data"}}{{end}} {{define "content"}}
+<div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}" />
+ </div>
+ <h1 class="text-display">NOT INVITED</h1>
+ <p>We couldn't find your account for your email address.</p>
-{{define "content"}}
-<div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>NOT INVITED</h1>
- <p>
- We couldn't find your account for your email address.
- </p>
-
- {{ if .public.tenant }}
- <span>Take me back to <a href="{{ .public.settings.baseURL }}/signin">{{ .public.settings.baseURL }}/signin</a>.</span>
- {{ end }}
+ {{ if .public.tenant }}
+ <span>Take me back to <a class="text-link" href="{{ .public.settings.baseURL }}/signin">{{ .public.settings.baseURL }}/signin</a>.</span>
+ {{ end }}
+ </div>
</div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
+{{end}} {{define "end-of-body"}}{{end}}
diff --git a/views/pending-activation.html b/views/pending-activation.html
index a354c25bf..806b5b640 100644
--- a/views/pending-activation.html
+++ b/views/pending-activation.html
@@ -1,16 +1,12 @@
-{{define "title"}}
-Pending Activation &middot; Fider
-{{end}}
-
-{{define "server-data"}}{{end}}
-
-{{define "content"}}
-<div class="container failure-page">
- <img src="{{ .private.logo }}"/>
- <h1>YOUR ACCOUNT IS PENDING ACTIVATION</h1>
- <p>We sent you a confirmation email with a link to activate your site.</p>
- <p>Please check your inbox to activate it.</p>
+{{define "title"}} Pending Activation &middot; Fider {{end}} {{define "server-data"}}{{end}} {{define "content"}}
+<div class="container page">
+ <div class="w-max-7xl mx-auto text-center mt-8">
+ <div class="h-20 mb-4">
+ <img src="{{ .private.logo }}" />
+ </div>
+ <h1 class="text-display">YOUR ACCOUNT IS PENDING ACTIVATION</h1>
+ <p>We sent you a confirmation email with a link to activate your site.</p>
+ <p>Please check your inbox to activate it.</p>
+ </div>
</div>
-{{end}}
-
-{{define "end-of-body"}}{{end}}
\ No newline at end of file
+{{end}} {{define "end-of-body"}}{{end}}
diff --git a/views/templates/signup_email.tpl b/views/templates/signup_email.tpl
index 82b0a4b6d..a509f6f94 100644
--- a/views/templates/signup_email.tpl
+++ b/views/templates/signup_email.tpl
@@ -1,7 +1,7 @@
-subject: Confirm your new Fider instance
+subject: Confirm your new Fider site
body:
<tr>
- <td>Click the link below to confirm your new Fider instance.</td>
+ <td>Click the link below to confirm your new Fider site.</td>
</tr>
<tr>
<td height="20">&nbsp;</td>
diff --git a/webpack.config.js b/webpack.config.js
index 7644901f2..45884ec1b 100755
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,9 +1,12 @@
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path")
+const glob = require("glob")
-const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin")
+const PurgecssPlugin = require("purgecss-webpack-plugin")
+const SpriteLoaderPlugin = require("svg-sprite-loader/plugin")
+const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin
const publicFolder = path.resolve(__dirname, "public")
@@ -28,6 +31,12 @@ const plugins = [
modules: false,
},
}),
+ new PurgecssPlugin({
+ paths: glob.sync(`./public/**/*.{html,tsx}`, { nodir: true }),
+ defaultExtractor: (content) => content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [],
+ safelist: [/--/, /__/],
+ }),
+ new SpriteLoaderPlugin({ plainSprite: true }),
]
// On Development Mode, we allow Assets to be up to 14 times bigger than on Production Mode
@@ -71,11 +80,15 @@ module.exports = {
},
},
{
- test: /\.(svg?)(\?[a-z0-9=&.]+)?$/,
+ test: /\.svg$/,
include: publicFolder,
- loader: "file-loader",
+ loader: "svg-sprite-loader",
options: {
- name: "images/[name].[hash].[ext]",
+ esModule: false,
+ extract: true,
+ outputPath: "icons/",
+ spriteFilename: "sprite.[hash].svg",
+ publicPath: "/assets/icons/",
},
},
],
@@ -98,7 +111,7 @@ module.exports = {
vendor: {
chunks: "all",
name: "vendor",
- test: /(react($|\/)|react-dom|tslib|react-textarea-autosize|react-icons)/,
+ test: /(react($|\/)|react-dom|tslib|react-textarea-autosize)/,
},
},
},