Skip to content

Commit

Permalink
ntp: stats feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Osbourne committed Oct 15, 2024
1 parent 0e81ff0 commit fdba2a4
Show file tree
Hide file tree
Showing 25 changed files with 722 additions and 359 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test-results/
playwright-report/
Sources/ContentScopeScripts/dist/
test-results
!Sources/ContentScopeScripts/dist/pages/.gitignore

# Local Netlify folder
.netlify
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
1 change: 1 addition & 0 deletions Sources/ContentScopeScripts/dist/pages/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion special-pages/messages/new-tab/examples/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ const privacyStatsData = {
/**
* @type {import("../../../types/new-tab").StatsConfig}
*/
const statsConfig = {
const minimumConfig = {
expansion: "expanded"
}

/**
* @type {import("../../../types/new-tab").StatsConfig}
*/
const withAnimation = {
expansion: "expanded",
animation: { kind: "view-transitions" }
}

export {}

39 changes: 39 additions & 0 deletions special-pages/messages/new-tab/types/animation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Animation",
"description": "Generic Animation configuration",
"oneOf": [
{
"title": "None",
"type": "object",
"required": ["kind"],
"properties": {
"kind": {
"const": "none"
}
}
},
{
"title": "View Transitions",
"description": "Use CSS view transitions where available",
"type": "object",
"required": ["kind"],
"properties": {
"kind": {
"const": "view-transitions"
}
}
},
{
"title": "Auto",
"description": "Use the auto-animate library to provide default animation styles",
"type": "object",
"required": ["kind"],
"properties": {
"kind": {
"const": "auto-animate"
}
}
}
]
}
3 changes: 2 additions & 1 deletion special-pages/messages/new-tab/types/stats-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "object",
"required": ["expansion"],
"properties": {
"expansion": {"$ref": "./expansion.json"}
"expansion": {"$ref": "./expansion.json"},
"animation": {"$ref": "./animation.json"}
}
}
2 changes: 2 additions & 0 deletions special-pages/pages/new-tab/app/components/App.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ body {
font-size: var(--body-font-size);
font-weight: var(--body-font-weight);
line-height: var(--body-line-height);
padding-left: var(--sp-6);
padding-right: var(--sp-6);
}

.layout {
Expand Down
11 changes: 11 additions & 0 deletions special-pages/pages/new-tab/app/components/Chevron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { h } from 'preact'

export function Chevron () {
return (
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 10L8 4.5L2.5 10" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
)
}
Loading

0 comments on commit fdba2a4

Please sign in to comment.