diff --git a/apps/design-system/src/subjects/views/pipeline-list/pipeline-list.tsx b/apps/design-system/src/subjects/views/pipeline-list/pipeline-list.tsx index b5033eb6dd..34cbed97ee 100644 --- a/apps/design-system/src/subjects/views/pipeline-list/pipeline-list.tsx +++ b/apps/design-system/src/subjects/views/pipeline-list/pipeline-list.tsx @@ -24,6 +24,7 @@ const PipelineListWrapper: FC> = () => { /> setCreatePipelineOpen(false)} onSubmit={() => { setCreatePipelineOpen(false) diff --git a/apps/design-system/src/subjects/views/signin/index.tsx b/apps/design-system/src/subjects/views/signin/index.tsx index a3f21993a0..7af71f44a5 100644 --- a/apps/design-system/src/subjects/views/signin/index.tsx +++ b/apps/design-system/src/subjects/views/signin/index.tsx @@ -1,7 +1,7 @@ -import { noop } from '@utils/viewUtils' +import { noop, useTranslationStore } from '@utils/viewUtils' import { SignInPage } from '@harnessio/ui/views' export const SignInView = () => { - return + return } diff --git a/apps/design-system/src/subjects/views/signup/index.tsx b/apps/design-system/src/subjects/views/signup/index.tsx index ac77182174..8cdcc90ab2 100644 --- a/apps/design-system/src/subjects/views/signup/index.tsx +++ b/apps/design-system/src/subjects/views/signup/index.tsx @@ -1,7 +1,7 @@ -import { noop } from '@utils/viewUtils' +import { noop, useTranslationStore } from '@utils/viewUtils' import { SignUpPage } from '@harnessio/ui/views' export const SignUpView = () => { - return + return } diff --git a/apps/gitness/src/pages-v2/pipeline/create-pipeline-dialog.tsx b/apps/gitness/src/pages-v2/pipeline/create-pipeline-dialog.tsx index 5b8e88d26b..83d52fb995 100644 --- a/apps/gitness/src/pages-v2/pipeline/create-pipeline-dialog.tsx +++ b/apps/gitness/src/pages-v2/pipeline/create-pipeline-dialog.tsx @@ -6,6 +6,7 @@ import { CreatePipelineDialog as CreatePipelineDialogView, CreatePipelineFormTyp import { useRoutes } from '../../framework/context/NavigationContext' import { useGetRepoRef } from '../../framework/hooks/useGetRepoPath' +import { useTranslationStore } from '../../i18n/stores/i18n-store' import { PathParams } from '../../RouteDefinitions' import { apiBranches2BranchNames, apiBranches2DefaultBranchName } from '../repo/transform-utils/branch-transform' import { useCreatePipelineStore } from './stores/create-pipeline-dialog.store' @@ -69,6 +70,7 @@ export default function CreatePipelineDialog({ open, onClose }: CreatePipelineDi onSubmit={onSubmit} onCancel={onCloseInternal} useCreatePipelineStore={useCreatePipelineStore} + useTranslationStore={useTranslationStore} /> ) } diff --git a/apps/gitness/src/pages-v2/project/project-import-container.tsx b/apps/gitness/src/pages-v2/project/project-import-container.tsx index d6e1a4ba47..708ed0afd6 100644 --- a/apps/gitness/src/pages-v2/project/project-import-container.tsx +++ b/apps/gitness/src/pages-v2/project/project-import-container.tsx @@ -4,6 +4,7 @@ import { ImporterProviderType, ImportSpaceRequestBody, useImportSpaceMutation } import { ImportProjectFormFields, ImportProjectPage, ProviderOptionsEnum } from '@harnessio/ui/views' import { useRoutes } from '../../framework/context/NavigationContext' +import { useTranslationStore } from '../../i18n/stores/i18n-store' export const ImportProjectContainer = () => { const routes = useRoutes() @@ -53,6 +54,7 @@ export const ImportProjectContainer = () => { onFormCancel={onCancel} isLoading={isLoading} apiErrorsValue={error?.message?.toString()} + useTranslationStore={useTranslationStore} /> ) } diff --git a/apps/gitness/src/pages-v2/repo/repo-create-page.tsx b/apps/gitness/src/pages-v2/repo/repo-create-page.tsx index 2a883c88e7..fee940892f 100644 --- a/apps/gitness/src/pages-v2/repo/repo-create-page.tsx +++ b/apps/gitness/src/pages-v2/repo/repo-create-page.tsx @@ -6,7 +6,7 @@ import { useListGitignoreQuery, useListLicensesQuery } from '@harnessio/code-service-client' -import { FormFields, RepoCreatePage as RepoCreatePageView } from '@harnessio/ui/views' +import { RepoCreateFormFields, RepoCreatePage as RepoCreatePageView } from '@harnessio/ui/views' // import { Toaster } from '../../components-v2/toaster' import { useRoutes } from '../../framework/context/NavigationContext' @@ -21,7 +21,7 @@ export const CreateRepo = () => { const spaceURL = useGetSpaceURLParam() const navigate = useNavigate() - const onSubmit = (data: FormFields) => { + const onSubmit = (data: RepoCreateFormFields) => { const repositoryRequest: OpenapiCreateRepositoryRequest = { default_branch: 'main', parent_ref: spaceURL, diff --git a/apps/gitness/src/pages-v2/repo/repo-import-multiple-container.tsx b/apps/gitness/src/pages-v2/repo/repo-import-multiple-container.tsx index 66e91b751d..6166d306b0 100644 --- a/apps/gitness/src/pages-v2/repo/repo-import-multiple-container.tsx +++ b/apps/gitness/src/pages-v2/repo/repo-import-multiple-container.tsx @@ -7,6 +7,7 @@ import { ImportMultipleReposFormFields, RepoImportMultiplePage } from '@harnessi import { useRoutes } from '../../framework/context/NavigationContext' import { useGetSpaceURLParam } from '../../framework/hooks/useGetSpaceParam' import { useAPIPath } from '../../hooks/useAPIPath' +import { useTranslationStore } from '../../i18n/stores/i18n-store' import { getRepoProviderConfig, PROVIDER_TYPE_MAP } from './constants/import-providers-map' export const ImportMultipleRepos = () => { @@ -73,13 +74,12 @@ export const ImportMultipleRepos = () => { return ( // @TODO: Add loading states and error handling when API is available - <> - - + ) } diff --git a/apps/gitness/src/pages-v2/signin.tsx b/apps/gitness/src/pages-v2/signin.tsx index cbf9f12b63..f41e056910 100644 --- a/apps/gitness/src/pages-v2/signin.tsx +++ b/apps/gitness/src/pages-v2/signin.tsx @@ -5,6 +5,7 @@ import { useOnLoginMutation } from '@harnessio/code-service-client' import { SignInData, SignInPage } from '@harnessio/ui/views' import { useRoutes } from '../framework/context/NavigationContext' +import { useTranslationStore } from '../i18n/stores/i18n-store' export const SignIn: FC = () => { const routes = useRoutes() @@ -32,6 +33,7 @@ export const SignIn: FC = () => { }) }} error={error?.message} + useTranslationStore={useTranslationStore} /> ) } diff --git a/apps/gitness/src/pages-v2/signup.tsx b/apps/gitness/src/pages-v2/signup.tsx index cd0c254c51..61780b239f 100644 --- a/apps/gitness/src/pages-v2/signup.tsx +++ b/apps/gitness/src/pages-v2/signup.tsx @@ -1,12 +1,13 @@ -import { useEffect } from 'react' +import { FC, useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { useOnRegisterMutation } from '@harnessio/code-service-client' import { SignUpData, SignUpPage } from '@harnessio/ui/views' import { useRoutes } from '../framework/context/NavigationContext' +import { useTranslationStore } from '../i18n/stores/i18n-store' -export const SignUp: React.FC = () => { +export const SignUp: FC = () => { const routes = useRoutes() const navigate = useNavigate() @@ -34,5 +35,12 @@ export const SignUp: React.FC = () => { }) } - return + return ( + + ) } diff --git a/apps/gitness/src/pages/pull-request/types/types.ts b/apps/gitness/src/pages/pull-request/types/types.ts index 4870df0de0..33fae22e6f 100644 --- a/apps/gitness/src/pages/pull-request/types/types.ts +++ b/apps/gitness/src/pages/pull-request/types/types.ts @@ -1,6 +1,5 @@ import { DiffModeEnum } from '@git-diff-view/react' import { atom } from 'jotai' -import { z } from 'zod' import { EnumPullReqReviewDecision, @@ -197,11 +196,6 @@ export interface FilterViewProps { export type EnumPullReqReviewDecisionExtended = EnumPullReqReviewDecision | 'outdated' -export const formSchema = z.object({ - title: z.string().min(1, { message: 'Please provide a pull request title' }), - description: z.string().optional() -}) -export type FormFields = z.infer // Automatically generate a type from the schema export const changesInfoAtom = atom<{ path?: string; raw?: string; fileViews?: Map }>({}) export interface TypesDiffStats { diff --git a/packages/ui/locales/en/views.json b/packages/ui/locales/en/views.json index 9d95dbe248..894085c603 100644 --- a/packages/ui/locales/en/views.json +++ b/packages/ui/locales/en/views.json @@ -86,8 +86,10 @@ "targetPatterns": "Target patterns", "createRuleCaption": "Match branches using globstar patterns (e.g.”golden”, “feature-*”, “releases/**”)", "rulePatternPlaceholder": "Enter the target patterns", - "include": "Include", - "exclude": "Exclude", + "ruleTarget": { + "include": "Include", + "exclude": "Exclude" + }, "applyRuleDefaultBranch": "Apply this rule to the default branch", "bypassList": "Bypass list", "selectUsers": "Select users", @@ -110,13 +112,95 @@ "viewRules": "View Rules", "browse": "Browse", "deleteBranch": "Delete Branch", + "createBranchDialog": { + "branchNameLabel": "Branch name", + "validation": { + "target": "Target branch" + }, + "branchNamePlaceholder": "Enter branch name" + }, "createBranchTitle": "Create a branch", "createBranchButton": "Create branch", "newBranch": "New branch", - "createNewRepo": "Create a new repository", - "repoContains": "A repository contains all project files, including the revision history. Already have a project repository elsewhere?", - "importRepo": "Import a repository", + "repoCreate": { + "nameLabel": "Name", + "descriptionLabel": "Description", + "validation": { + "access": "Please select who has access" + }, + "title": "Create a new repository", + "description": "A repository contains all project files, including the revision history. Already have a project repository elsewhere?", + "importRepo": "Import a repository", + "namePlaceholder": "Enter repository name", + "descriptionPlaceholder": "Enter a description of this repository", + "gitignorePlaceholder": "Select", + "gitignoreLabel": "Add .gitignore", + "gitignoreCaption": "Choose which files not to track from a list of templates.", + "licensePlaceholder": "Select", + "licenseLabel": "Choose a license", + "licenseCaption": "A license tells others what they can and can't do with your code.", + "access": { + "legend": "Who has access", + "publicOptionLabel": "Public", + "publicOptionDescription": "Anyone with access to the Gitness environment can clone this repo.", + "privateOptionLabel": "Private", + "privateOptionDescription": "You choose who can see and commit to this repository." + }, + "initialize": { + "label": "Initialize this repository with", + "readmeLabel": "Add a README file", + "readmeDescription": "This is where you can write a long description for your project" + }, + "create": { + "create": "Create repository", + "creating": "Creating repository..." + }, + "cancel": "Cancel" + }, "emptyRepo": "This repository is empty.", + "importRepo": { + "providerLabel": "Git provider", + "organizationLabel": "Organization", + "hostLabel": "Host URL", + "workspaceLabel": "Workspace", + "groupLabel": "Group", + "projectLabel": "Project", + "importMultipleTitle": "Import Repositories", + "providerPlaceholder": "Select", + "hostPlaceholder": "Enter the host URL", + "usernameLabel": "Username", + "usernamePlaceholder": "Enter your username", + "accessInput": { + "passwordLabel": "Password", + "tokenLabel": "Token", + "passwordPlaceholder": "Enter your password", + "tokenPlaceholder": "Enter your access token" + }, + "groupPlaceholder": "Enter the group name", + "workspacePlaceholder": "Enter the workspace name", + "organizationPlaceholder": "Enter the organization name", + "projectPlaceholder": "Enter the project name", + "repositoriesOption": "Repositories", + "pipelinesOption": "Pipelines", + "importMultipleButton": { + "import": "Import repositories", + "importing": "Importing repositories..." + }, + "cancelButton": "Cancel", + "repositoryNameLabel": "Repository name", + "repositoryLabel": "Repository", + "importTitle": "Import a repository", + "repositoryPlaceholder": "Enter the repository name", + "authorizationOption": "Authorization", + "importPipelinesOption": "Import Pipelines", + "repositoryNamePlaceholder": "Enter the repository name", + "repositoryDescriptionLabel": "Description", + "repositoryDescriptionPlaceholder": "Enter the repository description", + "importButton": { + "import": "Import repository", + "importing": "Importing repository..." + } + }, "repositories": "Repositories", "import-repository": "Import repository", "import-repositories": "Import repositories", @@ -183,38 +267,7 @@ "updatingWebhook": "Updating webhook...", "creatingWebhook": "Creating webhook...", "updateWebhook": "Update webhook", - "createWebhook": "Create webhook", - "deleteConnector": "Delete Connector", - "deleteSecret": "Delete Secret", - "status": "Status", - "tagger": "Tagger", - "creationDate": "Creation date", - "createBranchDialog": { - "validation": { - "name": "Branch name is required", - "nameRegex": "Name must contain only letters, numbers, and the characters: - _ .", - "noSpaces": "Name cannot contain spaces", - "target": "Base branch is required" - } - }, - "createTagDialog": { - "validation": { - "name": "Tag name is required", - "nameMax": "Name must be no longer than 40 characters", - "nameRegex": "Name must contain only letters, numbers, and the characters: - _ .", - "noSpaces": "Name cannot contain spaces", - "target": "Base branch is required", - "message": "Description is required" - }, - "name": "Name", - "target": "Target", - "message": "Message" - }, - "renameBranch": "Rename Branch", - "add": "Add", - "users": "Users", - "clone": "Clone", - "addFile": "Add file" + "createWebhook": "Create webhook" }, "noData": { "noResults": "No search results", @@ -267,6 +320,56 @@ "noLabels": "No labels yet", "noLabelsDescription": "Use labels to organize, prioritize, and categorize tasks efficiently." }, + "utils": { + "validation": { + "required": "{{name}} is required", + "invalid": "{{name}} is invalid", + "minLength": "{{name}} must be at least {{length}} characters", + "maxLength": "{{name}} must be no longer than {{length}} characters", + "specialSymbols": "{{name}} must contain only letters, numbers, and the characters: - _ .", + "noSpaces": "{{name}} cannot contain spaces" + } + }, + "signIn": { + "emailTitle": "Username/Email", + "passwordTitle": "Password", + "checkDetails": "Please check your details", + "pageTitle": "Sign in to Harness", + "pageDescription": "Welcome back! Please enter your details.", + "emailDescription": "Your email", + "passwordDescription": "Password", + "buttonText": { + "signingIn": "Signing in...", + "signIn": "Sign in" + }, + "signUpLink": { + "question": "Don’t have an account?", + "linkText": "Sign up" + } + }, + "signUp": { + "userIDPlaceholder": "User ID", + "emailLabel": "Email", + "passwordLabel": "Password", + "validation": { + "passwordsCheck": "Passwords don't match" + }, + "pageTitle": "Sign up to Harness", + "pageDescription": "Let’s start your journey with us today.", + "userIDLabel": "User ID", + "emailPlaceholder": "Your email", + "passwordPlaceholder": "Password (6+ characters)", + "confirmPasswordPlaceholder": "Confirm password", + "confirmPasswordLabel": "Confirm password", + "buttonText": { + "signingUp": "Signing up...", + "signUp": "Sign up" + }, + "signInLink": { + "question": "Already have an account?", + "linkText": "Sign in" + } + }, "notFound": { "button": "Reload page", "title": "Something went wrong…", @@ -276,9 +379,7 @@ "search": "Search", "connectors": { "createNew": "Create new connector", - "delete": "Delete Connector", - "updated": "Last updated", - "lastConnected": "Last connected" + "delete": "Delete Connector" }, "execution": { "summary": "Summary", @@ -319,11 +420,11 @@ "projectSettings": { "newLabels": "Create label", "general": { + "projectNameLabel": "Project name", + "projectDescriptionLabel": "Description", "mainTitle": "General settings", "projectNamePlaceholder": "Enter project name", - "projectNameLabel": "Project name", "projectDescriptionPlaceholder": "Enter description (optional)", - "projectDescriptionLabel": "Description", "formSubmitButton": { "savingState": "Saving...", "defaultState": "Save changes", @@ -334,9 +435,9 @@ "deleteProjectDescription": "This will permanently delete this project, and everything contained in it. All repositories in it will also be deleted.", "deleteProjectButton": "Delete project" }, - "newMember": "New member", "member": "Member", "role": "Role", + "newMember": "New member", "addMember": "Add member to this project", "membersTable": { "user": "User", @@ -378,6 +479,11 @@ "compareChangesFormTitleLabel": "Title", "compareChangesFormDescriptionPlaceholder": "Add Pull Request description here.", "compareChangesFormDescriptionLabel": "Description", + "compare": { + "validation": { + "title": "Pull request title" + } + }, "compareChanges": "Comparing changes", "compareChangesDescription": "Choose two branches to see what’s changed or to start a new pull request.", "compareChangesAbleToMerge": "Able to merge.", @@ -412,6 +518,7 @@ "split": "Split", "unified": "Unified", "viewed": "Viewed", + "compareChangesCantMergeDesciption": "You can still create the pull request.", "compareChangesForkLink": "compare across forks", "compareChangesOr": "or", "compareChangesDiffLink": "learn more about diff comparisons", @@ -428,28 +535,57 @@ "fileNoChanges": "File without changes.", "binaryNotShown": "Binary file not shown." }, + "pipelines": { + "createPipelineDialog": { + "nameLabel": "Pipeline name", + "branchLabel": "Branch", + "yamlPathLabel": "Yaml path", + "dialogTitle": "Create Pipeline", + "branchPlaceholder": "Select", + "cancelButton": "Cancel", + "createButton": "Create Pipeline" + } + }, "profileSettings": { - "newSshKey": "New SSH key", - "enterNamePlaceholder": "Enter the name", - "publicKey": "Public key", - "cancel": "Cancel", - "save": "Save", + "sshKey": { + "validation": { + "name": "Key name" + }, + "publicKey": "Public key", + "newSshKey": "New SSH key", + "enterNamePlaceholder": "Enter the name", + "enterPublicKeyPlaceholder": "Enter the public key", + "cancel": "Cancel", + "save": "Save" + }, "name": "Name", "added": "Added", "lastUsedDate": "Last used date", "deleteSshKey": "Delete SSH key", "noDataKeysDescription": "There are no SSH keys associated with this account.", - "createToken": "Create a token", - "enterTokenPlaceholder": "Enter token name", - "expiration": "Expiration", - "token": "Token", - "tokenSuccessDescription": "Your token has been generated. Please make sure to copy and store your token somewhere safe, you won’t beable to see it again.", - "select": "Select", - "tokenExpiryNone": "Token will never expire", - "tokenExpiryDate": " Token will expire on", - "gotItButton": "Got it", - "generateTokenButton": "Generate token", - "generatingTokenButton": "Generating token...", + "createTokenDialog": { + "nameLabel": "Name", + "expirationLabel": "Expiration", + "expirationOptions": { + "7_days": "7 days", + "30_days": "30 days", + "60_days": "60 days", + "90_days": "90 days", + "never": "Never" + }, + "tokenExpiryNone": "Token will never expire", + "tokenExpiryDate": "Token will expire on", + "title": "Create a token", + "namePlaceholder": "Enter token name", + "expiration": "Expiration", + "tokenFieldLabel": "Token", + "successDescription": "Your token has been generated. Please make sure to copy and store your token somewhere safe, you won’t be able to see it again.", + "expirationPlaceholder": "Select", + "gotItButton": "Got it", + "cancelButton": "Cancel", + "generateButton": "Generate token", + "generatingButton": "Generating token..." + }, "tokenTableHeader": "Token", "statusTableHeader": "Status", "expirationDateTableHeader": "Expiration date", @@ -458,30 +594,22 @@ "noExpiration": "No Expiration", "deleteToken": "Delete token", "noTokenDescription": "There are no personal access tokens associated with this account.", + "username": "Username", + "accountEmail": "Account email", + "newPassword": "New password", "validation": { - "nameMin": "Please provide your name", - "nameMax": "Name must be no longer than 256 characters", - "usernameMin": "Please provide a username", - "emailInvalid": "Please provide a valid email address", - "emailMax": "Email must be no longer than 250 characters", - "passwordMin": "New password must be at least 6 characters", - "passwordMax": "New password must be no longer than 128 characters", - "confirmPasswordMin": "Please confirm your new password", "passwordsDoNotMatch": "Passwords do not match" }, "accountSettings": "Account settings", "personalInfo": "Personal information", + "enterNamePlaceholder": "Enter your name", "enterUsernamePlaceholder": "Enter your username", - "username": "Username", - "enterUsernameCaption": "This username will be shown across the platform.", - "accountEmail": "Account email", "updatingProfileButton": "Updating...", "updateProfileButton": "Update profile", "updatedButton": "Updated", "passwordSettingsTitle": "Password settings", "passwordSettingsDesc": "Minimum of 6 characters long containing at least one number and a mixture of uppercase and lowercase letters.", "enterPasswordPlaceholder": "Enter a new password", - "newPassword": "New password", "confirmPasswordPlaceholder": "Confirm your new password", "confirmPassword": "Confirm password", "updating": "Updating...", @@ -493,24 +621,18 @@ "sshKeys": "My SSH keys", "addSshKeyDescription": "SSH keys allow you to establish a secure connection to your code repository.", "addSshKey": "Add new SSH key", - "saving": "Saving...", - "generalTab": "General", - "keysTab": "Keys and Tokens" + "enterUsernameCaption": "This username will be shown across the platform." }, "createProject": { - "validation": { - "nameNoEmpty": "The field can’t be blank", - "nameMinLength": "The project name should be at least 4 characters" - }, - "backButton": "Back", - "title": "Create your new project", - "description": "Organize your repositories, pipelines and more.", "form": { "name": "Project name", - "namePlaceholder": "Enter your project name", "description": "Description", + "namePlaceholder": "Enter your project name", "descriptionPlaceholder": "Enter a description (optional)" }, + "backButton": "Back", + "title": "Create your new project", + "description": "Organize your repositories, pipelines and more.", "create": { "projectCreation": "Creating project...", "createProject": "Create project" @@ -520,20 +642,33 @@ "link": "Log out" } }, + "importProject": { + "projectNameLabel": "Name", + "descriptionLabel": "Description", + "gitProviderLabel": "Git provider", + "organizationLabel": "Organization", + "hostUrlLabel": "Host URL", + "title": "Import a project", + "gitProviderPlaceholder": "Select provider", + "hostUrlPlaceholder": "Enter the host URL", + "tokenLabel": "Token", + "tokenPlaceholder": "Enter your access token", + "organizationPlaceholder": "Enter the organization name", + "repositoriesLabel": "Repositories", + "pipelinesLabel": "Import Pipelines", + "projectNamePlaceholder": "Enter repository name", + "descriptionPlaceholder": "Enter a description", + "importButton": { + "default": "Import project", + "importing": "Importing project..." + }, + "cancelButton": "Cancel" + }, "forms": { "selectMember": "Select member", "selectRole": "Select role", - "enterBranchName": "Enter branch name", - "createBranchError": "Branch name is required", - "enterTagName": "Enter a tag name here", - "tagName": "Name", - "basedOn": "Based on", - "select": "Select", - "baseBranch": "Base branch", - "selectBranchError": "Base branch is required", - "baseTag": "Based on", - "selectMemberError": "Member is required", - "selectRoleError": "Role is required" + "enterTagName": "Enter tag name", + "createBranchError": "" }, "roles": { "owner": "Owner", @@ -604,8 +739,7 @@ "validation": { "userIdRequired": "Please provide a user ID", "invalidEmail": "Please enter a valid email address", - "displayNameRequired": "Please provide a display name", - "emailInvalid": "Please enter a valid email" + "displayNameRequired": "Please provide a display name" } }, "userId": "User ID", diff --git a/packages/ui/locales/fr/views.json b/packages/ui/locales/fr/views.json index fbb9c46073..4874a62752 100644 --- a/packages/ui/locales/fr/views.json +++ b/packages/ui/locales/fr/views.json @@ -86,8 +86,10 @@ "targetPatterns": "Modèles cibles", "createRuleCaption": "Définir les branches correspondant aux modèles globaux (ex : 'feature-*', 'release/**')", "rulePatternPlaceholder": "Enter the target patterns", - "include": "Include", - "exclude": "Exclude", + "ruleTarget": { + "include": "Include", + "exclude": "Exclude" + }, "applyRuleDefaultBranch": "Appliquer la règle à la branche par défaut", "bypassList": "Liste de contournement", "selectUsers": "Sélectionner les utilisateurs", @@ -108,15 +110,97 @@ "pullRequest": "Pull Request", "newPullReq": "Nouvelle requête de tirage", "viewRules": "Voir les règles", - "browse": "Browse", - "deleteBranch": "Delete Branch", + "browse": "Parcourir", + "deleteBranch": "Supprimer la branche", + "createBranchDialog": { + "branchNameLabel": "Nom de la branche", + "validation": { + "target": "Branche cible" + }, + "branchNamePlaceholder": "Entrez le nom de la branche" + }, "createBranchTitle": "Créer une branche", "createBranchButton": "Créer une branche", "newBranch": "Nouvelle branche", - "createNewRepo": "Create a new repository", - "repoContains": "A repository contains all project files, including the revision history. Already have a project repository elsewhere?", - "importRepo": "Import a repository", + "repoCreate": { + "nameLabel": "Nom", + "descriptionLabel": "Description", + "validation": { + "access": "Veuillez sélectionner qui a accès" + }, + "title": "Créer un nouveau dépôt", + "description": "Un dépôt contient tous les fichiers du projet, y compris l'historique des révisions. Vous avez déjà un dépôt de projet ailleurs ?", + "importRepo": "Importer un dépôt", + "namePlaceholder": "Entrez le nom du dépôt", + "descriptionPlaceholder": "Entrez une description de ce dépôt", + "gitignorePlaceholder": "Sélectionner", + "gitignoreLabel": "Ajouter .gitignore", + "gitignoreCaption": "Choisissez quels fichiers ne pas suivre à partir d'une liste de modèles.", + "licensePlaceholder": "Sélectionner", + "licenseLabel": "Choisir une licence", + "licenseCaption": "Une licence indique aux autres ce qu'ils peuvent et ne peuvent pas faire avec votre code.", + "access": { + "legend": "Qui a accès", + "publicOptionLabel": "Public", + "publicOptionDescription": "Toute personne ayant accès à l'environnement Gitness peut cloner ce dépôt.", + "privateOptionLabel": "Privé", + "privateOptionDescription": "Vous choisissez qui peut voir et contribuer à ce dépôt." + }, + "initialize": { + "label": "Initialiser ce dépôt avec", + "readmeLabel": "Ajouter un fichier README", + "readmeDescription": "C'est ici que vous pouvez écrire une longue description pour votre projet" + }, + "create": { + "create": "Créer un dépôt", + "creating": "Création du dépôt..." + }, + "cancel": "Annuler" + }, "emptyRepo": "Ce référentiel est vide.", + "importRepo": { + "providerLabel": "Fournisseur Git", + "organizationLabel": "Organisation", + "hostLabel": "URL d'hôte", + "workspaceLabel": "Espace de travail", + "groupLabel": "Groupe", + "projectLabel": "Projet", + "importMultipleTitle": "Importer des dépôts", + "providerPlaceholder": "Sélectionner", + "hostPlaceholder": "Entrez l'URL d'hôte", + "usernameLabel": "Nom d'utilisateur", + "usernamePlaceholder": "Entrez votre nom d'utilisateur", + "accessInput": { + "passwordLabel": "Mot de passe", + "tokenLabel": "Jeton", + "passwordPlaceholder": "Entrez votre mot de passe", + "tokenPlaceholder": "Entrez votre jeton d'accès" + }, + "groupPlaceholder": "Entrez le nom du groupe", + "workspacePlaceholder": "Entrez le nom de l'espace de travail", + "organizationPlaceholder": "Entrez le nom de l'organisation", + "projectPlaceholder": "Entrez le nom du projet", + "repositoriesOption": "Dépôts", + "pipelinesOption": "Pipelines", + "importMultipleButton": { + "import": "Importer des dépôts", + "importing": "Importation des dépôts..." + }, + "cancelButton": "Annuler", + "repositoryNameLabel": "Nom du dépôt", + "repositoryLabel": "Dépôt", + "importTitle": "Importer un dépôt", + "repositoryPlaceholder": "Entrez le nom du dépôt", + "authorizationOption": "Autorisation", + "importPipelinesOption": "Importer les pipelines", + "repositoryNamePlaceholder": "Entrez le nom du dépôt", + "repositoryDescriptionLabel": "Description", + "repositoryDescriptionPlaceholder": "Entrez la description du dépôt", + "importButton": { + "import": "Importer le dépôt", + "importing": "Importation du dépôt..." + } + }, "repositories": "Dépôts", "import-repository": "Importer un dépôt", "import-repositories": "Import repositories", @@ -183,14 +267,7 @@ "updatingWebhook": "Updating webhook...", "creatingWebhook": "Creating webhook...", "updateWebhook": "Update webhook", - "createWebhook": "Create webhook", - "status": "Statut", - "tagger": "Tagger", - "renameBranch": "Renommer la branche", - "add": "Ajouter", - "users": "Utilisateurs", - "clone": "Cloner", - "addFile": "Ajouter un fichier" + "createWebhook": "Create webhook" }, "noData": { "noResults": "Aucun résultat de recherche", @@ -241,16 +318,66 @@ "noLabels": "No labels yet", "noLabelsDescription": "Use labels to organize, prioritize, and categorize tasks efficiently." }, + "utils": { + "validation": { + "required": "{{name}} est requis", + "invalid": "{{name}} est invalide", + "minLength": "{{name}} doit comporter au moins {{length}} caractères", + "maxLength": "{{name}} ne doit pas dépasser {{length}} caractères", + "specialSymbols": "{{name}} doit contenir uniquement des lettres, des chiffres et les caractères : - _ .", + "noSpaces": "{{name}} ne peut pas contenir d'espaces" + } + }, + "signIn": { + "emailTitle": "Nom d'utilisateur/Adresse e-mail", + "passwordTitle": "Mot de passe", + "checkDetails": "Please check your details", + "pageTitle": "Se connecter à Harness", + "pageDescription": "Bienvenue ! Veuillez entrer vos informations.", + "emailDescription": "Votre adresse e-mail", + "passwordDescription": "Mot de passe", + "buttonText": { + "signingIn": "Connexion en cours...", + "signIn": "Se connecter" + }, + "signUpLink": { + "question": "Vous n'avez pas de compte ?", + "linkText": "S'inscrire" + } + }, + "signUp": { + "userIDPlaceholder": "ID utilisateur", + "emailLabel": "Adresse e-mail", + "passwordLabel": "Mot de passe", + "validation": { + "passwordsCheck": "Les mots de passe ne correspondent pas" + }, + "pageTitle": "S'inscrire à Harness", + "pageDescription": "Commencez votre aventure avec nous dès aujourd'hui.", + "userIDLabel": "ID utilisateur", + "emailPlaceholder": "Votre adresse e-mail", + "passwordPlaceholder": "Mot de passe (6 caractères minimum)", + "confirmPasswordPlaceholder": "Confirmer le mot de passe", + "confirmPasswordLabel": "Confirmer le mot de passe", + "buttonText": { + "signingUp": "Inscription en cours...", + "signUp": "S'inscrire" + }, + "signInLink": { + "question": "Vous avez déjà un compte ?", + "linkText": "Se connecter" + } + }, "notFound": { "button": "Recharger la page", "title": "Quelque chose s'est mal passé…", "descriptionWithType": "La page demandée est introuvable. Vous pouvez revenir pour voir tous les {{type}} et gérer vos paramètres.", "description": "La page demandée est introuvable." }, - "search": "Rechercher", + "search": "Search", "connectors": { - "createNew": "Créer un nouveau connecteur", - "delete": "Supprimer le connecteur" + "createNew": "Create new connector", + "delete": "Delete Connector" }, "execution": { "summary": "Résumé", @@ -258,7 +385,7 @@ "graph": "Graphique", "inputs": "Entrées", "opa": "Évaluations de politique", - "artifacts": "Artéfacts", + "artifacts": "Artefacts", "tests": "Tests", "sto": "Tests de sécurité", "secrets": "Secrets" @@ -289,44 +416,44 @@ "create": "Create labels" }, "projectSettings": { - "newLabels": "Create label", + "newLabels": "Créer une étiquette", "general": { - "mainTitle": "", - "projectNamePlaceholder": "", - "projectNameLabel": "", - "projectDescriptionPlaceholder": "", - "projectDescriptionLabel": "", + "projectNameLabel": "Nom du projet", + "projectDescriptionLabel": "Description", + "mainTitle": "Paramètres généraux", + "projectNamePlaceholder": "Entrer le nom du projet", + "projectDescriptionPlaceholder": "Entrer une description (facultatif)", "formSubmitButton": { - "savingState": "", - "defaultState": "", - "savedState": "" + "savingState": "Enregistrement...", + "defaultState": "Enregistrer les modifications", + "savedState": "Enregistré" }, - "formCancelButton": "Cancel", - "deleteProjectTitle": "", - "deleteProjectDescription": "", - "deleteProjectButton": "" + "formCancelButton": "Annuler", + "deleteProjectTitle": "Supprimer le projet", + "deleteProjectDescription": "Cela supprimera définitivement ce projet et tout ce qu'il contient. Tous les référentiels qu'il contient seront également supprimés.", + "deleteProjectButton": "Supprimer le projet" }, - "newMember": "", - "member": "", - "role": "", - "addMember": "", + "member": "Membre", + "role": "Rôle", + "newMember": "Nouveau membre", + "addMember": "Ajouter un membre à ce projet", "membersTable": { - "user": "User", - "email": "Email", - "role": "Role" + "user": "Utilisateur", + "email": "Adresse e-mail", + "role": "Rôle" }, - "removeMember": "Remove member", - "inviteNewMember": "Invite new member", - "members": "", - "rules": "Rules", - "addRule": "Add new rule", + "removeMember": "Supprimer le membre", + "inviteNewMember": "Inviter un nouveau membre", + "members": "Membres", + "rules": "Règles", + "addRule": "Ajouter une nouvelle règle", "tabs": { - "general": "General", - "members": "Members", - "labels": "Labels", - "rules": "Rules" + "general": "Général", + "members": "Membres", + "labels": "Étiquettes", + "rules": "Règles" }, - "newBranchRule": "New branch rule" + "newBranchRule": "Nouvelle règle de branche" }, "landingPage": { "selectProject": "Sélectionnez un projet pour commencer", @@ -350,6 +477,11 @@ "compareChangesFormTitleLabel": "Title", "compareChangesFormDescriptionPlaceholder": "Ajoutez la description de la pull request ici.", "compareChangesFormDescriptionLabel": "Description", + "compare": { + "validation": { + "title": "Titre de la demande de fusion" + } + }, "compareChanges": "Comparaison des modifications", "compareChangesDescription": "Choisissez deux branches pour voir les modifications ou pour créer une nouvelle pull request. Si nécessaire, vous pouvez aussi", "compareChangesAbleToMerge": "Fusion possible.", @@ -384,6 +516,7 @@ "split": "Diviser", "unified": "Unifié", "viewed": "Vu", + "compareChangesCantMergeDesciption": "Vous pouvez quand même créer la pull request.", "compareChangesForkLink": "comparer entre les forks", "compareChangesOr": "ou", "compareChangesDiffLink": "en savoir plus sur les comparaisons diff", @@ -396,89 +529,107 @@ "fileNoChanges": "Fichier sans modifications.", "binaryNotShown": "Fichier binaire non affiché." }, + "pipelines": { + "createPipelineDialog": { + "nameLabel": "Nom du pipeline", + "branchLabel": "Branche", + "yamlPathLabel": "Chemin YAML", + "dialogTitle": "Créer un pipeline", + "branchPlaceholder": "Sélectionner", + "cancelButton": "Annuler", + "createButton": "Créer le pipeline" + } + }, "profileSettings": { - "newSshKey": "Nouvelle clé SSH", - "enterNamePlaceholder": "Entrez le nom", - "publicKey": "Clé publique", - "cancel": "Annuler", - "save": "Enregistrer", + "sshKey": { + "validation": { + "name": "Nom de la clé" + }, + "publicKey": "Clé publique", + "newSshKey": "Nouvelle clé SSH", + "enterNamePlaceholder": "Entrer le nom", + "enterPublicKeyPlaceholder": "Entrez la clé publique", + "cancel": "Annuler", + "save": "Enregistrer" + }, "name": "Nom", "added": "Ajouté", - "lastUsedDate": "Dernière date d'utilisation", - "deleteSshKey": "Delete SSH key", - "noDataKeysDescription": "Il n'y a aucune clé SSH associée à ce compte.", - "createToken": "Créer un jeton", - "enterTokenPlaceholder": "Entrez le nom du jeton", - "expiration": "Expiration", - "token": "Jeton", - "tokenSuccessDescription": "Votre jeton a été généré. Assurez-vous de copier et de stocker votre jeton en lieu sûr, car vous ne pourrez plus le voir.", - "select": "Sélectionner", - "tokenExpiryNone": "Le jeton n'expirera jamais", - "tokenExpiryDate": "Le jeton expirera le", - "gotItButton": "Compris", - "generateTokenButton": "Générer le jeton", - "generatingTokenButton": "Génération du jeton...", + "lastUsedDate": "Date de dernière utilisation", + "deleteSshKey": "Supprimer la clé SSH", + "noDataKeysDescription": "Il n'y a pas de clés SSH associées à ce compte.", + "createTokenDialog": { + "nameLabel": "Nom", + "expirationLabel": "Expiration", + "expirationOptions": { + "7_days": "7 jours", + "30_days": "30 jours", + "60_days": "60 jours", + "90_days": "90 jours", + "never": "Jamais" + }, + "tokenExpiryNone": "Le jeton n'expirera jamais", + "tokenExpiryDate": "Le jeton expirera le", + "title": "Créer un jeton", + "namePlaceholder": "Entrer le nom du jeton", + "expiration": "Expiration", + "tokenFieldLabel": "Jeton", + "successDescription": "Votre jeton a été généré. Assurez-vous de copier et stocker votre jeton en lieu sûr, vous ne pourrez pas le voir à nouveau.", + "expirationPlaceholder": "Sélectionner", + "gotItButton": "Compris", + "cancelButton": "Annuler", + "generateButton": "Générer le jeton", + "generatingButton": "Génération du jeton..." + }, "tokenTableHeader": "Jeton", - "statusTableHeader": "Statut", + "statusTableHeader": "État", "expirationDateTableHeader": "Date d'expiration", "createdTableHeader": "Créé", "active": "Actif", "noExpiration": "Pas d'expiration", - "deleteToken": "Delete token", - "noTokenDescription": "Il n'y a aucun jeton d'accès personnel associé à ce compte.", + "deleteToken": "Supprimer le jeton", + "noTokenDescription": "Il n'y a pas de jetons d'accès personnel associés à ce compte.", + "username": "Nom d'utilisateur", + "accountEmail": "Adresse e-mail du compte", + "newPassword": "Nouveau mot de passe", "validation": { - "nameMin": "Veuillez indiquer votre nom", - "nameMax": "Le nom ne doit pas dépasser 256 caractères", - "usernameMin": "Veuillez fournir un nom d'utilisateur", - "emailInvalid": "Veuillez fournir une adresse e-mail valide", - "emailMax": "L'e-mail ne doit pas dépasser 250 caractères", - "passwordMin": "Le nouveau mot de passe doit contenir au moins 6 caractères", - "passwordMax": "Le nouveau mot de passe ne doit pas dépasser 128 caractères", - "confirmPasswordMin": "Veuillez confirmer votre nouveau mot de passe", "passwordsDoNotMatch": "Les mots de passe ne correspondent pas" }, "accountSettings": "Paramètres du compte", "personalInfo": "Informations personnelles", - "enterUsernamePlaceholder": "Entrez votre nom d'utilisateur", - "username": "Nom d'utilisateur", - "enterUsernameCaption": "Ce nom d'utilisateur sera affiché sur toute la plateforme.", - "accountEmail": "Email du compte", + "enterNamePlaceholder": "Entrer votre nom", + "enterUsernamePlaceholder": "Entrer votre nom d'utilisateur", "updatingProfileButton": "Mise à jour...", "updateProfileButton": "Mettre à jour le profil", "updatedButton": "Mis à jour", - "passwordSettingsTitle": "Paramètres du mot de passe", - "passwordSettingsDesc": "Minimum 6 caractères contenant au moins un chiffre et un mélange de lettres majuscules et minuscules.", - "enterPasswordPlaceholder": "Entrez un nouveau mot de passe", - "newPassword": "Nouveau mot de passe", - "confirmPasswordPlaceholder": "Confirmez votre nouveau mot de passe", + "passwordSettingsTitle": "Paramètres de mot de passe", + "passwordSettingsDesc": "Minimum de 6 caractères, contenant au moins un chiffre et un mélange de lettres majuscules et minuscules.", + "enterPasswordPlaceholder": "Entrer un nouveau mot de passe", + "confirmPasswordPlaceholder": "Confirmer votre nouveau mot de passe", "confirmPassword": "Confirmer le mot de passe", "updating": "Mise à jour...", "updatePassword": "Mettre à jour le mot de passe", "keysAndTokens": "Clés et jetons", "personalAccessToken": "Jeton d'accès personnel", - "addTokenDescription": "Les jetons d'accès personnels vous permettent de vous authentifier avec l'API.", + "addTokenDescription": "Les jetons d'accès personnel vous permettent d'authentifier avec l'API.", "addToken": "Ajouter un nouveau jeton", "sshKeys": "Mes clés SSH", - "addSshKeyDescription": "Les clés SSH vous permettent d'établir une connexion sécurisée avec votre dépôt de code.", + "addSshKeyDescription": "Les clés SSH vous permettent d'établir une connexion sécurisée à votre référentiel de code.", "addSshKey": "Ajouter une nouvelle clé SSH", + "enterUsernameCaption": "Ce nom d'utilisateur sera affiché sur toute la plateforme.", "generalTab": "Général", "keysTab": "Clés et Jetons", "saving": "Enregistrement..." }, "createProject": { - "validation": { - "nameNoEmpty": "Le champ ne peut pas être vide", - "nameMinLength": "Le nom du projet doit contenir au moins 4 caractères" - }, - "backButton": "Retour", - "title": "Créez votre nouveau projet", - "description": "Organisez vos dépôts, pipelines et plus encore.", "form": { "name": "Nom du projet", - "namePlaceholder": "Entrez le nom de votre projet", "description": "Description", + "namePlaceholder": "Entrez le nom de votre projet", "descriptionPlaceholder": "Entrez une description (facultatif)" }, + "backButton": "Retour", + "title": "Créez votre nouveau projet", + "description": "Organisez vos dépôts, pipelines et plus encore.", "create": { "projectCreation": "Création du projet...", "createProject": "Créer le projet" @@ -488,18 +639,33 @@ "link": "Se déconnecter" } }, + "importProject": { + "projectNameLabel": "Nom", + "descriptionLabel": "Description", + "gitProviderLabel": "Fournisseur Git", + "organizationLabel": "Organisation", + "hostUrlLabel": "URL d'hôte", + "title": "Importer un projet", + "gitProviderPlaceholder": "Sélectionner un fournisseur", + "hostUrlPlaceholder": "Entrer l'URL d'hôte", + "tokenLabel": "Jeton", + "tokenPlaceholder": "Entrer votre jeton d'accès", + "organizationPlaceholder": "Entrer le nom de l'organisation", + "repositoriesLabel": "Référentiels", + "pipelinesLabel": "Importer des pipelines", + "projectNamePlaceholder": "Entrer le nom du référentiel", + "descriptionPlaceholder": "Entrer une description", + "importButton": { + "default": "Importer le projet", + "importing": "Importation du projet..." + }, + "cancelButton": "Annuler" + }, "forms": { - "selectMember": "", - "selectRole": "", - "enterBranchName": "Entrez le nom de la branche", - "createBranchError": "Le nom de la branche est requis", + "selectMember": "Select member", + "selectRole": "Select role", "enterTagName": "Enter tag name", - "select": "Sélectionner", - "baseBranch": "Branche de base", - "selectBranchError": "La branche de base est requise", - "baseTag": "Based on", - "selectMemberError": "", - "selectRoleError": "" + "createBranchError": "" }, "roles": { "owner": "Owner", @@ -568,8 +734,7 @@ "validation": { "userIdRequired": "Veuillez fournir un identifiant utilisateur", "invalidEmail": "Veuillez saisir une adresse e-mail valide", - "displayNameRequired": "Veuillez fournir un nom d'affichage", - "emailInvalid": "Veuillez saisir une adresse e-mail valide" + "displayNameRequired": "Veuillez fournir un nom d'affichage" } }, "userId": "Identifiant utilisateur", diff --git a/packages/ui/src/components/alert/AlertContainer.tsx b/packages/ui/src/components/alert/AlertContainer.tsx index acfc96cdfa..48276ada36 100644 --- a/packages/ui/src/components/alert/AlertContainer.tsx +++ b/packages/ui/src/components/alert/AlertContainer.tsx @@ -18,7 +18,7 @@ import { cva, type VariantProps } from 'class-variance-authority' import { Icon } from '../icon' const alertVariants = cva( - 'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7', + '[&>svg]:text-foreground relative grid w-full gap-1 rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7', { variants: { variant: { diff --git a/packages/ui/src/components/alert/AlertTitle.tsx b/packages/ui/src/components/alert/AlertTitle.tsx index e66048a61b..3c39384b66 100644 --- a/packages/ui/src/components/alert/AlertTitle.tsx +++ b/packages/ui/src/components/alert/AlertTitle.tsx @@ -7,7 +7,7 @@ export interface AlertTitleProps extends PropsWithChildren(({ className, children }, ref) => ( -
+
{children}
)) diff --git a/packages/ui/src/components/button-group.tsx b/packages/ui/src/components/button-group.tsx index dffe1edda9..24df1ef811 100644 --- a/packages/ui/src/components/button-group.tsx +++ b/packages/ui/src/components/button-group.tsx @@ -21,7 +21,10 @@ export function ButtonGroup({ const verticalAlignClass = verticalAlign ? `items-${verticalAlign}` : '' return ( -
+
{children}
) diff --git a/packages/ui/src/components/button-with-options.tsx b/packages/ui/src/components/button-with-options.tsx index 97a3dcdc6d..14ba9ea3b6 100644 --- a/packages/ui/src/components/button-with-options.tsx +++ b/packages/ui/src/components/button-with-options.tsx @@ -139,7 +139,7 @@ export const ButtonWithOptions = ({ onClick={() => handleOptionChange(option.value)} > - {option.label} + {option.label} {option?.description && {option.description}} diff --git a/packages/ui/src/components/form-primitives/caption.tsx b/packages/ui/src/components/form-primitives/caption.tsx index 5b049a1141..51272dcd9d 100644 --- a/packages/ui/src/components/form-primitives/caption.tsx +++ b/packages/ui/src/components/form-primitives/caption.tsx @@ -1,8 +1,8 @@ -import { PropsWithChildren } from 'react' +import { HTMLAttributes, PropsWithChildren } from 'react' import { cn } from '@utils/cn' -interface CaptionProps extends PropsWithChildren> { +interface CaptionProps extends PropsWithChildren> { className?: string } diff --git a/packages/ui/src/components/form-primitives/control-group.tsx b/packages/ui/src/components/form-primitives/control-group.tsx index e0369e5e39..1a496299a7 100644 --- a/packages/ui/src/components/form-primitives/control-group.tsx +++ b/packages/ui/src/components/form-primitives/control-group.tsx @@ -2,10 +2,6 @@ import { HTMLAttributes } from 'react' import { cn } from '@utils/cn' -interface ControlGroupProps extends HTMLAttributes { - type?: 'button' | 'input' -} - /** * A container component that groups form control elements together. * @example @@ -13,14 +9,9 @@ interface ControlGroupProps extends HTMLAttributes { * * */ -export function ControlGroup({ children, type, className, ...props }: ControlGroupProps) { +export function ControlGroup({ children, className, ...props }: HTMLAttributes) { return ( -
+
{children}
) diff --git a/packages/ui/src/components/form-primitives/fieldset.tsx b/packages/ui/src/components/form-primitives/fieldset.tsx index b7d9984a8c..1ecc192bb0 100644 --- a/packages/ui/src/components/form-primitives/fieldset.tsx +++ b/packages/ui/src/components/form-primitives/fieldset.tsx @@ -5,16 +5,20 @@ import { cn } from '@utils/cn' interface FieldsetProps extends HTMLAttributes { box?: boolean shaded?: boolean + /** + * For better accessibility, the fieldset should start from the legend element + */ + legend?: string } /** * A form fieldset component that groups related form elements. * @example - *
+ *
*
Form elements
*
*/ -export function Fieldset({ children, box, shaded, className, ...props }: FieldsetProps) { +export function Fieldset({ children, box, shaded, className, legend, ...props }: FieldsetProps) { return (
+ {legend} + {children}
) diff --git a/packages/ui/src/components/form-primitives/message.tsx b/packages/ui/src/components/form-primitives/message.tsx index 6642ca7c85..69ac2c1733 100644 --- a/packages/ui/src/components/form-primitives/message.tsx +++ b/packages/ui/src/components/form-primitives/message.tsx @@ -1,6 +1,5 @@ import { HTMLAttributes } from 'react' -import { Text } from '@/components' import { cn } from '@utils/cn' import { MessageTheme } from './form-primitives.types' @@ -30,15 +29,12 @@ const themeClassMap: Record = { * */ export function Message({ children, theme, className }: MessageProps) { - const textClass = themeClassMap[theme] const role = theme === MessageTheme.ERROR ? 'alert' : 'status' const ariaLive = theme === MessageTheme.ERROR ? 'assertive' : 'polite' return ( -
- - {children} - -
+

+ {children} +

) } diff --git a/packages/ui/src/components/form-primitives/separator.tsx b/packages/ui/src/components/form-primitives/separator.tsx index f59ee67d56..c3ff0d2869 100644 --- a/packages/ui/src/components/form-primitives/separator.tsx +++ b/packages/ui/src/components/form-primitives/separator.tsx @@ -9,13 +9,13 @@ interface FormSeparatorProps { /** * A horizontal separator component for forms * @example - * // Basic usage + * Basic usage * * - * // With dashed style + * With dashed style * * - * // With custom className + * With custom className * */ export function FormSeparator({ dashed, dotted, className }: FormSeparatorProps) { diff --git a/packages/ui/src/components/git-commit-dialog/git-commit-dialog.tsx b/packages/ui/src/components/git-commit-dialog/git-commit-dialog.tsx index d44557fd82..f920e87a1d 100644 --- a/packages/ui/src/components/git-commit-dialog/git-commit-dialog.tsx +++ b/packages/ui/src/components/git-commit-dialog/git-commit-dialog.tsx @@ -175,11 +175,11 @@ export const GitCommitDialog: FC = ({ Commit directly to the - + {currentBranch} branch diff --git a/packages/ui/src/components/option.tsx b/packages/ui/src/components/option.tsx index d11fea49e2..278ec86010 100644 --- a/packages/ui/src/components/option.tsx +++ b/packages/ui/src/components/option.tsx @@ -1,16 +1,17 @@ -import { FC, ReactElement, ReactNode } from 'react' +import { FC, HTMLAttributes, ReactElement, ReactNode } from 'react' -import { Checkbox, Label, RadioButton, Text } from '@/components' +import { Caption, Checkbox, Label, Message, MessageTheme, RadioButton } from '@/components' import { cn } from '@utils/cn' type ControlType = ReactElement | ReactElement -interface OptionProps { +interface OptionProps extends HTMLAttributes { control: ControlType id: string label?: string | ReactNode description?: string | ReactNode - className?: string + disabled?: boolean + error?: string ariaSelected?: boolean } @@ -24,30 +25,45 @@ interface OptionProps { * description="Description for Option 1" * /> */ -export const Option: FC = ({ control, id, label, description, ariaSelected, className }) => { +export const Option: FC = ({ + control, + id, + label, + description, + className, + disabled, + error, + ariaSelected, + ...props +}) => { return (
{control}
-
diff --git a/packages/ui/src/components/textarea.tsx b/packages/ui/src/components/textarea.tsx index c13ec148e5..b73616ad20 100644 --- a/packages/ui/src/components/textarea.tsx +++ b/packages/ui/src/components/textarea.tsx @@ -27,7 +27,7 @@ const Textarea = forwardRef( )}