From 4537d0b114778a7bd2452cee1c75fc1c0cb8b3c1 Mon Sep 17 00:00:00 2001 From: Felix <67233923+DasProffi@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:27:04 +0100 Subject: [PATCH] feat: remove Span component in favor of a twind class (#1141) * feat: remove Span component in favor of a twind class * fix: fix Tile component usage of classnames * fix: fix lint * fix: fix lint --- landing-page/components/Footer.tsx | 3 +- landing-page/components/Header.tsx | 31 +++++----- landing-page/components/NewsLetterForm.tsx | 5 +- landing-page/components/PartnerList.tsx | 3 +- .../sections/landing/MarketStatsSection.tsx | 7 +-- .../sections/landing/StartSection.tsx | 5 +- .../landing/StepsToDigitalizationSection.tsx | 5 +- .../sections/landing/TasksDemoSection.tsx | 3 +- .../sections/landing/VisionSection.tsx | 5 +- .../mediQuu/BrandInformationSection.tsx | 8 +-- .../sections/mediQuu/ContactSection.tsx | 13 ++--- .../components/sections/mediQuu/Header.tsx | 5 +- .../sections/mediQuu/InformationSection.tsx | 9 ++- .../sections/mediQuu/MediQuuFAQ.tsx | 5 +- .../sections/mediQuu/RoadmapSection.tsx | 11 ++-- .../sections/mediQuu/TeamSection.tsx | 5 +- .../components/sections/story/StoryHeader.tsx | 5 +- .../sections/story/StoryInUseAtSection.tsx | 3 +- .../sections/story/StoryStartSection.tsx | 58 +++++++++---------- .../tasks/ConnectOrganizationFeature.tsx | 7 +-- .../sections/tasks/FeatureSection.tsx | 9 ++- .../sections/tasks/MobileFeatureSection.tsx | 9 ++- .../sections/tasks/PatientSection.tsx | 7 +-- .../sections/tasks/PropertiesSection.tsx | 7 +-- .../sections/tasks/StartSection.tsx | 7 +-- .../sections/tasks/TasksKanbanSection.tsx | 7 +-- .../sections/tasks/TasksTemplatesSection.tsx | 7 +-- .../sections/tasks/TrustedBySection.tsx | 3 +- landing-page/pages/credits/index.tsx | 13 ++--- landing-page/pages/join/index.tsx | 5 +- lib/components/AvatarGroup.tsx | 3 +- lib/components/BreadCrumb.tsx | 3 +- lib/components/DescriptionWithAction.tsx | 5 +- lib/components/HelpwaveBadge.tsx | 4 +- lib/components/InputGroup.tsx | 3 +- lib/components/Profile.tsx | 13 ++--- lib/components/Span.tsx | 45 -------------- lib/components/TextImage.tsx | 7 +-- lib/components/date/YearMonthPicker.tsx | 3 +- .../examples/MultiSelectExample.tsx | 3 +- lib/components/examples/TableExample.tsx | 9 ++- lib/components/examples/Title.tsx | 44 -------------- lib/components/layout/FAQSection.tsx | 3 +- lib/components/layout/Tile.tsx | 10 ++-- lib/components/modals/Modal.tsx | 7 +-- .../properties/CheckboxProperty.tsx | 5 +- .../properties/MultiSelectProperty.tsx | 3 +- lib/components/properties/NumberProperty.tsx | 3 +- lib/components/user-input/Label.tsx | 12 +++- lib/components/user-input/MultiSelect.tsx | 3 +- lib/components/user-input/Select.tsx | 3 +- lib/stories/layout/tile/Tile.stories.ts | 4 +- .../layout/tile/TileWithImage.stories.tsx | 2 +- lib/stories/other/SearchableList.stories.tsx | 3 +- lib/stories/other/Translation.stories.tsx | 47 ++++++++++++++- lib/stories/other/Translation.tsx | 16 ----- .../input/select/SearchableSelect.stories.tsx | 3 +- .../input/select/Select.stories.tsx | 3 +- lib/twind/config.ts | 38 ++---------- lib/twind/textstyles.ts | 19 ++++++ lib/twind/typography.ts | 30 ++++++++++ tasks/components/BedInRoomIndicator.tsx | 5 +- tasks/components/ColumnTitle.tsx | 5 +- tasks/components/Header.tsx | 3 +- tasks/components/KanbanHeader.tsx | 3 +- tasks/components/MobileInterceptor.tsx | 3 +- tasks/components/NewsDisplay.tsx | 5 +- tasks/components/OrganizationForm.tsx | 17 +++--- .../components/OrganizationInvitationList.tsx | 7 +-- tasks/components/OrganizationMemberList.tsx | 15 +++-- tasks/components/RoomList.tsx | 11 ++-- tasks/components/RoomOverview.tsx | 3 +- tasks/components/SubtaskView.tsx | 5 +- tasks/components/TaskTemplateListColumn.tsx | 5 +- tasks/components/TaskTemplateWardPreview.tsx | 3 +- tasks/components/UserInvitationList.tsx | 5 +- tasks/components/WardForm.tsx | 5 +- tasks/components/cards/AddCard.tsx | 3 +- tasks/components/cards/BedCard.tsx | 5 +- tasks/components/cards/PatientCard.tsx | 5 +- tasks/components/cards/TaskCard.tsx | 7 +-- tasks/components/cards/TaskTemplateCard.tsx | 5 +- tasks/components/cards/WardCard.tsx | 5 +- tasks/components/layout/DashboardDisplay.tsx | 7 +-- .../components/layout/OrganizationDetails.tsx | 5 +- tasks/components/layout/PatientList.tsx | 17 +++--- tasks/components/layout/TaskDetailView.tsx | 15 +++-- .../components/layout/TaskTemplateDetails.tsx | 3 +- .../components/layout/TaskTemplateDisplay.tsx | 8 +-- tasks/components/layout/WardDetails.tsx | 7 +-- tasks/components/layout/WardRoomList.tsx | 5 +- .../layout/property/PropertyDetails.tsx | 3 +- .../layout/property/PropertyDetailsField.tsx | 5 +- .../layout/property/PropertyDetailsRules.tsx | 2 +- .../layout/property/PropertyDisplay.tsx | 13 ++--- .../layout/property/PropertyList.tsx | 5 +- tasks/components/modals/AddPatientModal.tsx | 7 +-- tasks/components/modals/ManageBedsModal.tsx | 9 ++- .../modals/PatientDischargeModal.tsx | 5 +- tasks/components/modals/ReSignInModal.tsx | 3 +- tasks/components/pill/PillLabel.tsx | 3 +- tasks/components/selects/RoomBedSelect.tsx | 21 ++++--- tasks/pages/ward/[wardId].tsx | 6 +- 103 files changed, 389 insertions(+), 516 deletions(-) delete mode 100644 lib/stories/other/Translation.tsx create mode 100644 lib/twind/textstyles.ts create mode 100644 lib/twind/typography.ts diff --git a/landing-page/components/Footer.tsx b/landing-page/components/Footer.tsx index 66845e31..a8e09a82 100644 --- a/landing-page/components/Footer.tsx +++ b/landing-page/components/Footer.tsx @@ -1,7 +1,6 @@ import { useEffect } from 'react' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import * as CookieConsent from 'vanilla-cookieconsent' -import { Span } from '@helpwave/common/components/Span' import { Helpwave } from '@helpwave/common/icons/Helpwave' import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' @@ -116,7 +115,7 @@ const Footer = () => {
- © {year} helpwave + © {year} helpwave
) diff --git a/landing-page/components/Header.tsx b/landing-page/components/Header.tsx index 081d4372..385270ec 100644 --- a/landing-page/components/Header.tsx +++ b/landing-page/components/Header.tsx @@ -1,4 +1,3 @@ -import { Span } from '@helpwave/common/components/Span' import { Helpwave } from '@helpwave/common/icons/Helpwave' import { tw } from '@helpwave/common/twind' import { Menu as MenuIcon, X } from 'lucide-react' @@ -102,8 +101,6 @@ const Header = () => { const [navbarOpen, setNavbarOpen] = useState(false) const translation = useTranslation(defaultHeaderTranslation, {}) - const navigationItemStyle = tw('!font-bold font-space') - return ( <>
@@ -122,18 +119,18 @@ const Header = () => {
{subpage === undefined ? ( - + {translation[name]} - + ) : ( alignment="tl" trigger={(onClick, ref) => (
- + {translation[name]} - +
)} showOnHover={true} @@ -146,9 +143,9 @@ const Header = () => { ( - + {translation[subPageName]} - + ))} @@ -183,9 +180,9 @@ const Header = () => {
setNavbarOpen(false)}> - + home - +
@@ -197,16 +194,16 @@ const Header = () => {
{subpage === undefined ? ( setNavbarOpen(false)}> - + {translation[name]} - + ) : ( alignment="tl" trigger={(onClick, ref) => (
- + {translation[name]} - +
)}> {subpage.map(({ @@ -218,9 +215,9 @@ const Header = () => { setNavbarOpen(false)} href={subPageExternal ? subPageUrl : url + subPageUrl}> - + {translation[subPageName]} - + ))} diff --git a/landing-page/components/NewsLetterForm.tsx b/landing-page/components/NewsLetterForm.tsx index baafe053..fcdc7472 100644 --- a/landing-page/components/NewsLetterForm.tsx +++ b/landing-page/components/NewsLetterForm.tsx @@ -2,7 +2,6 @@ import type { Languages } from '@helpwave/common/hooks/useLanguage' import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import { Input } from '@helpwave/common/components/user-input/Input' import { useState } from 'react' import { Select } from '@helpwave/common/components/user-input/Select' @@ -119,8 +118,8 @@ export const NewsLetterForm = ({ return (
- {translation.title} - {translation.subtitle} + {translation.title} + {translation.subtitle}
{ return (
- {title} + {title} { return (
{children} - {stat} -

{title}

+ {stat} +

{title}

) } @@ -52,7 +51,7 @@ const MarketStatsSection = ({ overwriteTranslation }: PropsForTranslation

{translation.germanyHealthcareSystem}

- {translation.marketPotential} + {translation.marketPotential}
{/* Image needs attribution to https://www.flaticon.com/free-icon/hospital_3809392?term=hospital&page=1&position=8&origin=search&related_id=3809392 */} diff --git a/landing-page/components/sections/landing/StartSection.tsx b/landing-page/components/sections/landing/StartSection.tsx index c5bdd1dc..62b98a28 100644 --- a/landing-page/components/sections/landing/StartSection.tsx +++ b/landing-page/components/sections/landing/StartSection.tsx @@ -3,7 +3,6 @@ import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { Languages } from '@helpwave/common/hooks/useLanguage' import Image from 'next/image' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { SectionBase } from '@/components/sections/SectionBase' @@ -32,8 +31,8 @@ const StartSection = ({ overwriteTranslation }: PropsForTranslation
-

{translation.title}

- +

{translation.title}

+
diff --git a/landing-page/components/sections/landing/StepsToDigitalizationSection.tsx b/landing-page/components/sections/landing/StepsToDigitalizationSection.tsx index 4b007ab8..469c5ec7 100644 --- a/landing-page/components/sections/landing/StepsToDigitalizationSection.tsx +++ b/landing-page/components/sections/landing/StepsToDigitalizationSection.tsx @@ -1,7 +1,6 @@ import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import type { TextImageProps } from '@helpwave/common/components/TextImage' import { TextImage } from '@helpwave/common/components/TextImage' @@ -97,8 +96,8 @@ export const StepsToDigitalizationSection = () => { return (
-

- +

+
{items.map((value, index) => ( diff --git a/landing-page/components/sections/landing/TasksDemoSection.tsx b/landing-page/components/sections/landing/TasksDemoSection.tsx index c6b5ef7f..1731b356 100644 --- a/landing-page/components/sections/landing/TasksDemoSection.tsx +++ b/landing-page/components/sections/landing/TasksDemoSection.tsx @@ -2,7 +2,6 @@ import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { HelpwaveBadge } from '@helpwave/common/components/HelpwaveBadge' -import { Span } from '@helpwave/common/components/Span' import Link from 'next/link' import Image from 'next/image' import { ItemGrid } from '@helpwave/common/components/layout/ItemGrid' @@ -55,7 +54,7 @@ export const TasksDemoSection = () => {
- {translation.workflowManagement} + {translation.workflowManagement} {translation.feature1} {translation.feature2} diff --git a/landing-page/components/sections/landing/VisionSection.tsx b/landing-page/components/sections/landing/VisionSection.tsx index 406ee4f8..5a59e95c 100644 --- a/landing-page/components/sections/landing/VisionSection.tsx +++ b/landing-page/components/sections/landing/VisionSection.tsx @@ -4,7 +4,6 @@ import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { Languages } from '@helpwave/common/hooks/useLanguage' import Image from 'next/image' import { Chip } from '@helpwave/common/components/ChipList' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { SectionBase } from '@/components/sections/SectionBase' @@ -38,8 +37,8 @@ const StartSection = ({ overwriteTranslation }: PropsForTranslation
{translation.ourVision} -

{translation.title}

- +

{translation.title}

+
diff --git a/landing-page/components/sections/mediQuu/BrandInformationSection.tsx b/landing-page/components/sections/mediQuu/BrandInformationSection.tsx index 88f67834..1af54f3a 100644 --- a/landing-page/components/sections/mediQuu/BrandInformationSection.tsx +++ b/landing-page/components/sections/mediQuu/BrandInformationSection.tsx @@ -52,16 +52,16 @@ export const BrandDescriptionsSection = () => { return ( )} className={tw('bg-white rounded-3xl px-6 mobile:py-6 tablet:py-12 desktop:py-16 !gap-6 !w-fit shadow-md mobile:flex-col tablet:flex-col')} />
- {translation.contact} - {translation.contactDescription} + {translation.contact} + {translation.contactDescription} {contacts.length > 0 && (
{contacts.map((contact, index) => (
- {contact.name} - {contact.email} + {contact.name} + {contact.email}
))}
@@ -151,7 +150,7 @@ export const ContactSection = ({ placeholder={translation.message} onChange={message => setContactForm(prevState => ({ ...prevState, message, hasSend: false, hasError: false }))} /> - {contactForm.hasError && ({translation.error})} + {contactForm.hasError && ({translation.error})} { @@ -183,7 +182,7 @@ export const ContactSection = ({ > {translation.send} - {contactForm.hasSend && ({translation.thankYou})} + {contactForm.hasSend && ({translation.thankYou})}
) diff --git a/landing-page/components/sections/mediQuu/Header.tsx b/landing-page/components/sections/mediQuu/Header.tsx index 80027470..97f032eb 100644 --- a/landing-page/components/sections/mediQuu/Header.tsx +++ b/landing-page/components/sections/mediQuu/Header.tsx @@ -1,7 +1,6 @@ import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import Image from 'next/image' import { HelpwaveBadge } from '@helpwave/common/components/HelpwaveBadge' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' @@ -33,8 +32,8 @@ export const MediQuuHeaderSection = () => {
- {translation.title} - + {translation.title} +
diff --git a/landing-page/components/sections/mediQuu/InformationSection.tsx b/landing-page/components/sections/mediQuu/InformationSection.tsx index fd3052ed..c37a9702 100644 --- a/landing-page/components/sections/mediQuu/InformationSection.tsx +++ b/landing-page/components/sections/mediQuu/InformationSection.tsx @@ -1,7 +1,6 @@ import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { tw } from '@twind/core' -import { Span } from '@helpwave/common/components/Span' import Image from 'next/image' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import type { ReactNode } from 'react' @@ -52,12 +51,12 @@ export const MediQuuInformationSection = () => { height={150}/>
- {translation.title} - {translation.subTitle1} + {translation.title} + {translation.subTitle1}
- +
- {translation.subTitle3} + {translation.subTitle3}
) diff --git a/landing-page/components/sections/mediQuu/MediQuuFAQ.tsx b/landing-page/components/sections/mediQuu/MediQuuFAQ.tsx index 6ca322d5..1d0d159d 100644 --- a/landing-page/components/sections/mediQuu/MediQuuFAQ.tsx +++ b/landing-page/components/sections/mediQuu/MediQuuFAQ.tsx @@ -1,7 +1,6 @@ import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import { FAQSection } from '@helpwave/common/components/layout/FAQSection' import { SectionBase } from '@/components/sections/SectionBase' @@ -95,8 +94,8 @@ export const MediQuuFAQSection = () => { const translation = useTranslation(defaultMediQuuFAQTranslation) return ( - {translation.title} - {translation.subTitle} + {translation.title} + {translation.subTitle}
({ diff --git a/landing-page/components/sections/mediQuu/RoadmapSection.tsx b/landing-page/components/sections/mediQuu/RoadmapSection.tsx index 80b019ce..798b5568 100644 --- a/landing-page/components/sections/mediQuu/RoadmapSection.tsx +++ b/landing-page/components/sections/mediQuu/RoadmapSection.tsx @@ -1,7 +1,6 @@ import { type Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import { SectionBase } from '@/components/sections/SectionBase' type RoadmapItem = { @@ -85,14 +84,14 @@ export const RoadmapSection = () => { const translation = useTranslation(defaultRoadmapTranslation) return ( - {translation.title} - {translation.description} + {translation.title} + {translation.description}
{translation.roadmap.map(value => (
- {value.name} - {value.start} - {value.description} + {value.name} + {value.start} + {value.description}
))}
diff --git a/landing-page/components/sections/mediQuu/TeamSection.tsx b/landing-page/components/sections/mediQuu/TeamSection.tsx index 241a070c..10952dd9 100644 --- a/landing-page/components/sections/mediQuu/TeamSection.tsx +++ b/landing-page/components/sections/mediQuu/TeamSection.tsx @@ -4,7 +4,6 @@ import { Profile } from '@helpwave/common/components/Profile' import { HelpwaveBadge } from '@helpwave/common/components/HelpwaveBadge' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import { tx } from '@twind/core' import { MediQuuBadge } from '@/components/sections/mediQuu/MediQuuBadge' import { SectionBase } from '@/components/sections/SectionBase' @@ -123,8 +122,8 @@ export const TeamSection = () => { const usedLanguage = useLanguage().language return ( - {translation.title} - {translation.subTitle} + {translation.title} + {translation.subTitle}
{contactsHelpwave.map(value => { const profileProps = { ...value } diff --git a/landing-page/components/sections/story/StoryHeader.tsx b/landing-page/components/sections/story/StoryHeader.tsx index 28abab1b..d27c9fb5 100644 --- a/landing-page/components/sections/story/StoryHeader.tsx +++ b/landing-page/components/sections/story/StoryHeader.tsx @@ -2,7 +2,6 @@ import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' -import { Span } from '@helpwave/common/components/Span' import Image from 'next/image' import { SectionBase } from '@/components/sections/SectionBase' @@ -29,8 +28,8 @@ const StoryHeader = ({ overwriteTranslation }: PropsForTranslation
- {translation.foundingStory} - {translation.foundingStoryDescription} + {translation.foundingStory} + {translation.foundingStoryDescription}
diff --git a/landing-page/components/sections/story/StoryInUseAtSection.tsx b/landing-page/components/sections/story/StoryInUseAtSection.tsx index 56579636..07cca264 100644 --- a/landing-page/components/sections/story/StoryInUseAtSection.tsx +++ b/landing-page/components/sections/story/StoryInUseAtSection.tsx @@ -2,7 +2,6 @@ import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import Image from 'next/image' -import { Span } from '@helpwave/common/components/Span' import { SectionBase } from '@/components/sections/SectionBase' import type { Partner } from '@/components/PartnerList' @@ -31,7 +30,7 @@ const StoryInUseAtSection = () => { return ( - {translation.title} + {translation.title}
{images.map(partner => ( -
- - {translation.ourStory} -
+
+ + {translation.ourStory} +
-
-

- 1. {translation.identifyingTheProblemTitle} -

-

- {translation.identifyingTheProblemText} -

-
+
+

+ 1. {translation.identifyingTheProblemTitle} +

+

+ {translation.identifyingTheProblemText} +

+
-
-

- 2. {translation.tasksAndOpenInnovationTitle} -

-

- {translation.tasksAndOpenInnovationText} -

-
+
+

+ 2. {translation.tasksAndOpenInnovationTitle} +

+

+ {translation.tasksAndOpenInnovationText} +

+
-
-

- 3. {translation.futureTitle} -

-

- {translation.futureText} -

-
+
+

+ 3. {translation.futureTitle} +

+

+ {translation.futureText} +

+
) } diff --git a/landing-page/components/sections/tasks/ConnectOrganizationFeature.tsx b/landing-page/components/sections/tasks/ConnectOrganizationFeature.tsx index beb34d5a..c6ca8869 100644 --- a/landing-page/components/sections/tasks/ConnectOrganizationFeature.tsx +++ b/landing-page/components/sections/tasks/ConnectOrganizationFeature.tsx @@ -3,7 +3,6 @@ import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { Languages } from '@helpwave/common/hooks/useLanguage' import Image from 'next/image' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { ItemGrid } from '@helpwave/common/components/layout/ItemGrid' import { SectionBase } from '@/components/sections/SectionBase' @@ -58,10 +57,10 @@ export const ConnectOrganizationFeatureSection = ({ overwriteTranslation }: Prop >
-

{translation.title}

- +

{translation.title}

+ - {features.map((feature, index) => ({feature}))} + {features.map((feature, index) => ({feature}))}
diff --git a/landing-page/components/sections/tasks/FeatureSection.tsx b/landing-page/components/sections/tasks/FeatureSection.tsx index fb63db2d..9142f7b4 100644 --- a/landing-page/components/sections/tasks/FeatureSection.tsx +++ b/landing-page/components/sections/tasks/FeatureSection.tsx @@ -1,4 +1,3 @@ -import { Span } from '@helpwave/common/components/Span' import { tw, tx } from '@helpwave/common/twind' import Image from 'next/image' import type { Languages } from '@helpwave/common/hooks/useLanguage' @@ -32,12 +31,12 @@ const FeatureItem = ({
- + {title} - - + + {description} - +
) diff --git a/landing-page/components/sections/tasks/MobileFeatureSection.tsx b/landing-page/components/sections/tasks/MobileFeatureSection.tsx index 59f82048..245e8233 100644 --- a/landing-page/components/sections/tasks/MobileFeatureSection.tsx +++ b/landing-page/components/sections/tasks/MobileFeatureSection.tsx @@ -3,7 +3,6 @@ import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { Languages } from '@helpwave/common/hooks/useLanguage' import Image from 'next/image' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { SectionBase } from '@/components/sections/SectionBase' import { TasksPlaystoreBadge } from '@/components/TasksPlaystoreBadge' @@ -43,8 +42,8 @@ export const MobileFeatureSection = ({ overwriteTranslation }: PropsForTranslati >
-

{translation.title}

- +

{translation.title}

+
- {translation.tradmarkPlaystore} - {translation.trademarkAppstore} + {translation.tradmarkPlaystore} + {translation.trademarkAppstore}
- {translation.patients} + {translation.patients}
-

{translation.title}

- +

{translation.title}

+
diff --git a/landing-page/components/sections/tasks/PropertiesSection.tsx b/landing-page/components/sections/tasks/PropertiesSection.tsx index dbd49b65..32122e54 100644 --- a/landing-page/components/sections/tasks/PropertiesSection.tsx +++ b/landing-page/components/sections/tasks/PropertiesSection.tsx @@ -3,7 +3,6 @@ import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { Languages } from '@helpwave/common/hooks/useLanguage' import Image from 'next/image' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { TagIcon } from '@helpwave/common/icons/Tag' import { SectionBase } from '@/components/sections/SectionBase' @@ -51,10 +50,10 @@ export const PropertiesSection = ({ overwriteTranslation }: PropsForTranslation<
- {translation.properties} + {translation.properties}
-

{translation.title}

- +

{translation.title}

+
diff --git a/landing-page/components/sections/tasks/StartSection.tsx b/landing-page/components/sections/tasks/StartSection.tsx index a57d7d6f..0b14fa37 100644 --- a/landing-page/components/sections/tasks/StartSection.tsx +++ b/landing-page/components/sections/tasks/StartSection.tsx @@ -6,7 +6,6 @@ import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { Chip } from '@helpwave/common/components/ChipList' -import { Span } from '@helpwave/common/components/Span' import { Helpwave } from '@helpwave/common/icons/Helpwave' import { SectionBase } from '@/components/sections/SectionBase' @@ -48,12 +47,10 @@ const StartSection = ({ overwriteTranslation }: PropsForTranslation - helpwave tasks + helpwave tasks -

- {translation.title} -

+

{translation.title}

diff --git a/landing-page/components/sections/tasks/TasksKanbanSection.tsx b/landing-page/components/sections/tasks/TasksKanbanSection.tsx index 54fdb5ee..3aabe4bd 100644 --- a/landing-page/components/sections/tasks/TasksKanbanSection.tsx +++ b/landing-page/components/sections/tasks/TasksKanbanSection.tsx @@ -3,7 +3,6 @@ import type { PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { Languages } from '@helpwave/common/hooks/useLanguage' import Image from 'next/image' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import { TagIcon } from '@helpwave/common/icons/Tag' import { SectionBase } from '@/components/sections/SectionBase' @@ -40,10 +39,10 @@ export const TasksKanbanSection = ({ overwriteTranslation }: PropsForTranslation
- {translation.tasks} + {translation.tasks}
-

{translation.title}

- +

{translation.title}

+
- {translation.taskTemplates} + {translation.taskTemplates}
-

{translation.title}

- +

{translation.title}

+
{ return ( - {translation.title} + {translation.title} ()} diff --git a/landing-page/pages/credits/index.tsx b/landing-page/pages/credits/index.tsx index 96a3dab3..05cdea3f 100644 --- a/landing-page/pages/credits/index.tsx +++ b/landing-page/pages/credits/index.tsx @@ -1,6 +1,5 @@ import { tw } from '@helpwave/common/twind' import type { NextPage } from 'next' -import { Span } from '@helpwave/common/components/Span' import { MarkdownInterpreter } from '@helpwave/common/components/MarkdownInterpreter' import Image from 'next/image' import type { Languages } from '@helpwave/common/hooks/useLanguage' @@ -89,9 +88,9 @@ const CreditsPage: NextPage = ({ overwriteTranslation }: PropsForTranslation
-

{translation.title}

- +

{translation.title}

+
-

Freepik

+

Freepik

{ freepikCredits.map((credit) => (
- {credit.text} + {credit.text} {credit.link}
)) @@ -123,7 +122,7 @@ const CreditsPage: NextPage = ({ overwriteTranslation }: PropsForTranslation -

{translation.flaticon}

+

{translation.flaticon}

{flaticonCredits.map(({ name, author, link }) => ( {translation.createdBy(name, author)} diff --git a/landing-page/pages/join/index.tsx b/landing-page/pages/join/index.tsx index ee3a799c..a0f328eb 100644 --- a/landing-page/pages/join/index.tsx +++ b/landing-page/pages/join/index.tsx @@ -2,7 +2,6 @@ import { tw } from '@helpwave/common/twind' import type { NextPage } from 'next' import { RadialRings } from '@helpwave/common/components/Ring' import { useEffect, useState } from 'react' -import { Span } from '@helpwave/common/components/Span' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' import type { NewsLetterFormType } from '@/components/NewsLetterForm' @@ -93,8 +92,8 @@ const NewsLetter: NextPage = () => { sizeCircle3={sizeCircle3} waveWidth={waveWidth} /> - - +
+
)}
diff --git a/lib/components/AvatarGroup.tsx b/lib/components/AvatarGroup.tsx index 83f213d9..0034a523 100644 --- a/lib/components/AvatarGroup.tsx +++ b/lib/components/AvatarGroup.tsx @@ -1,7 +1,6 @@ import { tw, tx } from '../twind' import type { AvatarProps, AvatarSize } from './Avatar' import { Avatar, avtarSizeMapping } from './Avatar' -import { Span } from './Span' export type AvatarGroupProps = { avatars: Omit[], @@ -35,7 +34,7 @@ export const AvatarGroup = ({ notDisplayedProfiles > 0 && (
- + {notDisplayedProfiles} + + {notDisplayedProfiles}
) } diff --git a/lib/components/BreadCrumb.tsx b/lib/components/BreadCrumb.tsx index 90542d99..79cc4bd1 100644 --- a/lib/components/BreadCrumb.tsx +++ b/lib/components/BreadCrumb.tsx @@ -1,6 +1,5 @@ import Link from 'next/link' import { tw, tx } from '../twind' -import { Span } from './Span' export type Crumb = { display: string, @@ -24,7 +23,7 @@ export const BreadCrumb = ({ crumbs }: BreadCrumbProps) => { {crumb.display} - {index !== crumbs.length - 1 && /} + {index !== crumbs.length - 1 && /}
))}
diff --git a/lib/components/DescriptionWithAction.tsx b/lib/components/DescriptionWithAction.tsx index 6729100b..29772d7b 100644 --- a/lib/components/DescriptionWithAction.tsx +++ b/lib/components/DescriptionWithAction.tsx @@ -2,7 +2,6 @@ import type { ReactNode } from 'react' import { Tag } from 'lucide-react' import { tx, tw } from '../twind' import { noop } from '../util/noop' -import { Span } from './Span' import { Button } from './Button' export type DescriptionWithActionProps = { @@ -49,8 +48,8 @@ export const DescriptionWithAction = ({
)}
- {title} - {description} + {title} + {description}
{trailing} {!trailing && trailingButtonText && ( diff --git a/lib/components/HelpwaveBadge.tsx b/lib/components/HelpwaveBadge.tsx index 5181a60c..0da595c7 100644 --- a/lib/components/HelpwaveBadge.tsx +++ b/lib/components/HelpwaveBadge.tsx @@ -1,4 +1,4 @@ -import { tx } from '@twind/core' +import { tw, tx } from '@twind/core' import { Helpwave } from '../icons/Helpwave' import { Tile } from './layout/Tile' @@ -23,7 +23,7 @@ export const HelpwaveBadge = ({ return ( )} - title={{ value: title, type: 'title', className: size === 'small' ? '!text-base' : '!text-3xl' }} + title={{ value: title, className: size === 'small' ? tw('@(textstyle-title-lg) text-base') : tw('textstyle-title-xl') }} className={tx('text-white', { 'px-2 py-1 rounded-md': size === 'small', diff --git a/lib/components/InputGroup.tsx b/lib/components/InputGroup.tsx index 18fcd465..cd300f3a 100644 --- a/lib/components/InputGroup.tsx +++ b/lib/components/InputGroup.tsx @@ -3,7 +3,6 @@ import { useEffect, useState } from 'react' import { ChevronDown, ChevronUp } from 'lucide-react' import { tx, tw } from '../twind' import { noop } from '../util/noop' -import { Span } from './Span' export type InputGroupProps = PropsWithChildren<{ title: string, @@ -52,7 +51,7 @@ export const InputGroup = ({ setIsExpanded(updatedIsExpanded) }} > - {title} + {title}
)}
- {prefix && {prefix}} -

{name}

- {suffix && {suffix}} - {role && {role}} + {prefix && {prefix}} +

{name}

+ {suffix && {suffix}} + {role && {role}} {tags && (
- {tags.map((tag, index) => {`#${tag}`})} + {tags.map((tag, index) => {`#${tag}`})}
)} - {info && {info}} + {info && {info}} {socials && (
{socials.map((socialIconProps, index) => ( diff --git a/lib/components/Span.tsx b/lib/components/Span.tsx index c879a05b..e69de29b 100644 --- a/lib/components/Span.tsx +++ b/lib/components/Span.tsx @@ -1,45 +0,0 @@ -import { tx } from '../twind' -import type { NativeProps } from '../util/types' - -export type LabelType = 'labelSmall' | 'labelMedium' | 'labelBig' - -export type SpanType = LabelType | 'normal' | 'heading' | 'title' | 'subsectionTitle' | 'subsubsectionTitle' | 'accent' - | 'description' | 'tableName' | 'navigationItem' | 'tableHeader' | 'formError' - | 'formDescription' | 'modalTitle' | 'block' - -export type SpanProps = NativeProps<'span'> & { - type?: SpanType, -} - -/** - * A component for displaying text and making it easy to change the style - * - * The type of text is defined by the type attribute - */ -export const Span = ({ children, type = 'normal', className, ...restProps }: SpanProps) => { - return ( - - {children} - - ) -} diff --git a/lib/components/TextImage.tsx b/lib/components/TextImage.tsx index 47807a98..caeb1b2e 100644 --- a/lib/components/TextImage.tsx +++ b/lib/components/TextImage.tsx @@ -4,7 +4,6 @@ import type { Languages } from '../hooks/useLanguage' import type { PropsForTranslation } from '../hooks/useTranslation' import { useTranslation } from '../hooks/useTranslation' import { Chip } from './ChipList' -import { Span } from './Span' type TextImageColor = 'primary'| 'secondary'| 'secondaryDark'| 'red' @@ -74,12 +73,12 @@ export const TextImage = ({ > {badge && ( - {badge} + {badge} )}
- {title} - {description} + {title} + {description}
{onShowMoreClicked && (
diff --git a/lib/components/date/YearMonthPicker.tsx b/lib/components/date/YearMonthPicker.tsx index 60775b2b..a6c8b2a6 100644 --- a/lib/components/date/YearMonthPicker.tsx +++ b/lib/components/date/YearMonthPicker.tsx @@ -4,7 +4,6 @@ import { noop } from '../../util/noop' import { equalSizeGroups, range } from '../../util/array' import { tw, tx } from '../../twind' import { Expandable } from '../Expandable' -import { Span } from '../Span' import { addDuration, monthsList, subtractDuration } from '../../util/date' import { useLocale } from '../../hooks/useLanguage' @@ -59,7 +58,7 @@ export const YearMonthPicker = ({ {year}} + label={{year}} className={tw('gap-y-2 rounded-lg bg-gray-100 hover:bg-gray-200 shadow-sm')} headerClassName={tw('px-2 py-1 rounded-lg bg-gray-100 hover:bg-hw-primary-200')} initialExpansion={showValueOpen && selectedYear} diff --git a/lib/components/examples/MultiSelectExample.tsx b/lib/components/examples/MultiSelectExample.tsx index 4d0936e6..296ef56d 100644 --- a/lib/components/examples/MultiSelectExample.tsx +++ b/lib/components/examples/MultiSelectExample.tsx @@ -2,7 +2,6 @@ import { useEffect, useState } from 'react' import type { MultiSelectProps } from '../user-input/MultiSelect' import { MultiSelect } from '../user-input/MultiSelect' import { ChipList } from '../ChipList' -import { Span } from '../Span' type MultiSelectExampleProps = Omit, 'search' | 'selectedDisplay'> & { enableSearch: boolean, @@ -44,7 +43,7 @@ export const MultiSelectExample = ({ ({ items }) => { const selected = items.filter(value => value.selected) if (selected.length === 0) { - return Select + return (Select) } return ( , 'data'>) data={data} identifierMapping={idMapping} rowMappingToCells={dataObject => [ - {dataObject.id}, + {dataObject.id}, { setData(data.map(value => value.id === dataObject.id ? { ...dataObject, name: text } : value)) setSorting(undefined) @@ -101,7 +100,7 @@ const TableExample = ({ data: initialData }: Pick, 'data'>) setData(data.sort(sortingFunctions.id[newTableSorting])) }} > - Id + Id , , 'data'>) setData(data.sort(sortingFunctions.name[newTableSorting])) }} > - Name + Name , , 'data'>) setData(data.sort(sortingFunctions.age[newTableSorting])) }} > - age + age , <> ]} diff --git a/lib/components/examples/Title.tsx b/lib/components/examples/Title.tsx index 8179c35e..e69de29b 100644 --- a/lib/components/examples/Title.tsx +++ b/lib/components/examples/Title.tsx @@ -1,44 +0,0 @@ -import { tw } from '../../twind' -import { useTranslation } from '../../hooks/useTranslation' -import type { PropsForTranslation } from '../../hooks/useTranslation' -import type { Languages } from '../../hooks/useLanguage' - -type TitleTranslation = { - welcome: string, - goodToSeeYou: string, - page: (page: number) => string, -} - -const defaultTitleTranslations: Record = { - en: { - welcome: 'Welcome', - goodToSeeYou: 'Good to see you', - page: (page) => `Page ${page}` - }, - de: { - welcome: 'Willkommen', - goodToSeeYou: 'Schön dich zu sehen', - page: (page) => `Seite ${page}` - } -} - -type TitleProps = { - name: string, -} - -/** - * Simple Title component to demonstrate some translations - */ -const Title = ({ overwriteTranslation, name }:PropsForTranslation) => { - const translation = useTranslation(defaultTitleTranslations, overwriteTranslation) - return ( -

- {translation.welcome}{'! '} - {translation.goodToSeeYou}{', '} - {name}{'. '} - {translation.page(123)} -

- ) -} - -export default Title diff --git a/lib/components/layout/FAQSection.tsx b/lib/components/layout/FAQSection.tsx index f963c583..2fa0f61b 100644 --- a/lib/components/layout/FAQSection.tsx +++ b/lib/components/layout/FAQSection.tsx @@ -4,7 +4,6 @@ import { ChevronDown, ChevronUp } from 'lucide-react' import type { ExpandableProps } from '../Expandable' import { Expandable } from '../Expandable' import { MarkdownInterpreter } from '../MarkdownInterpreter' -import { Span } from '../Span' type ContentType = { type: 'markdown', @@ -39,7 +38,7 @@ export const FAQSection = ({ {title})} + label={(

{title}

)} clickOnlyOnHeader={false} icon={(expanded) => expanded ? () : diff --git a/lib/components/layout/Tile.tsx b/lib/components/layout/Tile.tsx index feb83b19..245646fa 100644 --- a/lib/components/layout/Tile.tsx +++ b/lib/components/layout/Tile.tsx @@ -1,12 +1,10 @@ import type { ReactNode } from 'react' import Image from 'next/image' import { tw, tx } from '../../twind' -import type { SpanType } from '../Span' -import { Span } from '../Span' export type TileProps = { - title: { value: string, className?: string, type?: SpanType }, - description?: { value: string, className?: string, type?: SpanType }, + title: { value: string, className?: string }, + description?: { value: string, className?: string}, prefix?: ReactNode, suffix?: ReactNode, className?: string, @@ -26,9 +24,9 @@ export const Tile = ({
{prefix}
- {title.value} + {title.value} {!!description && - {description.value}} + {description.value}}
{suffix}
diff --git a/lib/components/modals/Modal.tsx b/lib/components/modals/Modal.tsx index 14f3a660..67ca094b 100644 --- a/lib/components/modals/Modal.tsx +++ b/lib/components/modals/Modal.tsx @@ -1,7 +1,6 @@ import { useContext, useEffect, type MouseEventHandler, type PropsWithChildren, type ReactNode } from 'react' import ReactDOM from 'react-dom' import { X } from 'lucide-react' -import { Span } from '../Span' import { tx, tw } from '../../twind' import type { Languages } from '../../hooks/useLanguage' import type { PropsForTranslation } from '../../hooks/useTranslation' @@ -50,11 +49,11 @@ export const ModalHeader = ({
{title ?? ( - {titleText} - + )} {!!onCloseClick && ( @@ -64,7 +63,7 @@ export const ModalHeader = ({ )}
- {description ?? ({descriptionText})} + {description ?? ({descriptionText})}
) } diff --git a/lib/components/properties/CheckboxProperty.tsx b/lib/components/properties/CheckboxProperty.tsx index e168ccf9..b22ff20d 100644 --- a/lib/components/properties/CheckboxProperty.tsx +++ b/lib/components/properties/CheckboxProperty.tsx @@ -5,7 +5,6 @@ import { Checkbox } from '../user-input/Checkbox' import type { Languages } from '../../hooks/useLanguage' import type { PropsForTranslation } from '../../hooks/useTranslation' import { useTranslation } from '../../hooks/useTranslation' -import { Span } from '../Span' import type { PropertyBaseProps } from './PropertyBase' import { PropertyBase } from './PropertyBase' @@ -58,7 +57,9 @@ export const CheckboxProperty = ({ disabled={readOnly} onChange={onChange} /> - onChange(!value)}>{`${translation.yes}/${translation.no}`} + onChange(!value)}> + {`${translation.yes}/${translation.no}`} +
)} /> diff --git a/lib/components/properties/MultiSelectProperty.tsx b/lib/components/properties/MultiSelectProperty.tsx index cbc7174d..ccb02062 100644 --- a/lib/components/properties/MultiSelectProperty.tsx +++ b/lib/components/properties/MultiSelectProperty.tsx @@ -5,7 +5,6 @@ import type { PropsForTranslation } from '../../hooks/useTranslation' import { useTranslation } from '../../hooks/useTranslation' import type { MultiSelectProps } from '../user-input/MultiSelect' import { MultiSelect } from '../user-input/MultiSelect' -import { Span } from '../Span' import { ChipList } from '../ChipList' import type { PropertyBaseProps } from './PropertyBase' import { PropertyBase } from './PropertyBase' @@ -64,7 +63,7 @@ export const MultiSelectProperty = ({ selectedDisplay={({ items }) => { const selected = items.filter(value => value.selected) if (selected.length === 0) { - return Select + return (Select) } return ( - {suffix && {suffix}} + {suffix && {suffix}}
)} /> diff --git a/lib/components/user-input/Label.tsx b/lib/components/user-input/Label.tsx index 459623e9..28c312bc 100644 --- a/lib/components/user-input/Label.tsx +++ b/lib/components/user-input/Label.tsx @@ -1,6 +1,6 @@ import type { LabelHTMLAttributes } from 'react' -import type { LabelType } from '../Span' -import { Span } from '../Span' + +export type LabelType = 'labelSmall' | 'labelMedium' | 'labelBig' export type LabelProps = { /** The text for the label */ @@ -18,9 +18,15 @@ export const Label = ({ labelType = 'labelSmall', ...props }: LabelProps) => { + const mapping:Record = { + labelSmall: 'textstyle-label-sm', + labelMedium: 'textstyle-label-md', + labelBig: 'textstyle-label-lg', + } + return ( ) } diff --git a/lib/components/user-input/MultiSelect.tsx b/lib/components/user-input/MultiSelect.tsx index fb4edbef..a0c63589 100644 --- a/lib/components/user-input/MultiSelect.tsx +++ b/lib/components/user-input/MultiSelect.tsx @@ -6,7 +6,6 @@ import type { PropsForTranslation } from '../../hooks/useTranslation' import type { Languages } from '../../hooks/useLanguage' import { MultiSearchWithMapping } from '../../util/simpleSearch' import { tx, tw } from '../../twind' -import { Span } from '../Span' import { Menu, MenuItem } from './Menu' import { Input } from './Input' import { Checkbox } from './Checkbox' @@ -95,7 +94,7 @@ export const MultiSelect = ({ const selectedItems = options.filter(value => value.selected) const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select - : {`${selectedItems.length} ${translation.selected}`} + : {`${selectedItems.length} ${translation.selected}`} return (
diff --git a/lib/components/user-input/Select.tsx b/lib/components/user-input/Select.tsx index f43f6299..50ce85db 100644 --- a/lib/components/user-input/Select.tsx +++ b/lib/components/user-input/Select.tsx @@ -2,7 +2,6 @@ import { Menu } from '@headlessui/react' import { ChevronDown, ChevronUp } from 'lucide-react' import type { ReactNode } from 'react' import { tw, tx } from '../../twind' -import { Span } from '../Span' import type { LabelProps } from './Label' import { Label } from './Label' @@ -83,7 +82,7 @@ export const Select = ({ )} disabled={isDisabled} > - {selectedDisplayOverwrite ?? selectedOption?.label ?? hintText} + {selectedDisplayOverwrite ?? selectedOption?.label ?? hintText} {open ? : } ; export const TileVariation: Story = { args: { - title: { value: 'Title', className: '', type: undefined }, - description: { value: 'Description Text', className: '', type: undefined }, + title: { value: 'Title', className: '' }, + description: { value: 'Description Text', className: 'textstyle-description' }, prefix: true, suffix: true, className: '' diff --git a/lib/stories/layout/tile/TileWithImage.stories.tsx b/lib/stories/layout/tile/TileWithImage.stories.tsx index 692ba976..149caf3b 100644 --- a/lib/stories/layout/tile/TileWithImage.stories.tsx +++ b/lib/stories/layout/tile/TileWithImage.stories.tsx @@ -11,7 +11,7 @@ type Story = StoryObj; export const TileWithImageVariation: Story = { args: { - title: { value: 'About helpwave', type: 'title' }, + title: { value: 'About helpwave', className: 'textstyle-title-lg' }, description: { value: 'Regulatory burdens and high barriers to entry make it difficult for small companies to enter the market,' + ' leading to a lack of competition. helpwave is here to change that. We offer a platform that brings everyone to' + diff --git a/lib/stories/other/SearchableList.stories.tsx b/lib/stories/other/SearchableList.stories.tsx index d20ccc3e..ca677429 100644 --- a/lib/stories/other/SearchableList.stories.tsx +++ b/lib/stories/other/SearchableList.stories.tsx @@ -1,6 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' import { SearchableList } from '../../components/SearchableList' -import { Span } from '../../components/Span' const meta = { title: 'Other/SearchableList', @@ -15,7 +14,7 @@ export const SearchableListVariation: Story = { list: ['Apple', 'Banana', 'Pineapple', 'Pear', 'Strawberry', 'Raspberry', 'Wildberry'], initialSearch: '', searchMapping: value => [value], - itemMapper: value => {value}, + itemMapper: value => {value}, className: '', overwriteTranslation: {}, }, diff --git a/lib/stories/other/Translation.stories.tsx b/lib/stories/other/Translation.stories.tsx index a786d302..67f9fd6f 100644 --- a/lib/stories/other/Translation.stories.tsx +++ b/lib/stories/other/Translation.stories.tsx @@ -1,10 +1,51 @@ import type { Meta, StoryObj } from '@storybook/react' -import Title from '../../components/examples/Title' +import type { Languages } from '../../hooks/useLanguage' +import type { PropsForTranslation } from '../../hooks/useTranslation' +import { useTranslation } from '../../hooks/useTranslation' +import { tw } from '../../twind' + +type TranslationExampleTranslation = { + welcome: string, + goodToSeeYou: string, + page: (page: number) => string +} + +const defaultTranslationExampleTranslations: Record = { + en: { + welcome: 'Welcome', + goodToSeeYou: 'Good to see you', + page: (page) => `Page ${page}` + }, + de: { + welcome: 'Willkommen', + goodToSeeYou: 'Schön dich zu sehen', + page: (page) => `Seite ${page}` + } +} + +type TranslationExampleProps = { + name: string +} + +/** + * Simple TranslationExample component to demonstrate some translations + */ +const TranslationExample = ({ overwriteTranslation, name }:PropsForTranslation) => { + const translation = useTranslation(defaultTranslationExampleTranslations, overwriteTranslation) + return ( +

+ {translation.welcome}{'! '} + {translation.goodToSeeYou}{', '} + {name}{'. '} + {translation.page(123)} +

+ ) +} const meta = { title: 'Other/Translation', - component: Title, -} satisfies Meta + component: TranslationExample, +} satisfies Meta export default meta type Story = StoryObj; diff --git a/lib/stories/other/Translation.tsx b/lib/stories/other/Translation.tsx deleted file mode 100644 index c2ceb54a..00000000 --- a/lib/stories/other/Translation.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react' -import Title from '../../components/examples/Title' - -const meta = { - title: 'Other/Translation', - component: Title, -} satisfies Meta - -export default meta -type Story = StoryObj; - -export const Translation: Story = { - args: { - name: 'Max Mustermann', - } -} diff --git a/lib/stories/user-action/input/select/SearchableSelect.stories.tsx b/lib/stories/user-action/input/select/SearchableSelect.stories.tsx index 70dde4bf..dc0bf9bd 100644 --- a/lib/stories/user-action/input/select/SearchableSelect.stories.tsx +++ b/lib/stories/user-action/input/select/SearchableSelect.stories.tsx @@ -1,6 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' import { SearchableSelectExample } from '../../../../components/examples/SearchableSelectExample' -import { Span } from '../../../../components/Span' const meta = { title: 'User-Action/Input/Select', @@ -18,7 +17,7 @@ export const SearchableSelectVariations: Story = { { value: 'Entry 1', label: 'Entry 1' }, { value: 'Entry 2', label: 'Entry 2', disabled: true }, { value: 'Entry 3', label: 'Entry 3' }, - { value: 'Custom styled', label: Custom styled }, + { value: 'Custom styled', label: Custom styled }, { value: 'Entry 5', label: 'Entry 5' }, { value: 'Entry 6', label: 'Entry 6', disabled: true } ], diff --git a/lib/stories/user-action/input/select/Select.stories.tsx b/lib/stories/user-action/input/select/Select.stories.tsx index 21e68ee1..54e077d9 100644 --- a/lib/stories/user-action/input/select/Select.stories.tsx +++ b/lib/stories/user-action/input/select/Select.stories.tsx @@ -1,6 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' import { SelectExample } from '../../../../components/examples/SelectExample' -import { Span } from '../../../../components/Span' const meta = { title: 'User-Action/Input/Select', @@ -18,7 +17,7 @@ export const SelectVariations: Story = { { value: '1', label: 'Entry 1' }, { value: '2', label: 'Entry 2', disabled: true }, { value: '3', label: 'Entry 3' }, - { value: '4', label: Custom styled }, + { value: '4', label: Custom styled }, { value: '5', label: 'Entry 5' }, { value: '6', label: 'Entry 6', disabled: true } ], diff --git a/lib/twind/config.ts b/lib/twind/config.ts index dca83cdf..728aa9f8 100644 --- a/lib/twind/config.ts +++ b/lib/twind/config.ts @@ -5,37 +5,8 @@ import presetTailwindForms from '@twind/preset-tailwind-forms' import presetTypography from '@twind/preset-typography' import { generateShadingColors } from '../coloring/shading' import type { ShadedColors } from '../coloring/types' - -// defaults otherwise provided by tailwind -export const fontFamily = { - sans: [ - 'ui-sans-serif', - 'system-ui', - '-apple-system', - 'BlinkMacSystemFont', - '"Segoe UI"', - 'Roboto', - '"Helvetica Neue"', - 'Arial', - '"Noto Sans"', - 'sans-serif', - '"Apple Color Emoji"', - '"Segoe UI Emoji"', - '"Segoe UI Symbol"', - '"Noto Color Emoji"' - ], - serif: ['ui-serif', 'Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'], - mono: [ - 'ui-monospace', - 'SFMono-Regular', - 'Menlo', - 'Monaco', - 'Consolas', - '"Liberation Mono"', - '"Courier New"', - 'monospace' - ] -} +import { fontFamily } from './typography' +import { textStyles } from './textstyles' export type ScreenTypes = 'desktop' | 'tablet' | 'mobile' const screenSizes: Record = { @@ -199,11 +170,12 @@ export const config = defineConfig({ 'around-md': '0 5px 5px 0 rgba(0, 0, 0, 0.02), 0 -5px 5px 0 rgba(0, 0, 0, 0.02), 5px 0 5px 0 rgba(0, 0, 0, 0.02), -5px 0 5px 0 rgba(0, 0, 0, 0.02)', 'around-lg': '0 10px 10px 0 rgba(0, 0, 0, 0.02), 0 -10px 10px 0 rgba(0, 0, 0, 0.02), 10px 0 10px 0 rgba(0, 0, 0, 0.02), -10px 0 10px 0 rgba(0, 0, 0, 0.02)', 'around-xl': '0 20px 20px 0 rgba(0, 0, 0, 0.02), 0 -20px 20px 0 rgba(0, 0, 0, 0.02), 20px 0 20px 0 rgba(0, 0, 0, 0.02), -20px 0 20px 0 rgba(0, 0, 0, 0.02)', - } - } + }, + }, }, presets: [presetAutoprefix(), presetTailwind(), presetTailwindForms(), presetTypography()], rules: [ + ...textStyles, ['animation-delay-', ({ $$ }) => ({ animationDelay: `${$$}ms` })] ] }) as unknown as TwindConfig // TODO: twind is being very dumb right here, not my fault diff --git a/lib/twind/textstyles.ts b/lib/twind/textstyles.ts new file mode 100644 index 00000000..8fc9b9f8 --- /dev/null +++ b/lib/twind/textstyles.ts @@ -0,0 +1,19 @@ +export const textStyles: [string, string][] = [ + ['textstyle-title-3xl', 'text-5xl font-space font-bold'], + ['textstyle-title-2xl', 'text-4xl font-space font-bold'], + ['textstyle-title-xl', 'text-3xl font-space font-bold'], + ['textstyle-title-lg', 'text-2xl font-space font-bold'], + ['textstyle-title-md', 'text-xl font-space font-bold'], + ['textstyle-title-normal', 'text-lg font-semibold'], + ['textstyle-title-sm', 'font-space font-bold'], + ['textstyle-accent', 'text-sm text-gray-600 font-bold'], + ['textstyle-description', 'text-gray-400'], + ['textstyle-label-lg', 'text-lg font-semibold'], + ['textstyle-label-md', 'text-gray-700 font-semibold'], + ['textstyle-label-sm', 'text-sm text-gray-700 font-semibold'], + ['textstyle-table-name', 'text-lg font-space font-medium'], + ['textstyle-table-header', 'text-gray-600 font-bold'], + ['textstyle-navigation-item', 'font-bold font-space'], + ['textstyle-form-error', 'text-hw-negative-500 text-sm'], + ['textstyle-form-description', 'text-gray-500 text-sm'], +] diff --git a/lib/twind/typography.ts b/lib/twind/typography.ts new file mode 100644 index 00000000..fbefa1d3 --- /dev/null +++ b/lib/twind/typography.ts @@ -0,0 +1,30 @@ +// defaults otherwise provided by tailwind +export const fontFamily = { + sans: [ + 'ui-sans-serif', + 'system-ui', + '-apple-system', + 'BlinkMacSystemFont', + '"Segoe UI"', + 'Roboto', + '"Helvetica Neue"', + 'Arial', + '"Noto Sans"', + 'sans-serif', + '"Apple Color Emoji"', + '"Segoe UI Emoji"', + '"Segoe UI Symbol"', + '"Noto Color Emoji"' + ], + serif: ['ui-serif', 'Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'], + mono: [ + 'ui-monospace', + 'SFMono-Regular', + 'Menlo', + 'Monaco', + 'Consolas', + '"Liberation Mono"', + '"Courier New"', + 'monospace' + ] +} diff --git a/tasks/components/BedInRoomIndicator.tsx b/tasks/components/BedInRoomIndicator.tsx index f054c421..ebdb2a2d 100644 --- a/tasks/components/BedInRoomIndicator.tsx +++ b/tasks/components/BedInRoomIndicator.tsx @@ -1,6 +1,5 @@ import { tw } from '@helpwave/common/twind' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' -import { Span } from '@helpwave/common/components/Span' type BedInRoomIndicatorTranslation = { bed: string, @@ -47,9 +46,9 @@ export const BedInRoomIndicator = return (
{roomName !== undefined && ( - + {`${translation.bed} ${bedPosition + 1} ${translation.in} ${roomName}`} - + )}
{Array.from(Array(bedsInRoom).keys()).map((_, index) => ( diff --git a/tasks/components/ColumnTitle.tsx b/tasks/components/ColumnTitle.tsx index 7dc17285..58397679 100644 --- a/tasks/components/ColumnTitle.tsx +++ b/tasks/components/ColumnTitle.tsx @@ -1,5 +1,4 @@ import { tw, tx } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' type ColumnTitleProps = { title: string, @@ -12,8 +11,8 @@ type ColumnTitleProps = { export const ColumnTitle = ({ title, subtitle }: ColumnTitleProps) => { return (
- {title} - {subtitle} + {title} + {subtitle}
) } diff --git a/tasks/components/Header.tsx b/tasks/components/Header.tsx index 1e58f856..5785703d 100644 --- a/tasks/components/Header.tsx +++ b/tasks/components/Header.tsx @@ -1,7 +1,6 @@ import type { ReactNode } from 'react' import Link from 'next/link' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import { Helpwave } from '@helpwave/common/icons/Helpwave' export type HeaderProps = { @@ -35,7 +34,7 @@ const Header = ({ title, leftSide = [], rightSide = [], withIcon = true }: Heade
)} - {title && {title}} + {title && {title}} {leftSide?.filter(value => value !== undefined).map((value, index) => (
{(index !== 0 || title || withIcon) &&
} diff --git a/tasks/components/KanbanHeader.tsx b/tasks/components/KanbanHeader.tsx index 0c3bae62..7b17c09a 100644 --- a/tasks/components/KanbanHeader.tsx +++ b/tasks/components/KanbanHeader.tsx @@ -2,7 +2,6 @@ import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { Input } from '@helpwave/common/components/user-input/Input' -import { Span } from '@helpwave/common/components/Span' import { ChevronDown } from 'lucide-react' type KanbanHeaderTranslation = { @@ -45,7 +44,7 @@ export const KanbanHeader = ({ const translation = useTranslation(defaultKanbanHeaderTranslations, overwriteTranslation) return (
- {translation.tasks} + {translation.tasks}
{translation.status} diff --git a/tasks/components/MobileInterceptor.tsx b/tasks/components/MobileInterceptor.tsx index e1f1f79b..55fe078e 100644 --- a/tasks/components/MobileInterceptor.tsx +++ b/tasks/components/MobileInterceptor.tsx @@ -1,7 +1,6 @@ import type { NextPage } from 'next' import Link from 'next/link' import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { Helpwave } from '@helpwave/common/icons/Helpwave' import { getConfig } from '@/utils/config' @@ -39,7 +38,7 @@ const MobileInterceptor: NextPage = ({ overwriteTranslation }: PropsForTranslati return (
- {translation.pleaseDownloadApp} + {translation.pleaseDownloadApp} {translation.playStore} {translation.appStore}
diff --git a/tasks/components/NewsDisplay.tsx b/tasks/components/NewsDisplay.tsx index 41b908af..4c83633e 100644 --- a/tasks/components/NewsDisplay.tsx +++ b/tasks/components/NewsDisplay.tsx @@ -1,7 +1,6 @@ import Link from 'next/link' import { tw, tx } from '@helpwave/common/twind' import { TimeDisplay } from '@helpwave/common/components/TimeDisplay' -import { Span } from '@helpwave/common/components/Span' import type { News } from '@helpwave/common/util/news' import Image from 'next/image' @@ -23,7 +22,7 @@ export const NewsDisplay = ({ news, titleOnTop = true }: NewsDisplayProps) => {
- {news.title} + {news.title}
{news.description.map((value, index) => value instanceof URL ? ( @@ -37,7 +36,7 @@ export const NewsDisplay = ({ news, titleOnTop = true }: NewsDisplayProps) => { /> ) : - {value}) + {value}) }
diff --git a/tasks/components/OrganizationForm.tsx b/tasks/components/OrganizationForm.tsx index 138debc8..f9e1c599 100644 --- a/tasks/components/OrganizationForm.tsx +++ b/tasks/components/OrganizationForm.tsx @@ -2,7 +2,6 @@ import { tw, tx } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { Input } from '@helpwave/common/components/user-input/Input' -import { Span } from '@helpwave/common/components/Span' import { validateEmail } from '@helpwave/common/util/emailValidation' import { LoadingAndErrorComponent } from '@helpwave/common/components/LoadingAndErrorComponent' import type { OrganizationMinimalDTO } from '@helpwave/api-services/types/users/organizations' @@ -157,7 +156,7 @@ export const OrganizationForm = ({ loadingProps={{ classname: tw('border-2 border-gray-500 rounded-xl min-h-[350px]') }} minimumLoadingDuration={200} // prevents errors flickering > - {translation.general} + {translation.general}
- {isDisplayingShortNameError && {shortNameErrorMessage}} + {isDisplayingShortNameError && {shortNameErrorMessage}}
- {translation.shortNameDescription} + {translation.shortNameDescription}
- {isDisplayingLongNameError && {longNameErrorMessage}} + {isDisplayingLongNameError && {longNameErrorMessage}}
- {translation.longNameDescription} + {translation.longNameDescription}
@@ -203,12 +202,12 @@ export const OrganizationForm = ({
{ !organizationForm.organization.isVerified && - {translation.notVerified} + {translation.notVerified} }
- {isDisplayingEmailNameError && {emailErrorMessage}} + {isDisplayingEmailNameError && {emailErrorMessage}}
- {translation.contactEmailDescription} + {translation.contactEmailDescription} ) } diff --git a/tasks/components/OrganizationInvitationList.tsx b/tasks/components/OrganizationInvitationList.tsx index 1cc3799e..a648720c 100644 --- a/tasks/components/OrganizationInvitationList.tsx +++ b/tasks/components/OrganizationInvitationList.tsx @@ -3,7 +3,6 @@ import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { defaultTableStatePagination, Table, type TableState } from '@helpwave/common/components/Table' -import { Span } from '@helpwave/common/components/Span' import { Button } from '@helpwave/common/components/Button' import { InputModal } from '@helpwave/common/components/modals/InputModal' import { validateEmail } from '@helpwave/common/util/emailValidation' @@ -136,7 +135,7 @@ export const OrganizationInvitationList = ({ ]} />
- {`${translation.invitations} (${usedInvitations.length})`} + {`${translation.invitations} (${usedInvitations.length})`}
,
- {translation.role} + {translation.role}
, <> ]} @@ -165,18 +164,18 @@ export const OrganizationMemberList = ({
- {orgMember.name} + {orgMember.name} - {orgMember.email} + {orgMember.email}
,
,
diff --git a/tasks/components/RoomList.tsx b/tasks/components/RoomList.tsx index d0f06773..57b908f2 100644 --- a/tasks/components/RoomList.tsx +++ b/tasks/components/RoomList.tsx @@ -5,7 +5,6 @@ import { useContext, useEffect, useState } from 'react' import { ConfirmDialog } from '@helpwave/common/components/modals/ConfirmDialog' import { Button } from '@helpwave/common/components/Button' import { Input } from '@helpwave/common/components/user-input/Input' -import { Span } from '@helpwave/common/components/Span' import { defaultTableStatePagination, defaultTableStateSelection, @@ -182,7 +181,7 @@ export const RoomList = ({ errorProps={{ classname: tw('border-2 border-gray-500 rounded-xl min-h-[200px]') }} >
- {translation.rooms + ` (${usedRooms.length})`} + {translation.rooms + ` (${usedRooms.length})`}
{(tableState.selection && tableState.selection?.currentSelection.length > 0) && (
,
- {room.bedCount} + {room.bedCount}
,
diff --git a/tasks/components/TaskTemplateListColumn.tsx b/tasks/components/TaskTemplateListColumn.tsx index 13680ade..e36fcf1d 100644 --- a/tasks/components/TaskTemplateListColumn.tsx +++ b/tasks/components/TaskTemplateListColumn.tsx @@ -2,7 +2,6 @@ import { useEffect, useRef, useState } from 'react' import { Scrollbars } from 'react-custom-scrollbars-2' import { tw, tx } from '@helpwave/common/twind' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' -import { Span } from '@helpwave/common/components/Span' import { Edit } from 'lucide-react' import type { TaskTemplateDTO } from '@helpwave/api-services/types/tasks/tasks_templates' import { TaskTemplateCard } from './cards/TaskTemplateCard' @@ -53,9 +52,9 @@ export const TaskTemplateListColumn = ({ return (
- + {translation.template} - + {onColumnEditClick && }
diff --git a/tasks/components/TaskTemplateWardPreview.tsx b/tasks/components/TaskTemplateWardPreview.tsx index 85c4075e..10b9bd4b 100644 --- a/tasks/components/TaskTemplateWardPreview.tsx +++ b/tasks/components/TaskTemplateWardPreview.tsx @@ -3,7 +3,6 @@ import { useRouter } from 'next/router' import { tw } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' -import { Span } from '@helpwave/common/components/Span' import { Button } from '@helpwave/common/components/Button' import { LoadingAndErrorComponent } from '@helpwave/common/components/LoadingAndErrorComponent' import { useWardTaskTemplateQuery } from '@helpwave/api-services/mutations/tasks/task_template_mutations' @@ -59,7 +58,7 @@ export const TaskTemplateWardPreview = ({ {taskTemplates && (
- {translation.taskTemplates(taskTemplates.length)} + {translation.taskTemplates(taskTemplates.length)}
- {translation.nameDescription} + {translation.nameDescription} ) } diff --git a/tasks/components/cards/AddCard.tsx b/tasks/components/cards/AddCard.tsx index c53c47d5..ec29e96a 100644 --- a/tasks/components/cards/AddCard.tsx +++ b/tasks/components/cards/AddCard.tsx @@ -1,7 +1,6 @@ import { tw } from '@helpwave/common/twind' import { Plus } from 'lucide-react' import { Card, type CardProps } from '@helpwave/common/components/Card' -import { Span } from '@helpwave/common/components/Span' export type AddCardProps = CardProps & { text?: string, @@ -18,7 +17,7 @@ export const AddCard = ({
- {text && {text}} + {text && {text}}
) diff --git a/tasks/components/cards/BedCard.tsx b/tasks/components/cards/BedCard.tsx index 51ae4211..ae1e5f12 100644 --- a/tasks/components/cards/BedCard.tsx +++ b/tasks/components/cards/BedCard.tsx @@ -1,7 +1,6 @@ import { tw, tx } from '@helpwave/common/twind' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { Plus } from 'lucide-react' -import { Span } from '@helpwave/common/components/Span' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { DragCard, type DragCardProps } from './DragCard' @@ -40,8 +39,8 @@ export const BedCard = ({ (
- {bedName} - {translation.nobody} + {bedName} + {translation.nobody}
diff --git a/tasks/components/cards/PatientCard.tsx b/tasks/components/cards/PatientCard.tsx index 529ff341..e536b116 100644 --- a/tasks/components/cards/PatientCard.tsx +++ b/tasks/components/cards/PatientCard.tsx @@ -1,5 +1,4 @@ import { tw } from '@helpwave/common/twind' -import { Span } from '@helpwave/common/components/Span' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' import { PillLabelsColumn } from '../pill/PillLabelsColumn' @@ -44,8 +43,8 @@ export const PatientCard = ({ return (
- {bedName ?? translation.bedNotAssigned} - {patientName} + {bedName ?? translation.bedNotAssigned} + {patientName}
{!task.isPublicVisible &&
} - {task.name} + {task.name}
- + {task.notes} - +
{assignee && assignee.avatarUrl && } diff --git a/tasks/components/cards/TaskTemplateCard.tsx b/tasks/components/cards/TaskTemplateCard.tsx index 8d34c597..95218d22 100644 --- a/tasks/components/cards/TaskTemplateCard.tsx +++ b/tasks/components/cards/TaskTemplateCard.tsx @@ -1,7 +1,6 @@ import { tw, tx } from '@helpwave/common/twind' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks/useTranslation' -import { Span } from '@helpwave/common/components/Span' import { Chip } from '@helpwave/common/components/ChipList' import { EditCard, type EditCardProps } from './EditCard' @@ -52,7 +51,7 @@ export const TaskTemplateCard = ({ >
- {name} + {name} {typeForLabel && ( )}
- {subtaskCount + ' ' + translation.subtask} + {subtaskCount + ' ' + translation.subtask}
) diff --git a/tasks/components/cards/WardCard.tsx b/tasks/components/cards/WardCard.tsx index e08394ec..ee6f2cd5 100644 --- a/tasks/components/cards/WardCard.tsx +++ b/tasks/components/cards/WardCard.tsx @@ -1,6 +1,5 @@ import { tw, tx } from '@helpwave/common/twind' import { Bed } from 'lucide-react' -import { Span } from '@helpwave/common/components/Span' import type { WardOverviewDTO } from '@helpwave/api-services/types/tasks/wards' import { PillLabelBox } from '../pill/PillLabelBox' import { EditCard, type EditCardProps } from './EditCard' @@ -21,11 +20,11 @@ export const WardCard = ({
- {ward.name} + {ward.name}
- {ward.bedCount} + {ward.bedCount}
- {translation.recent} + {translation.recent} {patients && patients.length > 0 && ( <> - {translation.patients} + {translation.patients}
{patients?.map(patient => ( {wards && wards.length > 0 && ( <> - {translation.wards} + {translation.wards}
{wards?.map(ward => (
- {translation.dangerZone} - {translation.dangerZoneText} + {translation.dangerZone} + {translation.dangerZoneText} )}
@@ -253,7 +252,7 @@ const TaskDetailViewSidebar = ({
{task.createdAt && (
- {translation.creationTime} + {translation.creationTime}
)} diff --git a/tasks/components/layout/TaskTemplateDetails.tsx b/tasks/components/layout/TaskTemplateDetails.tsx index b62f4028..785a978d 100644 --- a/tasks/components/layout/TaskTemplateDetails.tsx +++ b/tasks/components/layout/TaskTemplateDetails.tsx @@ -5,7 +5,6 @@ import { useTranslation, type PropsForTranslation } from '@helpwave/common/hooks import { Button } from '@helpwave/common/components/Button' import { ConfirmDialog } from '@helpwave/common/components/modals/ConfirmDialog' import { Input } from '@helpwave/common/components/user-input/Input' -import { Span } from '@helpwave/common/components/Span' import { Textarea } from '@helpwave/common/components/user-input/Textarea' import type { TaskTemplateDTO } from '@helpwave/api-services/types/tasks/tasks_templates' import { SubtaskView } from '../SubtaskView' @@ -141,7 +140,7 @@ export const TaskTemplateDetails = ({ maxLength={maxNameLength} className={tx(inputClasses, { [inputErrorClasses]: isDisplayingNameError })} /> - {isDisplayingNameError && {nameErrorMessage}} + {isDisplayingNameError && {nameErrorMessage}}