Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Admin UI #4223

Draft
wants to merge 40 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1a6fddb
wip: new admin ui
adrians5j Jul 19, 2024
3b61dd4
wip: initial setup
adrians5j Aug 8, 2024
9135b01
wip: initial setup
adrians5j Aug 9, 2024
f78ad52
wip: initial setup
adrians5j Aug 9, 2024
1751308
wip: initial setup
adrians5j Aug 9, 2024
d35acd8
Merge remote-tracking branch 'refs/remotes/origin/next' into feat/new…
adrians5j Aug 9, 2024
a85c3cf
wip: initial setup
adrians5j Aug 9, 2024
9b36dd2
wip: initial setup
adrians5j Aug 9, 2024
094769e
wip: initial setup
adrians5j Aug 9, 2024
3abe28b
fix: update dependencies
adrians5j Aug 12, 2024
7508097
wip: initial setup
adrians5j Aug 12, 2024
c90e696
wip: initial setup
adrians5j Aug 12, 2024
8e0e758
wip: multiple chores
leopuleo Aug 13, 2024
fb09a61
wip: multiple chores
leopuleo Aug 13, 2024
7b7d761
wip: add backup ui-old package
leopuleo Aug 15, 2024
d0036b8
wip: add admin-ui empty package
leopuleo Aug 15, 2024
0bcdb64
chore: add ui-new to ui package
leopuleo Aug 21, 2024
93700d1
feat(admin-ui): handle typography - add Heading and Text components …
leopuleo Aug 21, 2024
cbe7267
chore: merge next
leopuleo Aug 26, 2024
3bf730e
fix: switch to `@webiny/admin-ui` package (#4238)
adrians5j Aug 26, 2024
9cb5f26
fix: update dependencies
adrians5j Aug 26, 2024
eb7cb72
New Admin UI - Circular Progress (#4236)
adrians5j Aug 27, 2024
4c1309f
fix: remove tsconfig-paths-webpack-plugin
leopuleo Aug 27, 2024
782ddfe
chore: upgrade typescript
leopuleo Aug 27, 2024
a24efba
chore: export type and makeDecoratable
leopuleo Aug 30, 2024
0975a4a
feat(admin-ui): Tooltip component (#4239)
leopuleo Sep 2, 2024
9789408
feat(admin-ui): Tabs component (#4242)
leopuleo Sep 2, 2024
3b4d2a5
feat: create Button component (#4233)
adrians5j Sep 2, 2024
c30d259
chore: remove unused components
leopuleo Sep 3, 2024
0a1f728
docs: use component name
leopuleo Sep 3, 2024
0b18d65
feat(admin-ui): Label and Switch components (#4243)
leopuleo Sep 3, 2024
aca3c76
feat: create Elevation, Icon, and Card Components (#4244)
adrians5j Sep 5, 2024
6d3c83c
feat(admin-ui): remove Ripple component (#4250)
leopuleo Sep 5, 2024
01307c3
fix(admin-ui): admin ui branches build (#4256)
leopuleo Sep 10, 2024
67b5059
Merge branch 'refs/heads/next' into feat/new-admin-ui
leopuleo Sep 10, 2024
3474574
feat: upgrade to react 18.3.1
brunozoric Sep 12, 2024
dd669af
Merge remote-tracking branch 'refs/remotes/origin/bruno/feat/upgrade-…
adrians5j Sep 24, 2024
935fe2b
chore: run prettier
adrians5j Sep 24, 2024
a436929
merge: upgrade to React 18.3.1 (#4290)
adrians5j Sep 25, 2024
dba63f5
docs: added the Welcome page for the Design System (Storybook) (#4268)
swapnilmmane Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ jobs:
- name: Run tests
run: yarn test ${{ matrix.package.cmd }}
working-directory: ${{ github.base_ref }}
if: github.base_ref != 'feat/new-admin-ui'
jestTestsDdb:
needs:
- constants
Expand Down Expand Up @@ -268,6 +269,7 @@ jobs:
- name: Run tests
run: yarn test ${{ matrix.package.cmd }}
working-directory: ${{ github.base_ref }}
if: github.base_ref != 'feat/new-admin-ui'
jestTestsDdbEs:
needs:
- constants
Expand Down Expand Up @@ -338,7 +340,9 @@ jobs:
working-directory: ${{ github.base_ref }}
permissions:
id-token: write
if: needs.constants.outputs.is-fork-pr != 'true'
if: >-
github.base_ref != 'feat/new-admin-ui' &&
needs.constants.outputs.is-fork-pr != 'true'
jestTestsDdbOs:
needs:
- constants
Expand Down Expand Up @@ -409,7 +413,9 @@ jobs:
working-directory: ${{ github.base_ref }}
permissions:
id-token: write
if: needs.constants.outputs.is-fork-pr != 'true'
if: >-
github.base_ref != 'feat/new-admin-ui' &&
needs.constants.outputs.is-fork-pr != 'true'
verdaccioPublish:
name: Publish to Verdaccio
needs:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/wac/pullRequests.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ const createJestTestsJob = (storage: string | null) => {
]
});

// We prevent running of Jest tests if a PR was created from a fork.
// This is because we don't want to expose our AWS credentials to forks.
// Temporary disabling Jest tests on PRs that target the "feat/new-admin-ui" branch.
// No need to run the for now. We'll re-enable them if needed in the future.
job.if = "github.base_ref != 'feat/new-admin-ui'";

if (storage === "ddb-es" || storage === "ddb-os") {
job.if = "needs.constants.outputs.is-fork-pr != 'true'";
job.if += " && needs.constants.outputs.is-fork-pr != 'true'";
}

return job;
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ schema.graphql
.pnp.*
lerna.json
.stormTests
*storybook.log

# TODO remove after moving traffic splitting config to WPC
gateway.*.json
Expand Down
6 changes: 3 additions & 3 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@editorjs/list": "^1.6.0",
"@editorjs/quote": "^2.4.0",
"@editorjs/underline": "^1.0.0",
"@types/react": "18.2.79",
"@types/react": "18.3.5",
"@webiny/app-admin": "0.0.0",
"@webiny/app-admin-users-cognito": "0.0.0",
"@webiny/app-form-builder": "0.0.0",
Expand All @@ -22,8 +22,8 @@
"core-js": "^3.0.1",
"cross-fetch": "^3.0.4",
"prop-types": "^15.7.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"regenerator-runtime": "^0.13.5",
"theme": "^1.0.0",
"tslib": "^2.4.0"
Expand Down
102 changes: 87 additions & 15 deletions apps/admin/src/App.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,88 @@
// Webiny theme variables
// $webiny-theme-light-primary: #fa5723;
// $webiny-theme-light-secondary: #00ccb0;
// $webiny-theme-light-background: #f2f2f2;
// $webiny-theme-light-surface: #fff;
// $webiny-theme-light-on-primary: #ffffff;
// $webiny-theme-light-on-secondary: #ffffff;
// $webiny-theme-light-on-surface: #000000;
// $webiny-theme-light-on-background: rgba(212, 212, 212, 0.5);
// $webiny-theme-light-text-primary-on-background: rgba(0, 0, 0, 0.87);
// $webiny-theme-light-text-secondary-on-background: rgba(0, 0, 0, 0.54);
// $webiny-theme-light-text-hint-on-dark: rgba(255, 255, 255, 0.5);
// $webiny-theme-typography-font-family: "Source Sans Pro";

// Import main styles
// OLD
@import "~@webiny/app-serverless-cms/styles.scss";

// NEW
@import "~@webiny/admin-ui/styles.scss";

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;

--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;

--primary: 14.5 95.6% 55.9%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;

--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;

--ring: 215 20.2% 65.1%;

--radius: 8px;

--font-sans: "Inter", "Source Sans Pro", "Open Sans", sans-serif;
}

.dark {
--background: 224 71% 4%;
--foreground: 213 31% 91%;

--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 56.9%;

--accent: 216 34% 17%;
--accent-foreground: 210 40% 98%;

--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 65.1%;

--border: 216 34% 17%;
--input: 216 34% 17%;

--card: 224 71% 4%;
--card-foreground: 213 31% 91%;

--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 1.2%;

--secondary: 222.2 47.4% 11.2%;
--secondary-foreground: 210 40% 98%;

--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;

--ring: 216 34% 17%;

--radius: 8px;
}
}

@layer base {
* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}
6 changes: 3 additions & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@emotion/react": "^11.10.6",
"@types/react": "18.2.79",
"@types/react": "18.3.5",
"@webiny/app": "0.0.0",
"@webiny/app-form-builder": "0.0.0",
"@webiny/app-page-builder": "0.0.0",
Expand All @@ -20,8 +20,8 @@
"cross-fetch": "^3.0.4",
"graphql": "^15.7.2",
"graphql-tag": "^2.12.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"regenerator-runtime": "^0.13.5",
"theme": "^1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@webiny/utils": "0.0.0",
"@webiny/validation": "0.0.0",
"graphql": "^15.7.2",
"react": "18.2.0",
"react": "18.3.1",
"react-hamburger-menu": "^1.1.1"
},
"devDependencies": {
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@types/jest": "^29.5.11",
"@types/node": "^18.0.0",
"@types/prettier": "^2.7.3",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"@types/react": "18.3.5",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"adio": "^1.0.1",
Expand Down Expand Up @@ -153,7 +153,8 @@
"verdaccio:start:detached": "yarn pm2 start \"yarn verdaccio:start\"",
"webiny": "./node_modules/.bin/webiny",
"wby": "./node_modules/.bin/wby",
"webiny-ui-build-storybook": "cd packages/ui && cross-env OUT=../../netlify-static yarn build-storybook"
"webiny-admin-storybook": "cd packages/admin-ui && yarn storybook",
"webiny-admin-build-storybook": "cd packages/admin-ui && cross-env OUT=../../netlify-static yarn build-storybook"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -209,11 +210,11 @@
"@types/webpack": "^5.28.0",
"browserify-sign": "^4.2.2",
"@babel/traverse": "^7.24.0",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"@types/react": "18.3.5",
"@types/react-dom": "18.3.0",
"jsdom": "24.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"follow-redirects": "^1.15.6",
"crypto-js": "^4.2.0",
"ip": "^2.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@webiny/project-utils").createBabelConfigForReact({ path: __dirname });
114 changes: 114 additions & 0 deletions packages/admin-ui/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
import path from "path";
import tailwindcss from "tailwindcss";

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return path.dirname(require.resolve(path.join(value, "package.json")));
}

const config: StorybookConfig = {
stories: ["../docs/stories/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
staticDirs: ["../assets"],
addons: [
getAbsolutePath("@storybook/addon-a11y"),
{
name: "@storybook/addon-essentials",
options: {
controls: true,
code: true
}
}
],
framework: {
name: getAbsolutePath("@storybook/react-webpack5"),
options: {}
},
core: {
disableTelemetry: true,
disableWhatsNewNotifications: true
},
webpackFinal: async config => {
config.resolve = config.resolve || {};
config.resolve.alias = {
...config.resolve.alias,
"~": path.resolve(__dirname, "../src")
};

// Add custom style handling
config.module?.rules?.push({
test: /\.s[ac]ss$/i,
use: [
"style-loader",
{
loader: "css-loader",
options: {
importLoaders: 1
}
},
{
loader: "postcss-loader",
options: {
postcssOptions: {
plugins: [
tailwindcss({
config: path.join(__dirname, "../tailwind.config.js")
})
]
}
}
},
{
loader: "sass-loader",
options: { implementation: require.resolve("sass") }
}
]
});

// Add SVG handling
const svgRule = config.module?.rules?.find(rule => {
const test = (rule as { test: RegExp }).test;
return test ? test.test(".svg") : false;
}) as { [key: string]: any };

if (svgRule) {
svgRule.exclude = /\.svg$/;
}

config.module?.rules?.push({
test: /\.svg$/i,
use: [
{
loader: "@svgr/webpack",
options: {
svgoConfig: {
plugins: [
{
name: "preset-default",
params: {
overrides: {
removeViewBox: false
}
}
}
]
}
}
},
{
loader: "file-loader",
options: {
name: "[name].[hash].[ext]"
}
}
]
});

return config;
}
};

export default config;
11 changes: 11 additions & 0 deletions packages/admin-ui/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Preview } from "@storybook/react";

import "../src/styles.scss";

const preview: Preview = {
parameters: {
layout: "centered"
}
};

export default preview;
Loading