Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: migrate secret sharing settings to v3 components

Scott Wilsonb54f613cf028
diff --git a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/OrgSecretShareLimitSection.tsx b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/OrgSecretShareLimitSection.tsx
index d7c3373322..d0ed9960ab 100644
--- a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/OrgSecretShareLimitSection.tsx
+++ b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/OrgSecretShareLimitSection.tsx
@@ -1,12 +1,32 @@
import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
+import { Info } from "lucide-react";
import ms from "ms";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, FormControl, Input, Select, SelectItem } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { getObjectFromSeconds } from "@app/helpers/datetime";
import { useUpdateOrg } from "@app/hooks/api";
@@ -107,7 +127,6 @@ export const OrgSecretShareLimitSection = () => {
reset(formData);
};
- // Units for the dropdown with readable labels
const timeUnits = [
{ value: "m", label: "Minutes" },
{ value: "h", label: "Hours" },
@@ -115,143 +134,151 @@ export const OrgSecretShareLimitSection = () => {
];
return (
- <div className="mb-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
- <div className="flex w-full items-center justify-between">
- <p className="text-xl font-medium">Secret Share Limits</p>
- </div>
- <p className="mt-2 mb-4 text-sm text-gray-400">
- These settings establish the maximum limits for all Shared Secret parameters within this
- organization. Shared secrets cannot be created with values exceeding these limits.
- </p>
- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
- {(isAllowed) => (
- <form onSubmit={handleSubmit(handleFormSubmit)} autoComplete="off">
- <div className="flex max-w-sm gap-4">
- <Controller
- control={control}
- name="maxLifetimeValue"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- tooltipText="The max amount of time that can be set before the secret share link expires."
- label="Max Lifetime"
- className="w-full"
- >
- <Input
- {...field}
- type="number"
- min={1}
- step={1}
- value={field.value}
- onChange={(e) => {
- const val = e.target.value;
- field.onChange(val === "" ? "" : parseInt(val, 10));
- }}
- disabled={!isAllowed}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="maxLifetimeUnit"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Time unit"
- >
- <Select
- value={field.value}
- className="pr-2"
- onValueChange={field.onChange}
- placeholder="Select time unit"
- isDisabled={!isAllowed}
- >
- {timeUnits.map(({ value, label }) => (
- <SelectItem
- key={value}
- value={value}
- className="relative py-2 pr-8 pl-6 text-sm hover:bg-mineshaft-700"
- >
- <div className="ml-3 font-medium">{label}</div>
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
- </div>
- <div className="flex max-w-sm items-end gap-2">
- <Controller
- control={control}
- name="shouldLimitView"
- render={({ field: { onChange, value, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Max Views"
- errorText={error?.message}
- isError={Boolean(error)}
- className="w-48"
- >
- <Select
- defaultValue={value.toString()}
- value={value.toString()}
- onValueChange={(e) => onChange(e === "true")}
- className="w-full"
- position="popper"
- dropdownContainerClassName="max-w-none"
- isDisabled={!isAllowed}
- {...field}
- >
- {viewLimitOptions.map(({ label, value: viewLimitValue }) => (
- <SelectItem
- value={viewLimitValue.toString()}
- key={viewLimitValue.toString()}
- >
- {label}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
- {shouldLimitView && (
+ <Card>
+ <CardHeader>
+ <CardTitle>Secret Share Limits</CardTitle>
+ <CardDescription>
+ These settings establish the maximum limits for all Shared Secret parameters within this
+ organization. Shared secrets cannot be created with values exceeding these limits.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
+ {(isAllowed) => (
+ <form
+ onSubmit={handleSubmit(handleFormSubmit)}
+ autoComplete="off"
+ className="flex flex-col gap-4"
+ >
+ <div className="flex max-w-sm gap-4">
<Controller
control={control}
- name="maxViewLimit"
- render={({ field: { onChange, value, ...field }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- className="w-48"
- >
+ name="maxLifetimeValue"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="w-full">
+ <FieldLabel>
+ Max Lifetime
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info className="size-3 cursor-help text-muted" />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">
+ The max amount of time that can be set before the secret share link
+ expires.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
<Input
- value={value}
- onChange={onChange}
{...field}
- min={1}
- max={1000}
type="number"
- isDisabled={!isAllowed}
+ min={1}
+ step={1}
+ value={field.value}
+ onChange={(e) => {
+ const val = e.target.value;
+ field.onChange(val === "" ? "" : parseInt(val, 10));
+ }}
+ disabled={!isAllowed}
+ isError={Boolean(error)}
/>
- </FormControl>
+ {error && <FieldError>{error.message}</FieldError>}
+ </Field>
)}
/>
- )}
- </div>
- <Button
- colorSchema="secondary"
- type="submit"
- isLoading={isSubmitting}
- disabled={!isDirty || !isAllowed}
- className="mt-4"
- >
- Save
- </Button>
- </form>
- )}
- </OrgPermissionCan>
- </div>
+ <Controller
+ control={control}
+ name="maxLifetimeUnit"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Time unit</FieldLabel>
+ <Select
+ value={field.value}
+ onValueChange={field.onChange}
+ disabled={!isAllowed}
+ >
+ <SelectTrigger>
+ <SelectValue placeholder="Select time unit" />
+ </SelectTrigger>
+ <SelectContent>
+ {timeUnits.map(({ value, label }) => (
+ <SelectItem key={value} value={value}>
+ {label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {error && <FieldError>{error.message}</FieldError>}
+ </Field>
+ )}
+ />
+ </div>
+ <div className="flex max-w-sm items-end gap-2">
+ <Controller
+ control={control}
+ name="shouldLimitView"
+ render={({ field: { onChange, value, ...field }, fieldState: { error } }) => (
+ <Field className="w-48">
+ <FieldLabel>Max Views</FieldLabel>
+ <Select
+ value={value.toString()}
+ onValueChange={(e) => onChange(e === "true")}
+ disabled={!isAllowed}
+ {...field}
+ >
+ <SelectTrigger className="w-full">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {viewLimitOptions.map(({ label, value: viewLimitValue }) => (
+ <SelectItem
+ value={viewLimitValue.toString()}
+ key={viewLimitValue.toString()}
+ >
+ {label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {error && <FieldError>{error.message}</FieldError>}
+ </Field>
+ )}
+ />
+ {shouldLimitView && (
+ <Controller
+ control={control}
+ name="maxViewLimit"
+ render={({ field: { onChange, value, ...field }, fieldState: { error } }) => (
+ <Field className="w-48">
+ <Input
+ value={value}
+ onChange={onChange}
+ {...field}
+ min={1}
+ max={1000}
+ type="number"
+ disabled={!isAllowed}
+ isError={Boolean(error)}
+ />
+ {error && <FieldError>{error.message}</FieldError>}
+ </Field>
+ )}
+ />
+ )}
+ </div>
+ <div>
+ <Button
+ variant={!isDirty || !isAllowed ? "outline" : "org"}
+ type="submit"
+ isPending={isSubmitting}
+ isDisabled={!isDirty || !isAllowed}
+ >
+ Save
+ </Button>
+ </div>
+ </form>
+ )}
+ </OrgPermissionCan>
+ </CardContent>
+ </Card>
);
};
diff --git a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingAllowShareToAnyone.tsx b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingAllowShareToAnyone.tsx
index 4a42d89a23..031d1cf127 100644
--- a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingAllowShareToAnyone.tsx
+++ b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingAllowShareToAnyone.tsx
@@ -1,6 +1,13 @@
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Switch } from "@app/components/v2";
+import {
+ Card,
+ CardAction,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Switch
+} from "@app/components/v3";
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { useUpdateOrg } from "@app/hooks/api";
@@ -23,26 +30,29 @@ export const SecretSharingAllowShareToAnyone = () => {
};
return (
- <div className="mb-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
- <div className="mb-2 flex justify-between">
- <h3 className="text-md text-mineshaft-100">
+ <Card>
+ <CardHeader>
+ <CardTitle className="flex items-center justify-between">
Allow sharing secrets to members outside of this organization
- </h3>
- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
- {(isAllowed) => (
- <Switch
- id="enable-secret-sharing-outside-org"
- onCheckedChange={(value) => handleSecretSharingToggle(value)}
- isChecked={currentOrg?.allowSecretSharingOutsideOrganization ?? false}
- isDisabled={!isAllowed}
- />
- )}
- </OrgPermissionCan>
- </div>
- <p className="text-sm text-mineshaft-300">
- If enabled, team members will be able to share secrets to members outside of this
- organization
- </p>
- </div>
+ </CardTitle>
+ <CardDescription>
+ If enabled, team members will be able to share secrets to members outside of this
+ organization
+ </CardDescription>
+ <CardAction>
+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
+ {(isAllowed) => (
+ <Switch
+ variant="org"
+ id="enable-secret-sharing-outside-org"
+ onCheckedChange={(value) => handleSecretSharingToggle(value)}
+ checked={currentOrg?.allowSecretSharingOutsideOrganization ?? false}
+ disabled={!isAllowed}
+ />
+ )}
+ </OrgPermissionCan>
+ </CardAction>
+ </CardHeader>
+ </Card>
);
};
diff --git a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingBrandingSection.tsx b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingBrandingSection.tsx
index a17dfbbcda..0477ef4d65 100644
--- a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingBrandingSection.tsx
+++ b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingBrandingSection.tsx
@@ -1,13 +1,37 @@
import { useEffect, useRef, useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
-import { LockIcon, TrashIcon, UploadIcon } from "lucide-react";
+import { LockIcon, Trash2, UploadIcon } from "lucide-react";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, DeleteActionModal, FormControl, Input } from "@app/components/v2";
-import { Badge, Button as ButtonV3 } from "@app/components/v3";
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogMedia,
+ AlertDialogTitle,
+ Badge,
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ Skeleton,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { apiRequest } from "@app/config/request";
import {
OrgPermissionActions,
@@ -103,9 +127,8 @@ const AssetUploadCard = ({
const inputRef = useRef<HTMLInputElement>(null);
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(false);
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
+ const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);
- // Fetch existing asset on mount if it exists
useEffect(() => {
if (hasAsset) {
setIsLoading(true);
@@ -136,7 +159,6 @@ const AssetUploadCard = ({
await onUpload(assetType, file);
- // Update preview with the uploaded file
const reader = new FileReader();
reader.onloadend = () => {
setPreviewUrl(reader.result as string);
@@ -148,14 +170,14 @@ const AssetUploadCard = ({
const handleDelete = async () => {
await onDelete(assetType);
setPreviewUrl(null);
- setIsDeleteModalOpen(false);
+ setIsDeleteDialogOpen(false);
};
return (
- <div className="flex h-28 justify-between gap-2 rounded-md border border-mineshaft-600 bg-mineshaft-800 p-3">
+ <div className="flex h-28 justify-between gap-2 rounded-md border border-border bg-container p-3">
<div className="flex min-h-0 flex-col justify-center">
<p className="mb-1 text-sm font-medium">{title}</p>
- <p className="mb-2 text-xs text-mineshaft-400">{description}</p>
+ <p className="mb-2 text-xs text-muted">{description}</p>
<input
ref={inputRef}
type="file"
@@ -165,7 +187,7 @@ const AssetUploadCard = ({
disabled={!isAllowed || isPending}
/>
<div className="flex gap-2">
- <ButtonV3
+ <Button
variant="neutral"
size="xs"
onClick={() => inputRef.current?.click()}
@@ -173,37 +195,47 @@ const AssetUploadCard = ({
>
<UploadIcon />
Upload {title}
- </ButtonV3>
+ </Button>
{previewUrl && (
- <ButtonV3
+ <Button
variant="danger"
size="xs"
- onClick={() => setIsDeleteModalOpen(true)}
+ onClick={() => setIsDeleteDialogOpen(true)}
isDisabled={!isAllowed || isPending}
>
- <TrashIcon />
+ <Trash2 />
Delete
- </ButtonV3>
+ </Button>
)}
- <DeleteActionModal
- isOpen={isDeleteModalOpen}
- onClose={() => setIsDeleteModalOpen(false)}
- onChange={setIsDeleteModalOpen}
- deleteKey="delete"
- title={`Delete ${title}?`}
- onDeleteApproved={handleDelete}
- buttonText="Delete"
- />
+ <AlertDialog open={isDeleteDialogOpen} onOpenChange={setIsDeleteDialogOpen}>
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogMedia>
+ <Trash2 />
+ </AlertDialogMedia>
+ <AlertDialogTitle>Delete {title}?</AlertDialogTitle>
+ <AlertDialogDescription>
+ This will remove the {title.toLowerCase()} from your shared secret pages.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogAction variant="danger" onClick={handleDelete}>
+ Delete
+ </AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
</div>
</div>
{isLoading ? (
- <div className="aspect-square h-full w-auto animate-pulse rounded border border-mineshaft-500 bg-mineshaft-600" />
+ <Skeleton className="aspect-square h-full w-auto rounded" />
) : (
previewUrl && (
<img
src={previewUrl}
alt={`${title} preview`}
- className="aspect-square h-full w-auto rounded border border-mineshaft-500 object-contain p-1"
+ className="aspect-square h-full w-auto rounded border border-border object-contain p-1"
/>
)
)}
@@ -274,137 +306,159 @@ export const SecretSharingBrandingSection = () => {
};
return (
- <div className="mb-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
- <div className="flex w-full items-center justify-between">
- <div className="flex items-center gap-2">
- <p className="text-xl font-medium">Custom Branding</p>
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ Custom Branding
{!isFeatureEnabled && (
<Badge variant="info">
<LockIcon />
Enterprise
</Badge>
)}
- </div>
- </div>
- <p className="mt-2 mb-4 text-sm text-gray-400">
- Customize the appearance of your shared secret pages with your own branding.
- </p>
-
- {!isFeatureEnabled ? (
- <div className="flex items-center justify-between gap-2 rounded-md border border-mineshaft-600 bg-mineshaft-800 p-4">
- <p className="text-sm text-mineshaft-300">
- Custom branding for secret sharing pages is available on Enterprise plans.
- </p>
- <ButtonV3 size="xs" variant="org" asChild>
- <a href="https://infisical.com/schedule-demo" target="_blank" rel="noreferrer">
- Talk to Us
- </a>
- </ButtonV3>
- </div>
- ) : (
- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
- {(isAllowed) => (
- <div className="space-y-4">
- <div className="grid grid-cols-1 gap-4 md:grid-cols-2">
- <AssetUploadCard
- assetType="brand-logo"
- title="Logo"
- description="Displayed on shared secret pages (max 1MB)"
- hasAsset={brandingConfig?.hasLogo ?? false}
- isAllowed={isAllowed}
- isPending={isPending}
- onUpload={handleFileUpload}
- onDelete={handleFileDelete}
- />
- <AssetUploadCard
- assetType="brand-favicon"
- title="Favicon"
- description="Displayed in browser tab (max 1MB)"
- hasAsset={brandingConfig?.hasFavicon ?? false}
- isAllowed={isAllowed}
- isPending={isPending}
- onUpload={handleFileUpload}
- onDelete={handleFileDelete}
- />
- </div>
-
- <form onSubmit={handleSubmit(handleFormSubmit)} autoComplete="off">
+ </CardTitle>
+ <CardDescription>
+ Customize the appearance of your shared secret pages with your own branding.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ {!isFeatureEnabled ? (
+ <div className="flex items-center justify-between gap-2 rounded-md border border-border bg-container p-4">
+ <p className="text-sm text-muted">
+ Custom branding for secret sharing pages is available on Enterprise plans.
+ </p>
+ <Button size="xs" variant="org" asChild>
+ <a href="https://infisical.com/schedule-demo" target="_blank" rel="noreferrer">
+ Talk to Us
+ </a>
+ </Button>
+ </div>
+ ) : (
+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
+ {(isAllowed) => (
+ <div className="space-y-4">
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
- <Controller
- control={control}
- name="primaryColor"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Primary Color"
- tooltipText="Background color for the page (hex format, e.g., #82cec0)"
- >
- <div className="flex items-center gap-2">
- <Input
- {...field}
- placeholder="#0e1014"
- isDisabled={!isAllowed}
- className="flex-1"
- />
- <div
- className="size-9 shrink-0 rounded border border-mineshaft-500"
- style={{
- backgroundColor:
- field.value && hexColorRegex.test(field.value)
- ? field.value
- : "#0e1014"
- }}
- />
- </div>
- </FormControl>
- )}
+ <AssetUploadCard
+ assetType="brand-logo"
+ title="Logo"
+ description="Displayed on shared secret pages (max 1MB)"
+ hasAsset={brandingConfig?.hasLogo ?? false}
+ isAllowed={isAllowed}
+ isPending={isPending}
+ onUpload={handleFileUpload}
+ onDelete={handleFileDelete}
/>
- <Controller
- control={control}
- name="secondaryColor"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Secondary Color"
- tooltipText="Panel and component background color (hex format, e.g., #14211e)"
- >
- <div className="flex items-center gap-2">
- <Input
- {...field}
- placeholder="#1e1f22"
- isDisabled={!isAllowed}
- className="flex-1"
- />
- <div
- className="size-9 shrink-0 rounded border border-mineshaft-500"
- style={{
- backgroundColor:
- field.value && hexColorRegex.test(field.value)
- ? field.value
- : "#1e1f22"
- }}
- />
- </div>
- </FormControl>
- )}
+ <AssetUploadCard
+ assetType="brand-favicon"
+ title="Favicon"
+ description="Displayed in browser tab (max 1MB)"
+ hasAsset={brandingConfig?.hasFavicon ?? false}
+ isAllowed={isAllowed}
+ isPending={isPending}
+ onUpload={handleFileUpload}
+ onDelete={handleFileDelete}
/>
</div>
- <Button
- colorSchema="secondary"
- type="submit"
- isLoading={isUpdatingOrg}
- isDisabled={!isDirty || !isAllowed}
- className="mt-4"
+
+ <form
+ onSubmit={handleSubmit(handleFormSubmit)}
+ autoComplete="off"
+ className="flex flex-col gap-4"
>
- Save Colors
- </Button>
- </form>
- </div>
- )}
- </OrgPermissionCan>
- )}
- </div>
+ <div className="grid grid-cols-1 gap-4 md:grid-cols-2">
+ <Controller
+ control={control}
+ name="primaryColor"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>
+ Primary Color
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="cursor-help text-muted">?</span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">
+ Background color for the page (hex format, e.g., #82cec0)
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <div className="flex items-center gap-2">
+ <Input
+ {...field}
+ placeholder="#0e1014"
+ disabled={!isAllowed}
+ className="flex-1"
+ isError={Boolean(error)}
+ />
+ <div
+ className="size-9 shrink-0 rounded border border-border"
+ style={{
+ backgroundColor:
+ field.value && hexColorRegex.test(field.value)
+ ? field.value
+ : "#0e1014"
+ }}
+ />
+ </div>
+ {error && <FieldError>{error.message}</FieldError>}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="secondaryColor"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>
+ Secondary Color
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="cursor-help text-muted">?</span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">
+ Panel and component background color (hex format, e.g., #14211e)
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <div className="flex items-center gap-2">
+ <Input
+ {...field}
+ placeholder="#1e1f22"
+ disabled={!isAllowed}
+ className="flex-1"
+ isError={Boolean(error)}
+ />
+ <div
+ className="size-9 shrink-0 rounded border border-border"
+ style={{
+ backgroundColor:
+ field.value && hexColorRegex.test(field.value)
+ ? field.value
+ : "#1e1f22"
+ }}
+ />
+ </div>
+ {error && <FieldError>{error.message}</FieldError>}
+ </Field>
+ )}
+ />
+ </div>
+ <div>
+ <Button
+ variant={!isDirty || !isAllowed ? "outline" : "org"}
+ type="submit"
+ isPending={isUpdatingOrg}
+ isDisabled={!isDirty || !isAllowed}
+ >
+ Save Colors
+ </Button>
+ </div>
+ </form>
+ </div>
+ )}
+ </OrgPermissionCan>
+ )}
+ </CardContent>
+ </Card>
);
};
diff --git a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingSettingsTab.tsx b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingSettingsTab.tsx
index 63236b46ba..d7c1f970af 100644
--- a/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingSettingsTab.tsx
+++ b/frontend/src/pages/organization/SecretSharingPage/components/SecretSharingSettings/SecretSharingSettingsTab.tsx
@@ -1,3 +1,4 @@
+import { FieldGroup } from "@app/components/v3";
import { OrgPermissionSubjects } from "@app/context";
import { OrgPermissionSecretShareAction } from "@app/context/OrgPermissionContext/types";
import { withPermission } from "@app/hoc";
@@ -9,11 +10,11 @@ import { SecretSharingBrandingSection } from "./SecretSharingBrandingSection";
export const SecretSharingSettingsTab = withPermission(
() => {
return (
- <div className="w-full">
+ <FieldGroup>
<SecretSharingAllowShareToAnyone />
<OrgSecretShareLimitSection />
<SecretSharingBrandingSection />
- </div>
+ </FieldGroup>
);
},
{
diff --git a/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx b/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx
index aad8c14c3c..0b6d293557 100644
--- a/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx
+++ b/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx
@@ -326,7 +326,7 @@ export const ShareSecretForm = ({
</SelectContent>
</Select>
{expiresInOptions.length !== filteredExpiresInOptions.length && (
- <FieldDescription className="text-warning">
+ <FieldDescription className="text-info">
Limited to{" "}
{filteredExpiresInOptions[filteredExpiresInOptions.length - 1].label} by
organization
@@ -383,7 +383,7 @@ export const ShareSecretForm = ({
isError={Boolean(error)}
/>
{maxSharedSecretViewLimit && (
- <FieldDescription className="text-warning">
+ <FieldDescription className="text-info">
Limited to {maxSharedSecretViewLimit} view
{maxSharedSecretViewLimit === 1 ? "" : "s"} by organization
</FieldDescription>