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

♻️ Refactor/utrechttheme-package #265

Draft
wants to merge 7 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
693 changes: 610 additions & 83 deletions pwa/package-lock.json

Large diffs are not rendered by default.

33 changes: 27 additions & 6 deletions pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18",
"@gemeente-denhaag/components-react": "^0.1.1-alpha.239",
"@gemeente-denhaag/design-tokens-components": "^0.2.3-alpha.301",
"@gemeente-denhaag/form-field": "^0.1.1-alpha.177",
"@gemeente-denhaag/alert": "0.1.1-alpha.279",
"@gemeente-denhaag/button": "0.2.3-alpha.309",
"@gemeente-denhaag/divider": "0.2.3-alpha.309",
"@gemeente-denhaag/form-field": "0.1.1-alpha.185",
"@gemeente-denhaag/icons": "0.2.3-alpha.309",
"@gemeente-denhaag/process-steps": "^0.1.0-alpha.130",
"@gemeente-denhaag/sidenav": "^0.1.0-alpha.119",
"@gemeente-denhaag/tab": "0.2.3-alpha.309",
"@gemeente-denhaag/table": "^0.1.1-alpha.203",
"@gemeente-denhaag/textarea": "^0.1.1-alpha.174",
"@gemeente-denhaag/typography": "0.2.3-alpha.309",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@utrecht/component-library-css": "^1.0.0-alpha.487",
"axios": "^0.25.0",
"clsx": "^1.1.1",
"dateformat": "^5.0.3",
Expand Down Expand Up @@ -72,7 +77,7 @@
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@utrecht/component-library-react": "1.0.0-alpha.283",
"@utrecht/design-tokens": "1.0.0-alpha.467",
"@utrecht/design-tokens": "^1.0.0-alpha.467",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-react": "^7.32.2",
Expand All @@ -83,11 +88,15 @@
"typescript": "^4.6.3"
},
"overrides": {
"@gemeente-denhaag/components-react": {
"@gemeente-denhaag/alert": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/process-steps": {
"@gemeente-denhaag/button": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/divider": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
Expand All @@ -99,10 +108,22 @@
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/icons": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/sidenav": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/process-steps": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/tab": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
},
"@gemeente-denhaag/table": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
Expand Down
4 changes: 2 additions & 2 deletions pwa/src/components/applicationCard/ApplicationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";
import * as styles from "./ApplicationCard.module.css";
import { Paragraph } from "@gemeente-denhaag/components-react";
import { Paragraph } from "@gemeente-denhaag/typography";
import { Icon } from "@utrecht/component-library-react/dist/css-module";
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faHouse, faLaptopCode } from "@fortawesome/free-solid-svg-icons";
import { ToolTip } from "../toolTip/ToolTip";
import { useTranslation } from "react-i18next";
import { Tag } from "@conduction/components";
import { Tag } from "@conduction/components/lib/components/tag/Tag";
import { Link } from "../../components";

export interface ApplicationCardProps {
Expand Down
3 changes: 2 additions & 1 deletion pwa/src/components/categoryCard/CategoryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";
import * as styles from "./CategoryCard.module.css";
import { Divider, Paragraph } from "@gemeente-denhaag/components-react";
import { Divider } from "@gemeente-denhaag/divider";
import { Paragraph } from "@gemeente-denhaag/typography";
import { Icon } from "@utrecht/component-library-react/dist/css-module";
import { Link } from "../link/Link";

Expand Down
4 changes: 2 additions & 2 deletions pwa/src/components/componentCard/ComponentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import * as styles from "./ComponentCard.module.css";
import { Paragraph } from "@gemeente-denhaag/components-react";
import { Paragraph } from "@gemeente-denhaag/typography";
import { Icon } from "@utrecht/component-library-react/dist/css-module";
import _ from "lodash";
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
Expand All @@ -10,7 +10,7 @@ import { GitHubLogo } from "../../assets/svgs/GitHub";
import { ToolTip } from "../toolTip/ToolTip";
import { categories as _categories, TCategories } from "../../data/categories";
import { useTranslation } from "react-i18next";
import { Tag } from "@conduction/components";
import { Tag } from "@conduction/components/lib/components/tag/Tag";
import { Link } from "../../components";

export interface ComponentCardProps {
Expand Down
4 changes: 2 additions & 2 deletions pwa/src/components/organizationCard/OrganizationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import * as styles from "./OrganizationCard.module.css";
import { Paragraph } from "@gemeente-denhaag/components-react";
import { Paragraph } from "@gemeente-denhaag/typography";
import { Icon } from "@utrecht/component-library-react/dist/css-module";
import { navigate } from "gatsby";
import _ from "lodash";
Expand All @@ -12,7 +12,7 @@ import { GitLabLogo } from "../../assets/svgs/GitLab";
import { ToolTip } from "../toolTip/ToolTip";
import { useTranslation } from "react-i18next";
import clsx from "clsx";
import { Tag } from "@conduction/components";
import { Tag } from "@conduction/components/lib/components/tag/Tag";
import { Link } from "../../components";

export interface OrganizationCardProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import * as styles from "./ResultsDisplaySwitch.module.css";
import { Button } from "@gemeente-denhaag/components-react";
import { Button } from "@gemeente-denhaag/button";
import { useTranslation } from "react-i18next";
import { FiltersContext } from "../../context/filters";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
Expand Down
1 change: 0 additions & 1 deletion pwa/src/layout/Head.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from "react";
import "../styling/index.css";
import { Helmet } from "react-helmet";

export const Head: React.FC = () => {
Expand Down
26 changes: 13 additions & 13 deletions pwa/src/styling/design-tokens/component-overrides.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:root {
.conduction-theme {
--web-app-link-icon-gap: 0.3em;

--conduction-secondary-top-nav-item-padding: var(--web-app-secondary-top-nav-item-padding);
Expand All @@ -21,7 +21,7 @@
--denhaag-focus-border: var(--web-app-focus-border);
--denhaag-heading-line-height: var(--web-app-line-height-md);
--denhaag-heading-color: var(--web-app-color-heading);
--utrecht-heading-font-weight: var(--web-app-font-weight-bold);
/* --utrecht-heading-font-weight: var(--web-app-font-weight-bold);
--utrecht-heading-font-family: var(--web-app-primary-font-family);
--utrecht-heading-color: var(--web-app-color-primary-text);
--utrecht-heading-5-font-size: var(--web-app-font-size-md);
Expand All @@ -38,28 +38,28 @@
--utrecht-paragraph-font-weight: var(--web-app-font-weight-normal);
--utrecht-paragraph-font-size: var(--web-app-font-size-md);
--utrecht-paragraph-font-family: var(--web-app-content-font-family);
--utrecht-paragraph-color: var(--web-app-color-primary-text);
--utrecht-paragraph-color: var(--web-app-color-primary-text); */

--denhaag-button-secondary-action-disabled-color: var(--web-app-color-disabled);
--denhaag-button-secondary-action-disabled-border-color: var(--web-app-color-disabled);
--denhaag-button-secondary-action-disabled-background-color: var(--web-app-color-white);
--utrecht-button-secondary-action-disabled-color: var(--web-app-color-disabled);
/* --utrecht-button-secondary-action-disabled-color: var(--web-app-color-disabled);
--utrecht-button-secondary-action-disabled-border-color: var(--web-app-color-disabled);
--utrecht-button-secondary-action-disabled-background-color: var(--web-app-color-white);
--utrecht-button-secondary-action-disabled-background-color: var(--web-app-color-white); */

--denhaag-button-secondary-action-hover-color: var(--web-app-color-secondary-action-hover);
--denhaag-button-secondary-action-hover-border-color: var(--web-app-color-secondary-action-hover);
--denhaag-button-secondary-action-hover-background-color: var(--web-app-color-white);
--denhaag-button-secondary-action-border-color: var(--web-app-color-secondary-action);
--denhaag-button-secondary-action-color: var(--web-app-color-secondary-action);
--denhaag-button-secondary-action-background-color: var(--web-app-color-white);
--utrecht-button-secondary-action-hover-border-color: var(--web-app-color-secondary-action-hover);
/* --utrecht-button-secondary-action-hover-border-color: var(--web-app-color-secondary-action-hover);
--utrecht-button-secondary-action-hover-color: var(--web-app-color-secondary-action-hover);
--utrecht-button-secondary-action-hover-background-color: var(--web-app-color-white);
--utrecht-button-secondary-action-border-color: var(--web-app-color-secondary-action);
--utrecht-button-secondary-action-color: var(--web-app-color-secondary-action);
--utrecht-button-secondary-action-background-color: var(--web-app-color-white);
--utrecht-button-secondary-action-border-width: var(--web-app-border-radius-md);
--utrecht-button-secondary-action-border-width: var(--web-app-border-radius-md); */

--denhaag-button-large-size-padding-block: var(--web-app-size-xs);
--denhaag-button-border-width: var(--web-app-size-4xs);
Expand All @@ -79,7 +79,7 @@
--denhaag-button-medium-size-padding-inline: var(--denhaag-button-padding-inline);
--denhaag-button-medium-size-padding-block: var(--denhaag-button-padding-block);
--denhaag-button-focus-border-color: var(--web-app-focus-border-color);
--utrecht-button-disabled-color: var(--web-app-color-white);
/* --utrecht-button-disabled-color: var(--web-app-color-white);
--utrecht-button-disabled-background-color: var(--web-app-color-disabled);
--utrecht-button-focus-border-width: var(--web-app-focus-border-width);
--utrecht-button-primary-action-hover-color: var(--web-app-color-white);
Expand All @@ -98,7 +98,7 @@
--utrecht-button-padding-block-start: var(--web-app-size-sm);
--utrecht-button-padding-inline-end: var(--web-app-size-md);
--utrecht-button-padding-inline-start: var(--web-app-size-md);
--utrecht-button-border-width: 0;
--utrecht-button-border-width: 0; */

/* --denhaag-link-focus-outline: var(--web-app-focus-border); */
--denhaag-link-disabled-color: var(--web-app-color-disabled);
Expand All @@ -110,10 +110,10 @@
--denhaag-link-icon-margin-end: var(--web-app-size-xs);
--denhaag-link-icon-margin-start: var(--web-app-size-xs);
--denhaag-link-padding: var(--web-app-size-xs);
--utrecht-link-hover-color: var(--web-app-color-link-active);
/* --utrecht-link-hover-color: var(--web-app-color-link-active);
--utrecht-link-focus-color: var(--web-app-color-link-active);
--utrecht-link-color: var(--web-app-color-link);
--utrecht-link-text-decoration: underline;
--utrecht-link-text-decoration: underline; */

--denhaag-tabs-tab-indicator-border-color: var(--web-app-color-link);
--denhaag-tabs-tab-padding-inline-end: var(--web-app-size-xs);
Expand Down Expand Up @@ -164,7 +164,7 @@
--denhaag-form-group-helper-text-color: var(--web-app-color-primary-text);
--denhaag-form-group-label-color: var(--web-app-color-link-active);

--utrecht-form-input-font-family: var(--web-app-content-font-family);
/* --utrecht-form-input-font-family: var(--web-app-content-font-family);
--utrecht-form-label-radio-color: var(--web-app-color-primary-text);
--utrecht-form-label-checkbox-color: var(--web-app-color-primary-text);
--utrecht-form-label-font-size: var(--web-app-font-size-md);
Expand All @@ -185,7 +185,7 @@
--utrecht-form-input-padding-inline-end: var(--web-app-size-md);
--utrecht-form-input-padding-block-start: var(--web-app-size-sm);
--utrecht-form-input-padding-block-end: var(--web-app-size-sm);
--utrecht-form-input-border-width: var(--web-app-size-4xs);
--utrecht-form-input-border-width: var(--web-app-size-4xs); */

--denhaag-divider-border-color: var(--web-app-color-disabled);
--denhaag-divider-margin-inline-end: var(--web-app-size-md);
Expand Down
2 changes: 1 addition & 1 deletion pwa/src/styling/design-tokens/skeleton-design-tokens.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:root {
.conduction-theme {
/* Sizes */
--skeleton-size-4xs: 1px;
--skeleton-size-3xs: 2px;
Expand Down
8 changes: 5 additions & 3 deletions pwa/src/styling/themeProvider/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import * as React from "react";
import * as styles from "./ThemeProvider.module.css";
import "./../../styling/design-tokens/component-overrides.css";
import { useForm } from "react-hook-form";
import "@utrecht/component-library-css";
// import "@utrecht/design-tokens/dist/index.css";
import { themes } from "../../data/themes";
import FormField, { FormFieldInput, FormFieldLabel } from "@gemeente-denhaag/form-field";
import { Heading2 } from "@gemeente-denhaag/components-react";
import { SelectSingle } from "@conduction/components";
import { SelectSingle } from "@conduction/components/lib/components/formFields/select/select";
import { Document } from "@utrecht/component-library-react/dist/css-module";
import clsx from "clsx";

export const ThemeProvider = ({ children }: React.PropsWithChildren<{}>): JSX.Element => {
const [theme, setTheme] = React.useState<string>("rotterdam");
Expand All @@ -27,7 +29,7 @@ export const ThemeProvider = ({ children }: React.PropsWithChildren<{}>): JSX.El
const themeData = themes.find(({ value }) => value === theme);

return (
<Document className={themeData?.className}>
<Document className={clsx("conduction-theme", themeData?.className)}>
{children}

<div className={styles.container}>
Expand Down
6 changes: 4 additions & 2 deletions pwa/src/templates/about/AboutTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as React from "react";
import * as styles from "./AboutTemplate.module.css";
import { Container, QuoteWrapper } from "@conduction/components";
import { Button, Paragraph } from "@gemeente-denhaag/components-react";
import { Container } from "@conduction/components/lib/components/container/Container";
import { QuoteWrapper } from "@conduction/components/lib/components/quoteWrapper/QuoteWrapper";
import { Button } from "@gemeente-denhaag/button";
import { Paragraph } from "@gemeente-denhaag/typography";
import { Heading, Icon } from "@utrecht/component-library-react/dist/css-module";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@gemeente-denhaag/table";
import layersVisual from "./../../assets/images/5-lagen-visualisatie.png";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import * as React from "react";
import * as styles from "./ApplicationsDetailTemplate.module.css";
import { Button, Divider } from "@gemeente-denhaag/components-react";
import { Container, Tag, ToolTip } from "@conduction/components";
import { Button } from "@gemeente-denhaag/button";
import { Divider } from "@gemeente-denhaag/divider";
import { Container } from "@conduction/components/lib/components/container/Container";
import { Tag } from "@conduction/components/lib/components/tag/Tag";
import { Tooltip } from "@conduction/components/lib/components/tooltip/Tooltip";
import { Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { ArrowLeftIcon } from "@gemeente-denhaag/icons";
import { useTranslation } from "react-i18next";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import * as styles from "./ApplicationsTemplate.module.css";
import { Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { Container } from "@conduction/components";
import { Container } from "@conduction/components/lib/components/container/Container";
import { FiltersContext } from "../../context/filters";
import { useTranslation } from "react-i18next";
import { ApplicationCard } from "../../components/applicationCard/ApplicationCard";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import * as styles from "./CategoriesTemplate.module.css";
import { Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { Container } from "@conduction/components";
import { Container } from "@conduction/components/lib/components/container/Container";
import { useTranslation } from "react-i18next";
import { TEMPORARY_PORTFOLIOS } from "../../data/portfolio";
import { CategoriesardsAccordionTemplate } from "../templateParts/categoriesCardsAccordion/CategoriesCardsAccordionTemplate";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from "react";
import * as styles from "./CategoryDetailTemplate.module.css";
import { Button } from "@gemeente-denhaag/components-react";
import { Button } from "@gemeente-denhaag/button";
import { BadgeCounter, Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { Container, Tag } from "@conduction/components";
import { Container } from "@conduction/components/lib/components/container/Container";
import { Tag } from "@conduction/components/lib/components/tag/Tag";
import { Link } from "../../components";
import { ArrowLeftIcon } from "@gemeente-denhaag/icons";
import { useTranslation } from "react-i18next";
Expand Down
14 changes: 9 additions & 5 deletions pwa/src/templates/componentDetail/ComponentsDetailTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import * as React from "react";
import * as styles from "./ComponentsDetailTemplate.module.css";
import { Button, Tab, TabContext, TabPanel, Tabs } from "@gemeente-denhaag/components-react";
import { Button } from "@gemeente-denhaag/button";
import { Tab, TabContext, TabPanel, Tabs } from "@gemeente-denhaag/tab";
import { BadgeCounter, Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { Container, InfoCard, Tag, NotificationPopUp as _NotificationPopUp } from "@conduction/components";
import { Container } from "@conduction/components/lib/components/container/Container";
import { Tag } from "@conduction/components/lib/components/tag/Tag";
import { InfoCard } from "@conduction/components/lib/components/card/index";
import {
NotificationPopUp,
NotificationPopUpController,
} from "@conduction/components/lib/components/notificationPopUp/NotificationPopUp";
import { navigate } from "gatsby";
import { ArrowLeftIcon, ArrowRightIcon, ExternalLinkIcon, CallIcon } from "@gemeente-denhaag/icons";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -38,9 +45,6 @@ export const ComponentsDetailTemplate: React.FC<ComponentsDetailTemplateProps> =
const [currentTab, setCurrentTab] = React.useState<number>(0);
const [filters] = React.useContext(FiltersContext);

const NotificationPopUpController = _NotificationPopUp.controller;
const NotificationPopUp = _NotificationPopUp.NotificationPopUp;

const { isVisible, show, hide } = NotificationPopUpController();

const queryClient = new QueryClient();
Expand Down
4 changes: 2 additions & 2 deletions pwa/src/templates/components/ComponentsTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";
import * as styles from "./ComponentsTemplate.module.css";
import * as _ from "lodash";
import { Alert } from "@gemeente-denhaag/components-react";
import { Container } from "@conduction/components";
import { Alert } from "@gemeente-denhaag/alert";
import { Container } from "@conduction/components/lib/components/container/Container";
import { ComponentResultTemplate } from "../templateParts/resultsTemplates/ComponentResultsTemplate";
import { FiltersContext } from "../../context/filters";
import { useTranslation } from "react-i18next";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import * as styles from "./ApiDocumentationTemplate.module.css";
import { Container } from "@conduction/components";
import { Container } from "@conduction/components/lib/components/container/Container";
import { Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { ExternalLinkIcon } from "@gemeente-denhaag/icons";
import { Link } from "../../../components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import * as styles from "./ContactDocumentationTemplate.module.css";
import { Container } from "@conduction/components";
import { Container } from "@conduction/components/lib/components/container/Container";
import { Heading, Paragraph, Icon } from "@utrecht/component-library-react/dist/css-module";
import { ExternalLinkIcon } from "@gemeente-denhaag/icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
Expand Down
Loading