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

🧱 Implementing the new design system #2111

Draft
wants to merge 210 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
fdb25cc
Wrap stories in new theme.
ziggabyte Jun 28, 2024
6c39319
Create ZUIButton + story.
ziggabyte Jun 28, 2024
26b08a7
Create ZUIButtonGroup + story.
ziggabyte Jun 28, 2024
2e9f23a
Create ZUIStatusChip + story.
ziggabyte Jun 28, 2024
74be115
Create ZUIMenuItem + story.
ziggabyte Jun 28, 2024
941615b
Create ZUIMenuList + story.
ziggabyte Jun 28, 2024
08e2c92
Create ZUIMenu + story.
ziggabyte Jun 28, 2024
52eb60c
Adjust bottom border on date picker "icon and message".
ziggabyte Aug 5, 2024
b9f57af
Delete ZUIMenuItem component.
ziggabyte Aug 7, 2024
c89b4c2
Change ZUIMenu to take menu items as props instead of children.
ziggabyte Aug 7, 2024
9dc5acb
Update ZUIMenuList to take menu items as props instead of children.
ziggabyte Aug 7, 2024
c900416
Make type optional in ZUIButtonGroup and default to secondary.
ziggabyte Aug 7, 2024
3f72406
Change prop type from ReactNode to JSX Element.
ziggabyte Aug 7, 2024
6696c39
Add things together in ZUIHeader component with story.
ziggabyte Aug 8, 2024
20f3765
Add an optional avatar to the header.
ziggabyte Aug 8, 2024
78a69d9
Align the different parts of the header.
ziggabyte Aug 8, 2024
3fd2055
Change small styling of buttons with only icons in them.
ziggabyte Aug 8, 2024
cf458e1
Create ZUIBreadcrumbs component + story.
ziggabyte Aug 9, 2024
80bd937
Add breadcrumbs to the header.
ziggabyte Aug 9, 2024
0585493
Refactor logic in ZUIBreadcrumbs to simplify data structure.
ziggabyte Aug 12, 2024
a96db9f
Remove boxshadow on primary action buttons.
ziggabyte Aug 12, 2024
96c5247
Make storybook stories better.
ziggabyte Aug 13, 2024
3ccf240
Make start icon required in ellipsis- and action button menus + send …
ziggabyte Aug 13, 2024
69426c5
Further improve the storybook stories.
ziggabyte Aug 13, 2024
44b3715
Update styles of the Breadcrumb widget.
ziggabyte Aug 15, 2024
2b32ccd
Update styles of ZUIButton.
ziggabyte Aug 15, 2024
adb24be
Update styling of the metadata.
ziggabyte Aug 15, 2024
560893b
Update menu stories to include more examples + update interface of ZU…
ziggabyte Aug 16, 2024
92d71d5
Update style of ZUIStatusChip.
ziggabyte Aug 16, 2024
9a87242
Add elevation to new theme and use in ZUIMenu.
ziggabyte Aug 16, 2024
da86eac
Add icons to the breadcrumbs list.
ziggabyte Aug 16, 2024
d40dce3
Add link to show extra items.
ziggabyte Aug 16, 2024
fa15145
Remove unused class.
ziggabyte Aug 16, 2024
2513de1
Remove smallScreen property for ZUIMenu
ziggabyte Aug 19, 2024
63acb74
Us href as identifier on breadcrumb items.
ziggabyte Aug 19, 2024
7b3e1aa
Change names of button properties.
ziggabyte Aug 19, 2024
a1896c5
Send in buttons as props instead of children.
ziggabyte Aug 19, 2024
f7e9e69
Separate buttons into text- and icon buttons, to eliminate having to …
ziggabyte Aug 19, 2024
1e6fdec
Remove label property from status chip, generate label based on statu…
ziggabyte Aug 19, 2024
9802299
Add new font and remove unused css classes.
ziggabyte Aug 19, 2024
824292b
Update styling according to comments.
ziggabyte Aug 20, 2024
2a6af6f
Change margin of divider.
ziggabyte Aug 22, 2024
f2625e1
Remove annoying little space.
ziggabyte Aug 23, 2024
8570197
Merge pull request #2101 from zetkin/undocumented/new-header
ziggabyte Aug 23, 2024
bdbb96c
ZUIText componet + story, with textstyles.
ziggabyte Aug 26, 2024
e01b45a
Correct typography and remove use of px in new ZUI components.
ziggabyte Aug 26, 2024
90cd17b
Remove use of px from new theme, move some styling from theme to ZUIB…
ziggabyte Aug 26, 2024
24ec79e
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Aug 26, 2024
1e8a7c1
wip for rebeca
ziggabyte Aug 28, 2024
99f62a8
Add test setup file to mock fetching the font.
ziggabyte Aug 28, 2024
3964141
Update text styles in the theme and add correct component and style i…
ziggabyte Aug 29, 2024
8e59b9e
Move text styles.
ziggabyte Aug 29, 2024
a2d6e6a
Remove end content from menu items.
ziggabyte Aug 29, 2024
916ec2c
complette new palette properties
rebecarubio Sep 2, 2024
b6c7722
update Palette and PaletteColor interfaces, add DataColor interface, …
rebecarubio Sep 2, 2024
0f3a741
remove mandatory properties from PaletteColor, add optional propertie…
rebecarubio Sep 2, 2024
7faca54
fix contrast colors, rename Data color properties, add divider hex co…
rebecarubio Sep 5, 2024
8cfa36b
rename Data color properties, add TODO comments
rebecarubio Sep 5, 2024
c0fd60d
Add test setup file to mock fetching the font and fix CI error
rebecarubio Sep 5, 2024
0b5dee2
add purple-neon color to the propierties that need to be removed
rebecarubio Sep 5, 2024
2981973
Change fontSize of icons in menus.
ziggabyte Sep 7, 2024
b7c69cb
add storybook/addon-docs package
rebecarubio Sep 9, 2024
0d1d922
add palette documentation in storybook
rebecarubio Sep 9, 2024
9750103
export palette const to use it in storybook documentation, add missin…
rebecarubio Sep 9, 2024
c2678a7
Break out links and labels into their own components.
ziggabyte Sep 11, 2024
02b974b
Use label text instead of body text in medium buttons.
ziggabyte Sep 11, 2024
0f02cb3
Merge pull request #2112 from zetkin/undocumented/new-font-and-typogr…
richardolsson Sep 11, 2024
600ef24
Merge pull request #2121 from zetkin/undocumented/new-colors
richardolsson Sep 11, 2024
f4142ff
Ignore storybook stories of non-desigsystem components.
richardolsson Sep 11, 2024
adc0b59
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Sep 27, 2024
59c5a12
start on ZUI progress bar
river-bbc Sep 28, 2024
2e5a86a
add size property
river-bbc Sep 28, 2024
1c07466
start on progress for "2 bar"
river-bbc Sep 28, 2024
ed2c64c
add extra small
lewis-conroy Sep 28, 2024
b959d25
height
lewis-conroy Sep 28, 2024
c5cc093
Create ZUI-divider
sarlinkle Sep 28, 2024
bffbda8
support multiple segments :p
lewis-conroy Sep 28, 2024
0683589
Added ZUI-divider
sarlinkle Sep 28, 2024
cad3e76
add colour gradient
lewis-conroy Sep 28, 2024
bdd6ecb
add docstring to progress parameter
lewis-conroy Sep 28, 2024
0f961da
add stories :p
lewis-conroy Sep 28, 2024
9032e90
Create ZUI-divider story
sarlinkle Sep 28, 2024
fe21586
fix little errors uwu
river-bbc Sep 28, 2024
5dbf90d
handle 0 progress with border radius
river-bbc Sep 28, 2024
0cb8e03
improve borderRadius and don't display segment if 0 width
river-bbc Sep 28, 2024
a60a9be
use flex grow
river-bbc Sep 28, 2024
c45fd95
reduce gap
river-bbc Sep 28, 2024
bfa71ee
handle 100 with border radius
river-bbc Sep 28, 2024
dbca429
fix eslint
river-bbc Sep 28, 2024
7368e74
Add ZUI tooltip component
Sep 28, 2024
c06dc81
rename everything to ZUIBarDiagram and make gaps size dependent
river-bbc Sep 28, 2024
e6d6cea
Fix vertical divider Storybook visibility
sarlinkle Sep 28, 2024
25193fa
Allow all MUI divider props on ZUIDivider
sarlinkle Sep 28, 2024
eabe1ca
Use proper children
Sep 28, 2024
397dc11
Lint fixes
Sep 28, 2024
22c2afc
Change from color to border color
sarlinkle Sep 28, 2024
611dfb1
add checkbox component with checked & size
owenboy9 Sep 28, 2024
f2db537
Fix linting error
sarlinkle Sep 28, 2024
2d6e16f
Create files for ZUIToggleButton
Sep 28, 2024
051f33f
did a thing
lewis-conroy Sep 28, 2024
2099cac
Split the very long glob into two, to solve bug where Vercel will not…
ziggabyte Sep 29, 2024
b082ea3
Merge branch 'undocumented/new-design-system' into undocumented/zui-c…
annafock Sep 29, 2024
fbd11ee
Render with Box enclosing so tooltip will fit
Sep 29, 2024
32f6ee4
change Story function to Story obj
annafock Sep 29, 2024
a2f0707
add docstring
river-bbc Sep 29, 2024
131921d
change to "values"
river-bbc Sep 29, 2024
4b7bd72
refactor to use mui
lewis-conroy Sep 29, 2024
a0854ba
add helpertext
lewis-conroy Sep 29, 2024
2df35af
lint :d
lewis-conroy Sep 29, 2024
5d34653
lint again sorry
lewis-conroy Sep 29, 2024
eb40e1e
Issue 2162: ZUI Badge initial creation
KraftKatten Sep 29, 2024
532e9bc
add onChange handler
lewis-conroy Sep 29, 2024
6a73ba7
add number or boolean to button value
lewis-conroy Sep 29, 2024
309ff37
add size parameter to checkbox
annafock Sep 29, 2024
0674198
Create ZUIToggleButton
Sep 29, 2024
d99447e
Add ZUISwitch component
Sep 29, 2024
234541d
add aria labels, change type names, make many props optional, use typ…
river-bbc Sep 29, 2024
f916ca9
Merge branch 'undocumented/new-design-system' into issue-2166/zui-pro…
river-bbc Sep 29, 2024
d2d1c37
Add example usecase in comment
Sep 29, 2024
4123d88
Merge branch 'undocumented/new-design-system' into issue-2170/zui-rad…
lewis-conroy Sep 29, 2024
c817926
Lint fixes
Sep 29, 2024
b2c3ef2
add todo to handle size large
annafock Sep 29, 2024
fd307c3
Merge pull request #2185 from zetkin/issue-2166/zui-progress-bar
ziggabyte Sep 30, 2024
c77c029
Change units from px or MUI to rem + remove "extra small" size option.
ziggabyte Sep 30, 2024
9df3ba0
Use colors from theme and modify color logic to match design.
ziggabyte Sep 30, 2024
ffa7c1a
Merge pull request #2208 from zetkin/issue-2162/zui-badge
ziggabyte Sep 30, 2024
1178300
Make color array logic a bit more clear.
ziggabyte Oct 1, 2024
10134c1
Merge pull request #2203 from sarlinkle/issue-2161/zui-divider
ziggabyte Oct 1, 2024
69b5440
Adjust name of divider property on palette to not conflict.
ziggabyte Oct 1, 2024
e4ae7d6
Refactor to limit props user can send in + update stories a bit.
ziggabyte Oct 1, 2024
78069d3
Merge pull request #2205 from zetkin/issue-2163/zui-tooltip
ziggabyte Oct 1, 2024
714a072
Remove ZUIDivider from create person.
ziggabyte Oct 1, 2024
bf56d2a
Update styles, stories and add documentation comments.
ziggabyte Oct 1, 2024
8b0ccff
Merge pull request #2221 from zetkin/undocumented/refactor-zui-bar-di…
ziggabyte Oct 2, 2024
81f8786
Refactor to add doc strings, minor styling changes and make it option…
ziggabyte Oct 2, 2024
bf67fd9
Properly change property name.
ziggabyte Oct 2, 2024
7bae2ba
Merge pull request #2216 from zetkin/issue-2170/zui-radio-group
ziggabyte Oct 2, 2024
0b66d50
Change styling of docstring.
ziggabyte Oct 3, 2024
6c97c3a
Merge pull request #2222 from zetkin/undocumented/refactor-zui-divider
ziggabyte Oct 3, 2024
5f13ab2
Change style of docstrings.
ziggabyte Oct 3, 2024
ed7b9ee
Show numbers smaller than 100 if truncateLargeNumbers is true.
ziggabyte Oct 3, 2024
9e6bad2
Change the styling of the docstrings.
ziggabyte Oct 3, 2024
58e6c21
Merge pull request #2223 from zetkin/undocumented/refactor-zui-tooltip
ziggabyte Oct 3, 2024
6f4d50e
Merge pull request #2225 from zetkin/undocumented/refactor-zui-badge
richardolsson Oct 3, 2024
1966ac8
Remove name property (MUI generates its own)
ziggabyte Oct 3, 2024
46a9b50
Update text styles, add docstrings, make it always controlled, remove…
ziggabyte Oct 3, 2024
f6efd2d
Merge pull request #2214 from zetkin/issue-2173/zui-switch
ziggabyte Oct 3, 2024
06d75a8
Add disabled property.
ziggabyte Oct 3, 2024
ad8b985
Update stories to include disabled example.
ziggabyte Oct 3, 2024
029cf86
Remove cryptic aria label.
ziggabyte Oct 3, 2024
9089ae8
Add label.
ziggabyte Oct 3, 2024
70f62e4
Make story consistent and update name of parameter.
ziggabyte Oct 3, 2024
86df5cf
Add property for label placement.
ziggabyte Oct 3, 2024
24d6289
Correct colors on labels.
ziggabyte Oct 3, 2024
61435c6
Merge pull request #2228 from zetkin/undocumented/refactor-zui-radiog…
ziggabyte Oct 4, 2024
bc23ccf
Pass all args to component
ziggabyte Oct 7, 2024
ddd9ea3
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Oct 7, 2024
0c8cd42
Merge pull request #2220 from owenboy9/undocumented/zui-checkbox
ziggabyte Oct 7, 2024
16ecc57
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Oct 7, 2024
a25ba8b
Match interface and look of checkbox component with ZUISwitch
ziggabyte Oct 7, 2024
e7469db
Make size property optional.
ziggabyte Oct 7, 2024
b181220
Add docstrings.
ziggabyte Oct 7, 2024
15d9de8
Create ZUICheckboxGroup with story.
ziggabyte Oct 8, 2024
ba7a65f
Create ZUISwitchGroup and story.
ziggabyte Oct 8, 2024
046177b
Make error in storybook a bit nicer for ZUICheckboxGroup
ziggabyte Oct 8, 2024
170e923
Improve the styling of disabled ZUIRadioGroup
ziggabyte Oct 8, 2024
34008e2
Merge pull request #2212 from ZebastianBjorkqvist/issue-2168/zui-togg…
ziggabyte Oct 8, 2024
4c90d7e
Small refactor of ZUIToggleButton and create story.
ziggabyte Oct 8, 2024
733ea4a
Add logic to make buttons display icons, and storybook story to show …
ziggabyte Oct 8, 2024
e6c1e5d
Merge pull request #2231 from zetkin/undocumented/refactor-zui-switch
richardolsson Oct 12, 2024
996f5bf
Merge pull request #2238 from zetkin/undocumented/refactor-zui-checkbox
richardolsson Oct 12, 2024
911d086
Merge pull request #2242 from zetkin/undocumented/zui-formgroup
richardolsson Oct 12, 2024
d11a05d
Remove empty file that was causing build to fail
richardolsson Oct 12, 2024
c0a5ed1
Merge branch 'main' into undocumented/new-design-system
richardolsson Oct 12, 2024
4635301
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Oct 13, 2024
097c7cd
Refactor styles and logic to match design.
ziggabyte Oct 13, 2024
96e8bcb
Merge branch 'main' into undocumented/new-design-system
WULCAN Oct 26, 2024
bedc809
Declare Story to be rendered instead of calling it
WULCAN Oct 26, 2024
78dae2a
Set main text color for hovered selected button.
ziggabyte Oct 26, 2024
84c2aac
Merge pull request #2259 from zetkin/undocumented/refactor-zui-toggle…
ziggabyte Oct 26, 2024
d33a23a
Update toggle button styles that somehow got overwritten.
ziggabyte Oct 26, 2024
6c19f66
Sort storybook stories into 2 categories, "old" and "new design syste…
ziggabyte Oct 26, 2024
45f15c1
Move all zui design system components into their own folder to make i…
ziggabyte Oct 26, 2024
1a0ba60
Merge pull request #2296 from zetkin/undocumented/jsx-story
ziggabyte Oct 28, 2024
a713fd2
Rename folder to "components" and move ZUICard component out of this …
ziggabyte Oct 30, 2024
88fe34b
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Oct 30, 2024
27f49a5
Add types.ts file for the new design system and use types in the comp…
ziggabyte Oct 30, 2024
8c258e2
Change name of the folders stories are displayed under in the storybo…
ziggabyte Oct 30, 2024
e2b4f81
Merge branch 'undocumented/new-design-system' of github.com:zetkin/ap…
ziggabyte Oct 30, 2024
1f8d14f
Create ZUIIcon component + story.
ziggabyte Oct 30, 2024
74f41c9
Merge pull request #2309 from zetkin/undocumented/design-system-types
richardolsson Oct 30, 2024
e239cfa
Fix the theme - give it types, make the palette fresh and new, put th…
ziggabyte Oct 30, 2024
6cc99a1
Merge pull request #2311 from zetkin/issue-2165/zui-icon
richardolsson Oct 30, 2024
24e3ec8
Correct styles on ZUIButton
ziggabyte Oct 31, 2024
c8c1746
Correct styles for tooltip.
ziggabyte Oct 31, 2024
661c62d
Correct style for toggle button.
ziggabyte Oct 31, 2024
f6549f0
Correct style on button group.
ziggabyte Oct 31, 2024
c553b07
Merge pull request #2316 from zetkin/undocumented/fix-new-theme
ziggabyte Nov 5, 2024
75331db
Give data colors human readable names in the contextualised palette.
ziggabyte Nov 8, 2024
a46e3af
Let user set icon colors, default to grey.
ziggabyte Nov 8, 2024
08d11de
Add docstrings to describe the props of the component.
ziggabyte Nov 8, 2024
52331bb
Merge pull request #2331 from zetkin/undocumented/zui-icon-colors
ziggabyte Nov 8, 2024
b41a5f6
Move to components folde + refactor theme use in bar diagram.
ziggabyte Nov 8, 2024
fda8cb9
Correctly place badge and bar diagram stories in the components cate…
ziggabyte Nov 8, 2024
a90d853
Update ZUIDivider story to clarify that fullWidht divider reaches the…
ziggabyte Nov 13, 2024
3f5388b
Address comments on ZUIRadioGroup
ziggabyte Nov 20, 2024
b68dd0b
Address comments on ZUICheckbox, which also solves comments on ZUIChe…
ziggabyte Nov 20, 2024
ff2cd2c
Address comments on ZUISwitch and ZUISwitchGroup.
ziggabyte Nov 21, 2024
3a91d5e
Refactor badges into two components, ZUIActivityStatusBadge and ZUIBa…
ziggabyte Nov 21, 2024
9c4bed1
Adjust ZUIIcon sizes.
ziggabyte Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

module.exports = {
staticDirs: ['../src'],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],

stories: [
'../src/**/*.mdx',
'../src/zui/!(ZUIAccessList|ZUIJourneyInstanceCard|ZUIAnimatedNumber|ZUIConfirmDialog|ZUIAutoTextArea|ZUICollapse|ZUIDate)/**/*.stories.@(js|jsx|ts|tsx)',
'../src/zui/!(ZUITimeline|ZUITextEditor|ZUIRelativeTime|ZUIReorderable|ZUISection|ZUIUserAvatar|ZUIDialog|ZUIEllipsisMenu|ZUIFileChip|ZUIJourneyInstanceItem|ZUIList|ZUILogo|ZUIPerson|ZUIPersonAvatar|ZUIPersonLink|ZUIPreviewableInput)/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand All @@ -23,6 +26,6 @@ module.exports = {
},

typescript: {
reactDocgen: 'react-docgen-typescript'
}
reactDocgen: 'react-docgen-typescript',
},
};
9 changes: 7 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Provider as ReduxProvider } from 'react-redux';
import { ThemeProvider } from '@mui/material';
import { useRouter } from 'next/router';

import theme from '../src/theme';
import newTheme from '../src/zui/theme';
import '../src/styles.css';
import mockPerson from '../src/utils/testing/mocks/mockPerson';
import createStore from '../src/core/store';
Expand Down Expand Up @@ -62,7 +62,7 @@ class MockApiClient extends FetchApiClient {

export const decorators = [
(Story) => (
<ThemeProvider theme={theme}>
<ThemeProvider theme={newTheme}>
<Story />
</ThemeProvider>
),
Expand All @@ -86,6 +86,11 @@ export const decorators = [
];

export const parameters = {
options: {
storySort: {
order: ['Components'],
},
},
nextjs: {
router: {
query: {
Expand Down
10 changes: 7 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
setupFiles: ['<rootDir>/src/utils/testing/setup.ts'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ["<rootDir>/integrationTesting/", "<rootDir>/node_modules/"],
testPathIgnorePatterns: [
'<rootDir>/integrationTesting/',
'<rootDir>/node_modules/',
],
transform: {
'^.+\\.tsx?$': ['babel-jest', { configFile: './.babelrc.jest.json'}],
'^.+\\.tsx?$': ['babel-jest', { configFile: './.babelrc.jest.json' }],
},
moduleDirectories: ['node_modules', 'src']
moduleDirectories: ['node_modules', 'src'],
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@nivo/pie": "^0.80.0",
"@nivo/radial-bar": "^0.80.0",
"@reduxjs/toolkit": "^1.8.6",
"@storybook/addon-docs": "^8.2.9",
"@types/dompurify": "^2.3.3",
"@types/mjml": "^4.7.4",
"copy-to-clipboard": "^3.3.1",
Expand Down
1 change: 0 additions & 1 deletion src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ body {

* {
box-sizing: border-box;
font-family: azo-sans-web, sans-serif;
}

blockquote {
Expand Down
273 changes: 224 additions & 49 deletions src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,16 @@
import type {} from '@mui/x-data-grid-pro/themeAugmentation';
import { createElement } from 'react';
import { createTheme } from '@mui/material/styles';
import { Figtree } from 'next/font/google';
import { Localization } from '@mui/x-data-grid/utils/getGridLocalization';
import { daDK, deDE, nbNO, svSE } from '@mui/x-data-grid-pro';

interface PaletteIntensityOptions {
disabled?: string;
high?: string;
medium?: string;
main?: string;
}
import { themePalette } from 'themePalette';

interface FilterCategoryColors {
pale: string;
strong: string;
}
//Font family
const figtree = Figtree({ subsets: ['latin-ext'] });

declare module '@mui/material/styles/createPalette' {
interface Palette {
onSurface: Required<PaletteIntensityOptions>;
outline: PaletteIntensityOptions;
filterCategoryColors: {
darkBlue: FilterCategoryColors;
green: FilterCategoryColors;
lightBlue: FilterCategoryColors;
orange: FilterCategoryColors;
pink: FilterCategoryColors;
purple: FilterCategoryColors;
red: FilterCategoryColors;
teal: FilterCategoryColors;
yellow: FilterCategoryColors;
};
statusColors: {
blue: string;
gray: string;
green: string;
orange: string;
red: string;
};
transparentGrey: {
light: string;
};
viewColumnGallery: {
blue: string;
purple: string;
red: string;
};
}
interface PaletteOptions {
onSurface: PaletteIntensityOptions;
outline: PaletteIntensityOptions;
}
}

const themePalette = {
const oldThemePalette = {
background: {
default: '#F9F9F9',
},
Expand Down Expand Up @@ -219,7 +176,7 @@ const theme = createTheme({
},
},
},
palette: themePalette,
palette: oldThemePalette,
typography: {
fontFamily: 'azo-sans-web, sans-serif',
h2: {
Expand All @@ -243,6 +200,224 @@ const theme = createTheme({
},
});

// The new theme.
export const newTheme = createTheme({
components: {
MuiButton: {
styleOverrides: {
root: {
'&.Mui-disabled': {
'&.MuiButton-containedError': {
backgroundColor: '#EE7B7B',
},
'&.MuiButton-containedPrimary': {
backgroundColor: '#5D5D5D',
color: '#B0B0B0',
},
'&.MuiButton-containedWarning': {
backgroundColor: '#FAED8E',
},
'&.MuiButton-outlinedPrimary': {
borderColor: '#B0B0B0',
color: '#888888',
},
'&.MuiButton-textPrimary': {
color: '#888888',
},
},
':hover': {
boxShadow: 'none',
},
boxShadow: 'none',
},
},
},
MuiButtonGroup: {
styleOverrides: {
root: {
boxShadow: 'none',
},
},
},
MuiCircularProgress: {
styleOverrides: {
root: {
color: '#B0B0B0',
},
},
},
MuiTooltip: {
styleOverrides: {
tooltip: {
fontSize: '0.625rem',
fontWeight: 600,
lineHeight: '0.875rem',
},
},
},
},
elevation: {
bottom: {
big: {
light: '0rem 0.25rem 2.5rem 0rem #00000014',
medium: '0rem 0.25rem 2.5rem 0rem #0000001F',
},
small: {
light: '0rem 0.25rem 1.25rem 0rem #00000014',
medium: '0rem 0.25rem 1.25rem 0rem #0000001F',
},
},
top: {
big: {
light: '0.rem -0.25rem 2.25rem 0rem #00000014',
medium: '0rem -0.25rem 2.25rem 0rem #0000001F',
},
small: {
light: '0rem -0.25rem 1.25rem 0rem #00000014',
medium: '0rem -0.25rem 1.25rem 0rem #0000001F',
},
},
},
palette: themePalette,
typography: {
body1: undefined,
body2: undefined,
bodyMdRegular: {
fontFamily: figtree.style.fontFamily,
fontSize: '1rem',
fontWeight: 300,
letterSpacing: '0.01rem',
lineHeight: '1.5rem',
},
bodyMdSemiBold: {
fontFamily: figtree.style.fontFamily,
fontSize: '1rem',
fontWeight: 500,
letterSpacing: '0.01rem',
lineHeight: '1.5rem',
},
bodySmRegular: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.875rem',
fontWeight: 300,
letterSpacing: '0.01rem',
lineHeight: '1.313rem',
},
bodySmSemiBold: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.875rem',
fontWeight: 500,
letterSpacing: '0.01rem',
lineHeight: '1.313rem',
},
button: {
fontWeight: 600,
textTransform: 'none',
},
caption: undefined,
fontFamily: figtree.style.fontFamily,
fontSize: 16,
h1: undefined,
h2: undefined,
h3: undefined,
h4: undefined,
h5: undefined,
h6: undefined,
headingLg: {
fontFamily: figtree.style.fontFamily,
fontSize: '1.375rem',
fontWeight: 400,
letterSpacing: '-0.005rem',
lineHeight: '1.788rem',
},
headingMd: {
fontFamily: figtree.style.fontFamily,
fontSize: '1.125rem',
fontWeight: 400,
letterSpacing: '-0.005rem',
lineHeight: '1.463rem',
},
headingSm: {
fontFamily: figtree.style.fontFamily,
fontSize: '1rem',
fontWeight: 400,
letterSpacing: '-0.005rem',
lineHeight: '1.3rem',
},
labelLgMedium: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.938rem',
fontWeight: 400,
letterSpacing: '0.03rem',
lineHeight: '1.406rem',
},
labelLgSemiBold: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.938rem',
fontWeight: 500,
letterSpacing: '0.03rem',
lineHeight: '1.406rem',
},
labelMdMedium: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.875rem',
fontWeight: 400,
letterSpacing: '0.03rem',
lineHeight: '1.313rem',
},
labelMdRegular: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.875rem',
fontWeight: 300,
letterSpacing: '0.03rem',
lineHeight: '1.313rem',
},
labelMdSemiBold: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.875rem',
fontWeight: 500,
letterSpacing: '0.03rem',
lineHeight: '1.313rem',
},
labelSmMedium: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.813rem',
fontWeight: 400,
letterSpacing: '0.03rem',
lineHeight: '1.219rem',
},
labelSmSemiBold: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.813rem',
fontWeight: 500,
letterSpacing: '0.03rem',
lineHeight: '1.219rem',
},
labelXlMedium: {
fontFamily: figtree.style.fontFamily,
fontSize: '1rem',
fontWeight: 400,
letterSpacing: '0.03rem',
lineHeight: '1.5rem',
},
linkMd: {
fontFamily: figtree.style.fontFamily,
fontSize: '1rem',
fontWeight: 300,
lineHeight: '1.5rem',
},
linkSm: {
fontFamily: figtree.style.fontFamily,
fontSize: '0.875rem',
fontWeight: 300,
lineHeight: '1.313rem',
},
overline: undefined,
subtitle1: undefined,
subtitle2: undefined,
},
});

const locales: Record<string, Localization> = {};
locales['da'] = daDK;
locales['de'] = deDE;
Expand Down
Loading