Skip to content

Commit fa748bb

Browse files
committed
color standardization
1 parent 95728e3 commit fa748bb

File tree

10 files changed

+61
-14
lines changed

10 files changed

+61
-14
lines changed

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/base-tags-modal/base-tags-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,15 +462,15 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
462462
<ModalHeader>Documents using "{selectedTag?.displayName}"</ModalHeader>
463463
<ModalBody>
464464
<div className='space-y-[8px]'>
465-
<p className='text-[12px] text-[var(--text-tertiary)]'>
465+
<p className='text-[12px] text-[var(--text-secondary)]'>
466466
{selectedTagUsage?.documentCount || 0} document
467467
{selectedTagUsage?.documentCount !== 1 ? 's are' : ' is'} currently using this tag
468468
definition.
469469
</p>
470470

471471
{selectedTagUsage?.documentCount === 0 ? (
472472
<div className='rounded-[6px] border p-[16px] text-center'>
473-
<p className='text-[12px] text-[var(--text-tertiary)]'>
473+
<p className='text-[12px] text-[var(--text-secondary)]'>
474474
This tag definition is not being used by any documents. You can safely delete it
475475
to free up the tag slot.
476476
</p>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/general.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export function GeneralDeploy({
283283
<ModalContent size='sm'>
284284
<ModalHeader>Promote to live</ModalHeader>
285285
<ModalBody>
286-
<p className='text-[12px] text-[var(--text-tertiary)]'>
286+
<p className='text-[12px] text-[var(--text-secondary)]'>
287287
Are you sure you want to promote{' '}
288288
<span className='font-medium text-[var(--text-primary)]'>
289289
{versionToPromoteInfo?.name || `v${versionToPromote}`}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export function CustomToolModal({
9090
const [initialJsonSchema, setInitialJsonSchema] = useState('')
9191
const [initialFunctionCode, setInitialFunctionCode] = useState('')
9292
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false)
93+
const [showDiscardAlert, setShowDiscardAlert] = useState(false)
9394
const [isSchemaPromptActive, setIsSchemaPromptActive] = useState(false)
9495
const [schemaPromptInput, setSchemaPromptInput] = useState('')
9596
const schemaPromptInputRef = useRef<HTMLInputElement | null>(null)
@@ -174,6 +175,9 @@ Example 2:
174175
generationType: 'custom-tool-schema',
175176
},
176177
currentValue: jsonSchema,
178+
onStreamStart: () => {
179+
setJsonSchema('')
180+
},
177181
onGeneratedContent: (content) => {
178182
setJsonSchema(content)
179183
setSchemaError(null)
@@ -237,6 +241,9 @@ try {
237241
generationType: 'javascript-function-body',
238242
},
239243
currentValue: functionCode,
244+
onStreamStart: () => {
245+
setFunctionCode('')
246+
},
240247
onGeneratedContent: (content) => {
241248
handleFunctionCodeChange(content)
242249
setCodeError(null)
@@ -390,6 +397,26 @@ try {
390397
return jsonSchema !== initialJsonSchema || functionCode !== initialFunctionCode
391398
}, [isEditing, jsonSchema, initialJsonSchema, functionCode, initialFunctionCode])
392399

400+
const hasUnsavedChanges = useMemo(() => {
401+
if (isEditing) {
402+
return jsonSchema !== initialJsonSchema || functionCode !== initialFunctionCode
403+
}
404+
return jsonSchema.trim().length > 0 || functionCode.trim().length > 0
405+
}, [isEditing, jsonSchema, initialJsonSchema, functionCode, initialFunctionCode])
406+
407+
const handleCloseAttempt = () => {
408+
if (hasUnsavedChanges && !schemaGeneration.isStreaming && !codeGeneration.isStreaming) {
409+
setShowDiscardAlert(true)
410+
} else {
411+
handleClose()
412+
}
413+
}
414+
415+
const handleConfirmDiscard = () => {
416+
setShowDiscardAlert(false)
417+
handleClose()
418+
}
419+
393420
const handleSave = async () => {
394421
try {
395422
if (!jsonSchema) {
@@ -781,7 +808,7 @@ try {
781808

782809
return (
783810
<>
784-
<Modal open={open} onOpenChange={handleClose}>
811+
<Modal open={open} onOpenChange={handleCloseAttempt}>
785812
<ModalContent size='xl'>
786813
<ModalHeader>{isEditing ? 'Edit Agent Tool' : 'Create Agent Tool'}</ModalHeader>
787814

@@ -1172,6 +1199,26 @@ try {
11721199
</ModalFooter>
11731200
</ModalContent>
11741201
</Modal>
1202+
1203+
<Modal open={showDiscardAlert} onOpenChange={setShowDiscardAlert}>
1204+
<ModalContent size='sm'>
1205+
<ModalHeader>Unsaved Changes</ModalHeader>
1206+
<ModalBody>
1207+
<p className='text-[12px] text-[var(--text-secondary)]'>
1208+
You have unsaved changes to this tool. Are you sure you want to discard your changes
1209+
and close the editor?
1210+
</p>
1211+
</ModalBody>
1212+
<ModalFooter>
1213+
<Button variant='default' onClick={() => setShowDiscardAlert(false)}>
1214+
Keep Editing
1215+
</Button>
1216+
<Button variant='destructive' onClick={handleConfirmDiscard}>
1217+
Discard Changes
1218+
</Button>
1219+
</ModalFooter>
1220+
</ModalContent>
1221+
</Modal>
11751222
</>
11761223
)
11771224
}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/access-control/access-control.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ export function AccessControl() {
10721072
<ModalContent size='sm'>
10731073
<ModalHeader>Unsaved Changes</ModalHeader>
10741074
<ModalBody>
1075-
<p className='text-[12px] text-[var(--text-tertiary)]'>
1075+
<p className='text-[12px] text-[var(--text-secondary)]'>
10761076
You have unsaved changes. Do you want to save them before closing?
10771077
</p>
10781078
</ModalBody>

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/components/create-api-key-modal/create-api-key-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function CreateApiKeyModal({
115115
<ModalContent size='sm'>
116116
<ModalHeader>Create new API key</ModalHeader>
117117
<ModalBody>
118-
<p className='text-[12px] text-[var(--text-tertiary)]'>
118+
<p className='text-[12px] text-[var(--text-secondary)]'>
119119
{keyType === 'workspace'
120120
? "This key will have access to all workflows in this workspace. Make sure to copy it after creation as you won't be able to see it again."
121121
: "This key will have access to your personal workflows. Make sure to copy it after creation as you won't be able to see it again."}
@@ -218,7 +218,7 @@ export function CreateApiKeyModal({
218218
<ModalContent size='sm'>
219219
<ModalHeader>Your API key has been created</ModalHeader>
220220
<ModalBody>
221-
<p className='text-[12px] text-[var(--text-tertiary)]'>
221+
<p className='text-[12px] text-[var(--text-secondary)]'>
222222
This is the only time you will see your API key.{' '}
223223
<span className='font-semibold text-[var(--text-primary)]'>
224224
Copy it now and store it securely.

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/byok/byok.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export function BYOK() {
222222
)}
223223
</ModalHeader>
224224
<ModalBody>
225-
<p className='text-[12px] text-[var(--text-tertiary)]'>
225+
<p className='text-[12px] text-[var(--text-secondary)]'>
226226
This key will be used for all {PROVIDERS.find((p) => p.id === editingProvider)?.name}{' '}
227227
requests in this workspace. Your key is encrypted and stored securely.
228228
</p>
@@ -308,7 +308,7 @@ export function BYOK() {
308308
<ModalContent size='sm'>
309309
<ModalHeader>Delete API Key</ModalHeader>
310310
<ModalBody>
311-
<p className='text-[12px] text-[var(--text-tertiary)]'>
311+
<p className='text-[12px] text-[var(--text-secondary)]'>
312312
Are you sure you want to delete the{' '}
313313
<span className='font-medium text-[var(--text-primary)]'>
314314
{PROVIDERS.find((p) => p.id === deleteConfirmProvider)?.name}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/copilot/copilot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export function Copilot() {
214214
<ModalContent size='sm'>
215215
<ModalHeader>Create new API key</ModalHeader>
216216
<ModalBody>
217-
<p className='text-[12px] text-[var(--text-tertiary)]'>
217+
<p className='text-[12px] text-[var(--text-secondary)]'>
218218
This key will allow access to Copilot features. Make sure to copy it after creation as
219219
you won't be able to see it again.
220220
</p>
@@ -276,7 +276,7 @@ export function Copilot() {
276276
<ModalContent size='sm'>
277277
<ModalHeader>Your API key has been created</ModalHeader>
278278
<ModalBody>
279-
<p className='text-[12px] text-[var(--text-tertiary)]'>
279+
<p className='text-[12px] text-[var(--text-secondary)]'>
280280
This is the only time you will see your API key.{' '}
281281
<span className='font-semibold text-[var(--text-primary)]'>
282282
Copy it now and store it securely.

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/environment/environment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ export function EnvironmentVariables({ registerBeforeLeaveHandler }: Environment
824824
<ModalContent size='sm'>
825825
<ModalHeader>Unsaved Changes</ModalHeader>
826826
<ModalBody>
827-
<p className='text-[12px] text-[var(--text-tertiary)]'>
827+
<p className='text-[12px] text-[var(--text-secondary)]'>
828828
{hasConflicts || hasInvalidKeys
829829
? `You have unsaved changes, but ${hasConflicts ? 'conflicts must be resolved' : 'invalid variable names must be fixed'} before saving. You can discard your changes to close the modal.`
830830
: 'You have unsaved changes. Do you want to save them before closing?'}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ export function General({ onOpenChange }: GeneralProps) {
603603
<ModalContent size='sm'>
604604
<ModalHeader>Reset Password</ModalHeader>
605605
<ModalBody>
606-
<p className='text-[12px] text-[var(--text-tertiary)]'>
606+
<p className='text-[12px] text-[var(--text-secondary)]'>
607607
A password reset link will be sent to{' '}
608608
<span className='font-medium text-[var(--text-primary)]'>{profile?.email}</span>.
609609
Click the link in the email to create a new password.

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/team-management/components/team-seats/team-seats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function TeamSeats({
6464
<ModalContent size='sm'>
6565
<ModalHeader>{title}</ModalHeader>
6666
<ModalBody>
67-
<p className='text-[12px] text-[var(--text-muted)]'>{description}</p>
67+
<p className='text-[12px] text-[var(--text-secondary)]'>{description}</p>
6868

6969
<div className='mt-[16px] flex flex-col gap-[4px]'>
7070
<Label htmlFor='seats' className='text-[12px]'>

0 commit comments

Comments
 (0)