@@ -11,10 +11,6 @@ import { isEnterprise } from '@/lib/billing/plan-helpers'
1111import { HEX_COLOR_REGEX } from '@/lib/branding'
1212import type { OrganizationWhitelabelSettings } from '@/lib/branding/types'
1313import { useDeploymentShape } from '@/lib/core/config/deployment-shape'
14- import {
15- CHIP_FIELD_INPUT ,
16- CHIP_FIELD_SHELL ,
17- } from '@/app/workspace/[workspaceId]/components/credential-detail'
1814import { SettingsEmptyState } from '@/app/workspace/[workspaceId]/settings/components/settings-empty-state'
1915import { SettingsPanel } from '@/app/workspace/[workspaceId]/settings/components/settings-panel'
2016import { SettingsSection } from '@/app/workspace/[workspaceId]/settings/components/settings-section/settings-section'
@@ -81,30 +77,31 @@ function ColorInput({ label, value, onChange, placeholder = '#000000' }: ColorIn
8177 return (
8278 < div className = 'flex flex-col gap-1.5' >
8379 < Label > { label } </ Label >
84- < div className = { cn ( CHIP_FIELD_SHELL , ! isValidHex && 'border-[var(--text-error)]' ) } >
85- < div
86- className = { cn (
87- 'size-[16px] shrink-0 rounded-sm border border-[var(--border-1)]' ,
88- ! showColor && 'bg-[var(--surface-3)]'
89- ) }
90- style = { showColor ? { backgroundColor : value } : undefined }
91- />
92- < input
93- value = { value }
94- onChange = { ( e ) => {
95- let v = e . target . value . trim ( )
96- if ( v && ! v . startsWith ( '#' ) ) {
97- v = `#${ v } `
98- }
99- v = v . slice ( 0 , 1 ) + v . slice ( 1 ) . replace ( / [ ^ 0 - 9 a - f A - F ] / g, '' )
100- onChange ( v . slice ( 0 , 7 ) )
101- } }
102- onFocus = { ( e ) => e . target . select ( ) }
103- placeholder = { placeholder }
104- maxLength = { 7 }
105- className = { cn ( CHIP_FIELD_INPUT , 'font-mono' ) }
106- />
107- </ div >
80+ < ChipInput
81+ error = { ! isValidHex }
82+ startAdornment = {
83+ < div
84+ className = { cn (
85+ 'size-[16px] shrink-0 rounded-sm border border-[var(--border-1)]' ,
86+ ! showColor && 'bg-[var(--surface-3)]'
87+ ) }
88+ style = { showColor ? { backgroundColor : value } : undefined }
89+ />
90+ }
91+ value = { value }
92+ onChange = { ( e ) => {
93+ let v = e . target . value . trim ( )
94+ if ( v && ! v . startsWith ( '#' ) ) {
95+ v = `#${ v } `
96+ }
97+ v = v . slice ( 0 , 1 ) + v . slice ( 1 ) . replace ( / [ ^ 0 - 9 a - f A - F ] / g, '' )
98+ onChange ( v . slice ( 0 , 7 ) )
99+ } }
100+ onFocus = { ( e ) => e . target . select ( ) }
101+ placeholder = { placeholder }
102+ maxLength = { 7 }
103+ inputClassName = 'font-mono'
104+ />
108105 { ! isValidHex && (
109106 < p className = 'text-[var(--text-error)] text-caption' >
110107 Must be a valid hex color (e.g. #33c482)
0 commit comments