diff --git a/special-pages/pages/new-tab/app/components/App.module.css b/special-pages/pages/new-tab/app/components/App.module.css
index b1f6c7b0d..fe88227a9 100644
--- a/special-pages/pages/new-tab/app/components/App.module.css
+++ b/special-pages/pages/new-tab/app/components/App.module.css
@@ -23,5 +23,11 @@ body:has([data-reset-layout="true"]) .layout {
:global(.layout-centered) {
margin-inline: auto;
+ width: 100%;
max-width: calc(504 * var(--px-in-rem));
}
+
+/** Don't affect layout if empty (eg: if a widget was toggled) **/
+:global(.layout-centered:empty) {
+ display: contents;
+}
diff --git a/special-pages/pages/new-tab/app/components/Components.jsx b/special-pages/pages/new-tab/app/components/Components.jsx
index 2679f3a56..a5e5f749e 100644
--- a/special-pages/pages/new-tab/app/components/Components.jsx
+++ b/special-pages/pages/new-tab/app/components/Components.jsx
@@ -1,19 +1,27 @@
import { Fragment, h } from "preact";
import styles from "./Components.module.css";
import { mainExamples, otherExamples } from "./Examples.jsx";
+import { updateNotificationExamples } from "../update-notification/UpdateNotification.examples.js";
const url = new URL(window.location.href);
+const list = {
+ ...mainExamples,
+ ...otherExamples,
+ ...updateNotificationExamples
+}
+
+const entries = Object.entries(list);
+
export function Components() {
const ids = url.searchParams.getAll("id");
const isolated = url.searchParams.has("isolate");
const e2e = url.searchParams.has("e2e");
- const entries = Object.entries(mainExamples).concat(Object.entries(otherExamples));
const entryIds = entries.map(([id]) => id);
const validIds = ids.filter(id => entryIds.includes(id));
const filtered = validIds.length
- ? validIds.map((id) => /** @type {const} */([id, mainExamples[id] || otherExamples[id]]))
+ ? validIds.map((id) => /** @type {const} */([id, list[id]]))
: entries
if (isolated) {
diff --git a/special-pages/pages/new-tab/app/components/Components.module.css b/special-pages/pages/new-tab/app/components/Components.module.css
index b4a962521..d66a9da90 100644
--- a/special-pages/pages/new-tab/app/components/Components.module.css
+++ b/special-pages/pages/new-tab/app/components/Components.module.css
@@ -1,9 +1,4 @@
/* nested styles to avoid global side-effects */
-[data-display="components"] {
- a {
- color: var(--ntp-text-normal);
- }
-}
body[data-display="components"] {
padding-left: 0;
@@ -35,7 +30,9 @@ body[data-display="components"] {
align-items: center;
gap: 1em;
}
+
.itemLink {
+ color: var(--ntp-text-normal);
padding: 0.2em 0.3em;
border: 1px solid var(--color-gray-60);
border-radius: 4px;
diff --git a/special-pages/pages/new-tab/app/components/Layout.js b/special-pages/pages/new-tab/app/components/Layout.js
new file mode 100644
index 000000000..f3aeecea7
--- /dev/null
+++ b/special-pages/pages/new-tab/app/components/Layout.js
@@ -0,0 +1,9 @@
+import { h } from 'preact'
+
+export function Centered ({ children }) {
+ return (
+
+ {children}
+
+ )
+}
diff --git a/special-pages/pages/new-tab/app/entry-points/favorites.js b/special-pages/pages/new-tab/app/entry-points/favorites.js
index 9c9095694..7ca6addc6 100644
--- a/special-pages/pages/new-tab/app/entry-points/favorites.js
+++ b/special-pages/pages/new-tab/app/entry-points/favorites.js
@@ -1,8 +1,11 @@
import { h } from 'preact'
import { FavoritesCustomized } from '../favorites/Favorites.js'
+import { Centered } from '../components/Layout.js'
export function factory () {
return (
-
+
+
+
)
}
diff --git a/special-pages/pages/new-tab/app/entry-points/privacyStats.js b/special-pages/pages/new-tab/app/entry-points/privacyStats.js
index 2cb6cf3d0..c550f95fd 100644
--- a/special-pages/pages/new-tab/app/entry-points/privacyStats.js
+++ b/special-pages/pages/new-tab/app/entry-points/privacyStats.js
@@ -1,8 +1,11 @@
import { h } from 'preact'
import { PrivacyStatsCustomized } from '../privacy-stats/PrivacyStats.js'
+import { Centered } from '../components/Layout.js'
export function factory () {
return (
-
+
+
+
)
}
diff --git a/special-pages/pages/new-tab/app/entry-points/rmf.js b/special-pages/pages/new-tab/app/entry-points/rmf.js
index 52bfddd4b..49df96912 100644
--- a/special-pages/pages/new-tab/app/entry-points/rmf.js
+++ b/special-pages/pages/new-tab/app/entry-points/rmf.js
@@ -1,11 +1,14 @@
import { h } from 'preact'
+import { Centered } from '../components/Layout.js'
import { RMFConsumer } from '../remote-messaging-framework/RemoteMessagingFramework.js'
import { RMFProvider } from '../remote-messaging-framework/RMFProvider.js'
export function factory () {
return (
-
-
-
+
+
+
+
+
)
}
diff --git a/special-pages/pages/new-tab/app/favorites/Favorites.js b/special-pages/pages/new-tab/app/favorites/Favorites.js
index 1a4dc55cf..33062d5fa 100644
--- a/special-pages/pages/new-tab/app/favorites/Favorites.js
+++ b/special-pages/pages/new-tab/app/favorites/Favorites.js
@@ -15,8 +15,6 @@ export function FavoritesCustomized () {
return null
}
return (
-
-
Favourites here... (id: {id}
)
-
+ Favourites here... (id: {id}
)
)
}
diff --git a/special-pages/pages/new-tab/app/privacy-stats/PrivacyStats.js b/special-pages/pages/new-tab/app/privacy-stats/PrivacyStats.js
index cdbd6f588..2b30462c3 100644
--- a/special-pages/pages/new-tab/app/privacy-stats/PrivacyStats.js
+++ b/special-pages/pages/new-tab/app/privacy-stats/PrivacyStats.js
@@ -1,5 +1,4 @@
import { h } from 'preact'
-import cn from 'classnames'
import styles from './PrivacyStats.module.css'
import { useTypedTranslation } from '../types.js'
import { useContext, useState, useId, useCallback } from 'preact/hooks'
@@ -63,7 +62,7 @@ function PrivacyStatsConfigured ({ parentRef, expansion, data, toggle }) {
const TOGGLE_ID = useId()
return (
-
+
+
{messageType !== 'small' && message.icon && (
diff --git a/special-pages/pages/new-tab/app/update-notification/UpdateNotification.examples.js b/special-pages/pages/new-tab/app/update-notification/UpdateNotification.examples.js
new file mode 100644
index 000000000..892f0cd2f
--- /dev/null
+++ b/special-pages/pages/new-tab/app/update-notification/UpdateNotification.examples.js
@@ -0,0 +1,24 @@
+import { h } from 'preact'
+import { UpdateNotification } from './UpdateNotification.js'
+import { noop } from '../utils.js'
+
+export const updateNotificationExamples = {
+ empty: {
+ factory: () => {
+ return
+ }
+ },
+ populated: {
+ factory: () => {
+ return
+ }
+ }
+}
diff --git a/special-pages/pages/new-tab/app/update-notification/UpdateNotification.module.css b/special-pages/pages/new-tab/app/update-notification/UpdateNotification.module.css
index 47d54cbf4..c75f2675a 100644
--- a/special-pages/pages/new-tab/app/update-notification/UpdateNotification.module.css
+++ b/special-pages/pages/new-tab/app/update-notification/UpdateNotification.module.css
@@ -19,6 +19,7 @@
width: 100%;
}
.inlineLink {
+ color: var(--color-blue-50);
text-decoration: none;
&:focus-visible {
text-decoration: underline;