@controleonline/ui-crm 1.0.80 → 1.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  {
2
- "version": "1.0.79",
2
+ "version": "1.0.83",
3
3
  "rc": 1,
4
- "branch": "rc/1.0.79-rc.1",
5
- "baseMaster": "c035f8ef5c06d31cdcada0e7bb17f06b7c529bb8",
4
+ "branch": "rc/1.0.83-rc.1",
5
+ "baseMaster": "88cc75124408d23d332ad1497f2ebfe89574b386",
6
6
  "tasks": [
7
- 86
7
+ 92
8
8
  ],
9
9
  "frozen": true,
10
10
  "repositories": {
11
- "ControleOnline/ui-crm": "6d8cfc9c8163d8305abd4f708850c5c5ac6ea88d"
11
+ "ControleOnline/ui-crm": "7e1b71beb980e5963fc0cd7908c8f045145a348c"
12
12
  }
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@controleonline/ui-crm",
3
- "version": "1.0.80",
3
+ "version": "1.0.84",
4
4
  "author": "ControleOnline",
5
5
  "description": "ControleOnline CRM Quasar UI Component",
6
6
  "license": "MIT",
@@ -0,0 +1,95 @@
1
+ /*
2
+ * @agents WhatsApp-like attachment preview: opens right after a file is picked, shows the image (or the
3
+ * file name), takes an optional caption and sends with ➤ (Enter on web) or discards with ✕.
4
+ */
5
+ import React, {useEffect, useMemo, useState} from 'react';
6
+ import {Image, Modal, Platform, Text, TextInput, TouchableOpacity, View} from 'react-native';
7
+
8
+ const mimeOf = file => String(file?.type || file?.mimeType || '').toLowerCase();
9
+
10
+ export default function AttachmentPreview({file, palette, onCancel, onSend}) {
11
+ const [caption, setCaption] = useState('');
12
+ const isImage = mimeOf(file).startsWith('image/') || /\.(png|jpe?g|gif|webp)$/i.test(String(file?.name || ''));
13
+
14
+ // Web files need an object URL for the preview; native pickers already give a uri.
15
+ const uri = useMemo(() => {
16
+ if (!file || !isImage) return null;
17
+ if (file.uri) return file.uri;
18
+ if (Platform.OS === 'web' && typeof URL !== 'undefined' && file instanceof Blob) return URL.createObjectURL(file);
19
+ return null;
20
+ }, [file, isImage]);
21
+ useEffect(() => () => {
22
+ if (uri && Platform.OS === 'web' && uri.startsWith('blob:')) URL.revokeObjectURL(uri);
23
+ }, [uri]);
24
+ useEffect(() => setCaption(''), [file]);
25
+
26
+ if (!file) return null;
27
+ const send = () => onSend({text: caption.trim(), file});
28
+ const onKeyPress = event => {
29
+ const e = event?.nativeEvent || {};
30
+ if (Platform.OS === 'web' && e.key === 'Enter' && !e.shiftKey) {
31
+ event.preventDefault?.();
32
+ send();
33
+ }
34
+ if (Platform.OS === 'web' && e.key === 'Escape') onCancel();
35
+ };
36
+
37
+ return (
38
+ <Modal transparent animationType="fade" visible onRequestClose={onCancel}>
39
+ <View style={{flex: 1, backgroundColor: palette.overlay, alignItems: 'center', justifyContent: 'center', padding: 16}}>
40
+ <View style={{width: '100%', maxWidth: 520, borderRadius: 14, overflow: 'hidden', backgroundColor: palette.panel}}>
41
+ <View style={{flexDirection: 'row', alignItems: 'center', paddingHorizontal: 12, paddingVertical: 10, borderBottomWidth: 1, borderBottomColor: palette.border}}>
42
+ <TouchableOpacity onPress={onCancel} accessibilityLabel="Descartar anexo" style={{padding: 4, marginRight: 8}}>
43
+ <Text style={{color: palette.muted, fontSize: 18, fontWeight: '700'}}>✕</Text>
44
+ </TouchableOpacity>
45
+ <Text style={{color: palette.text, fontWeight: '700', flex: 1}} numberOfLines={1}>
46
+ {file.name || 'Anexo'}
47
+ </Text>
48
+ </View>
49
+ <View style={{alignItems: 'center', justifyContent: 'center', padding: 16, backgroundColor: palette.background, minHeight: 160}}>
50
+ {uri ? (
51
+ <Image source={{uri}} style={{width: '100%', height: 300}} resizeMode="contain" />
52
+ ) : (
53
+ <View style={{alignItems: 'center'}}>
54
+ <Text style={{fontSize: 48}}>📄</Text>
55
+ <Text style={{color: palette.text, marginTop: 8, textAlign: 'center'}} numberOfLines={2}>
56
+ {file.name || 'Arquivo'}
57
+ </Text>
58
+ </View>
59
+ )}
60
+ </View>
61
+ <View style={{flexDirection: 'row', alignItems: 'flex-end', gap: 8, padding: 10}}>
62
+ <TextInput
63
+ style={{
64
+ flex: 1,
65
+ minHeight: 40,
66
+ maxHeight: 120,
67
+ borderRadius: 20,
68
+ borderWidth: 1,
69
+ borderColor: palette.inputBorder,
70
+ backgroundColor: palette.input,
71
+ color: palette.inputText,
72
+ paddingHorizontal: 14,
73
+ paddingVertical: 9,
74
+ fontSize: 15,
75
+ }}
76
+ value={caption}
77
+ onChangeText={setCaption}
78
+ onKeyPress={onKeyPress}
79
+ placeholder="Adicione uma legenda (opcional)"
80
+ placeholderTextColor={palette.placeholder}
81
+ multiline
82
+ autoFocus
83
+ />
84
+ <TouchableOpacity
85
+ onPress={send}
86
+ accessibilityLabel="Enviar anexo"
87
+ style={{width: 44, height: 44, borderRadius: 22, alignItems: 'center', justifyContent: 'center', backgroundColor: palette.chipActive}}>
88
+ <Text style={{color: palette.chipActiveText, fontSize: 18}}>➤</Text>
89
+ </TouchableOpacity>
90
+ </View>
91
+ </View>
92
+ </View>
93
+ </Modal>
94
+ );
95
+ }
@@ -1,10 +1,12 @@
1
1
  /*
2
- * @agents Message input, WhatsApp-like: Enter sends (Shift+Enter breaks the line), 📎 attaches a file,
2
+ * @agents Message input, WhatsApp-like: Enter sends (Shift+Enter breaks the line), 📎 picks a file and opens
3
+ * a preview with caption (AttachmentPreview),
3
4
  * 🎤 records a voice note (sent when recording stops). Sending never blocks typing: the input is cleared
4
5
  * at once and `onSend({text, file})` queues the message (ConversationView shows it as pending).
5
6
  */
6
7
  import React, {useState} from 'react';
7
8
  import {ActivityIndicator, Platform, Text, TextInput, TouchableOpacity, View} from 'react-native';
9
+ import AttachmentPreview from './AttachmentPreview';
8
10
  import useAudioRecording from './useAudioRecording';
9
11
  import {selectFile} from './fileApi';
10
12
 
@@ -14,11 +16,11 @@ export default function Composer({palette, placeholder, disabled, disabledText,
14
16
  const sending = false;
15
17
  const audio = useAudioRecording();
16
18
 
17
- const send = (payload = {text, file}) => {
19
+ const send = (payload = {text, file: null}) => {
18
20
  const message = {text: String(payload.text || '').trim(), file: payload.file || null};
19
21
  if (!message.text && !message.file) return;
20
- setText('');
21
- setFile(null);
22
+ if (message.file) setFile(null);
23
+ else setText('');
22
24
  Promise.resolve()
23
25
  .then(() => onSend(message))
24
26
  .catch(e => onError?.(e?.message || 'Não foi possível enviar'));
@@ -63,18 +65,11 @@ export default function Composer({palette, placeholder, disabled, disabledText,
63
65
  }
64
66
 
65
67
  const iconBtn = {width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center'};
66
- const hasContent = Boolean(text.trim() || file);
68
+ const hasContent = Boolean(text.trim());
67
69
  return (
68
70
  <View style={{borderTopWidth: 1, borderTopColor: palette.border, backgroundColor: palette.panel, paddingHorizontal: 8, paddingVertical: 6}}>
69
71
  {top}
70
- {file ? (
71
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 8, padding: 6, marginBottom: 4, borderRadius: 8, backgroundColor: palette.chip}}>
72
- <Text style={{color: palette.chipText, flex: 1}} numberOfLines={1}>{`📎 ${file.name || 'arquivo'}`}</Text>
73
- <TouchableOpacity onPress={() => setFile(null)}>
74
- <Text style={{color: palette.danger, fontWeight: '700'}}>✕</Text>
75
- </TouchableOpacity>
76
- </View>
77
- ) : null}
72
+ <AttachmentPreview file={file} palette={palette} onCancel={() => setFile(null)} onSend={send} />
78
73
  <View style={{flexDirection: 'row', alignItems: 'flex-end', gap: 6}}>
79
74
  <TouchableOpacity style={iconBtn} onPress={attach} disabled={sending || audio.recording} accessibilityLabel="Anexar arquivo">
80
75
  <Text style={{fontSize: 20, color: palette.muted}}>📎</Text>
@@ -36,7 +36,7 @@ export default function OptionPicker({label, value, options, onChange, placehold
36
36
  {editable ? <Text style={{color: palette.muted, fontSize: 10}}>▾</Text> : null}
37
37
  </TouchableOpacity>
38
38
  <Modal visible={open} transparent animationType="fade" onRequestClose={() => setOpen(false)}>
39
- <Pressable style={{flex: 1, backgroundColor: 'rgba(0,0,0,0.45)', justifyContent: 'center', padding: 24}} onPress={() => setOpen(false)}>
39
+ <Pressable style={{flex: 1, backgroundColor: palette.overlay, justifyContent: 'center', padding: 24}} onPress={() => setOpen(false)}>
40
40
  <Pressable style={{backgroundColor: palette.panel, borderRadius: 12, maxHeight: '75%', paddingVertical: 8, borderWidth: 1, borderColor: palette.border}}>
41
41
  <Text style={{color: palette.text, fontWeight: '700', fontSize: 16, paddingHorizontal: 16, paddingVertical: 8}}>{label}</Text>
42
42
  <ScrollView>
@@ -34,6 +34,8 @@ export default function useChatPalette() {
34
34
  inputBorder: t.inputBorder || t.cardBorder,
35
35
  inputText: t.inputText || t.textPrimary,
36
36
  placeholder: t.inputPlaceholderText || t.textMuted,
37
+ // Modal backdrop: theme token; derived from the text color only when the theme has none.
38
+ overlay: t.modalOverlay || t.overlayBackground || withOpacity(t.textPrimary || t.cardText, 0.55),
37
39
  danger: t.error || t.iconDanger,
38
40
  success: t.success || t.iconSuccess,
39
41
  };
@@ -131,7 +131,7 @@ export default function McpPage() {
131
131
  {!narrow || !showChat ? list : null}
132
132
  {!narrow || showChat ? <View style={{flex: 1, minWidth: 0}}>{chat}</View> : null}
133
133
  <Modal visible={chooser} transparent animationType="fade" onRequestClose={() => setChooser(false)}>
134
- <Pressable style={{flex: 1, backgroundColor: 'rgba(0,0,0,0.45)', justifyContent: 'center', padding: 24}} onPress={() => setChooser(false)}>
134
+ <Pressable style={{flex: 1, backgroundColor: palette.overlay, justifyContent: 'center', padding: 24}} onPress={() => setChooser(false)}>
135
135
  <Pressable style={{backgroundColor: palette.panel, borderRadius: 14, padding: 16, borderWidth: 1, borderColor: palette.border, maxWidth: 420, width: '100%', alignSelf: 'center'}}>
136
136
  <Text style={{color: palette.text, fontWeight: '700', fontSize: 17, marginBottom: 12}}>Nova solicitação</Text>
137
137
  {REQUEST_TYPES.map(t => (
@@ -80,7 +80,9 @@ export const buildGeneralSettingsPalette = themeColors => ({
80
80
  modalBorder: themeColors.modalBorder,
81
81
  modalCloseIcon: themeColors.modalCloseIcon,
82
82
  modalHeaderText: themeColors.modalHeaderText,
83
+ modalOverlay: themeColors.modalOverlay,
83
84
  modalText: themeColors.modalText,
85
+ overlayBackground: themeColors.overlayBackground,
84
86
  navigationActiveBackground: themeColors.navigationActiveBackground,
85
87
  navigationBackground: themeColors.navigationBackground,
86
88
  navigationBorder: themeColors.navigationBorder,
@@ -381,15 +383,15 @@ export const createGeneralSettingsStyles = palette =>
381
383
  borderColor: palette.listItemSelectedBorder,
382
384
  backgroundColor: palette.listItemSelectedBackground,
383
385
  },
384
- franchiseAddressOptionCopy: {
385
- flex: 1,
386
- marginLeft: 12,
387
- },
388
- franchiseAddressName: {
389
- fontSize: 14,
390
- fontWeight: '700',
391
- color: palette.listItemText,
392
- },
386
+ franchiseAddressOptionCopy: {
387
+ flex: 1,
388
+ marginLeft: 12,
389
+ },
390
+ franchiseAddressName: {
391
+ fontSize: 14,
392
+ fontWeight: '700',
393
+ color: palette.listItemText,
394
+ },
393
395
  primaryButton: {
394
396
  marginTop: 16,
395
397
  justifyContent: 'center',
@@ -3,9 +3,10 @@
3
3
  */
4
4
  import React, {useState} from 'react';
5
5
  import {ActivityIndicator, Modal, Text, TextInput, TouchableOpacity, View} from 'react-native';
6
- import styles from './tickets.styles';
6
+ import useTicketStyles from './tickets.styles';
7
7
 
8
8
  export default function AssignAiModal({visible, ticketName, onCancel, onConfirm}) {
9
+ const {styles, palette} = useTicketStyles();
9
10
  const [instructions, setInstructions] = useState('');
10
11
  const [busy, setBusy] = useState(false);
11
12
 
@@ -33,7 +34,7 @@ export default function AssignAiModal({visible, ticketName, onCancel, onConfirm}
33
34
  value={instructions}
34
35
  onChangeText={setInstructions}
35
36
  placeholder="Instruções (opcional): o que perguntar, qual oferta apresentar…"
36
- placeholderTextColor="#8b98a5"
37
+ placeholderTextColor={palette.placeholder}
37
38
  multiline
38
39
  />
39
40
  <View style={styles.modalActions}>
@@ -41,7 +42,7 @@ export default function AssignAiModal({visible, ticketName, onCancel, onConfirm}
41
42
  <Text style={styles.ghostBtnText}>Cancelar</Text>
42
43
  </TouchableOpacity>
43
44
  <TouchableOpacity style={styles.primaryBtn} onPress={confirm} disabled={busy}>
44
- {busy ? <ActivityIndicator color="#fff" /> : <Text style={styles.primaryBtnText}>Atribuir</Text>}
45
+ {busy ? <ActivityIndicator color={palette.chipActiveText} /> : <Text style={styles.primaryBtnText}>Atribuir</Text>}
45
46
  </TouchableOpacity>
46
47
  </View>
47
48
  </View>
@@ -11,7 +11,7 @@ import useToastMessage from '../../hooks/useToastMessage';
11
11
  import AssignAiModal from './AssignAiModal';
12
12
  import useRealtimeReload from './useRealtimeReload';
13
13
  import {assignAi, fetchStatuses, fetchTickets, fetchTriage, moveTicket} from './ticketApi';
14
- import styles from './tickets.styles';
14
+ import useTicketStyles from './tickets.styles';
15
15
 
16
16
  const {idOf, conversationChannel} = require('../mcp/mcpChatUtils');
17
17
  const {TICKET_TYPES, buildColumns, neighbourStatus, personName, timeAgo} = require('./ticketUtils');
@@ -19,6 +19,7 @@ const {TICKET_TYPES, buildColumns, neighbourStatus, personName, timeAgo} = requi
19
19
  const CHANNEL_LABELS = {whatsapp: 'WhatsApp', email: 'E-mail', web: 'Site'};
20
20
 
21
21
  const TicketCard = ({task, columns, onMove, onAssign, onOpen}) => {
22
+ const {styles} = useTicketStyles();
22
23
  const previous = neighbourStatus(columns, task, -1);
23
24
  const next = neighbourStatus(columns, task, 1);
24
25
  const channel = conversationChannel(task);
@@ -29,7 +30,7 @@ const TicketCard = ({task, columns, onMove, onAssign, onOpen}) => {
29
30
  {[personName(task.client), timeAgo(task.alterDate)].filter(Boolean).join(' · ')}
30
31
  </Text>
31
32
  <View style={styles.badges}>
32
- {task.aiAgent ? <View style={[styles.badge, styles.badgeAi]}><Text style={styles.badgeText}>IA atendendo</Text></View> : null}
33
+ {task.aiAgent ? <View style={[styles.badge, styles.badgeAi]}><Text style={[styles.badgeText, styles.badgeAiText]}>IA atendendo</Text></View> : null}
33
34
  {CHANNEL_LABELS[channel] ? <View style={styles.badge}><Text style={styles.badgeText}>{CHANNEL_LABELS[channel]}</Text></View> : null}
34
35
  </View>
35
36
  <View style={styles.cardActions}>
@@ -43,6 +44,7 @@ const TicketCard = ({task, columns, onMove, onAssign, onOpen}) => {
43
44
 
44
45
  export default function TicketFunnelPage({type = 'relationship'}) {
45
46
  const navigation = useNavigation();
47
+ const {styles, palette} = useTicketStyles();
46
48
  const {showError, showSuccess} = useToastMessage();
47
49
  const peopleStore = useStore('people');
48
50
  const companyId = idOf(peopleStore?.getters?.currentCompany || peopleStore?.getters?.mainCompany);
@@ -114,14 +116,14 @@ export default function TicketFunnelPage({type = 'relationship'}) {
114
116
  <Text style={styles.title}>{meta.title}</Text>
115
117
  <Text style={styles.subtitle}>{`${tickets.length} tickets · ${triage.length} em triagem pela IA`}</Text>
116
118
  </View>
117
- <TextInput style={styles.search} value={search} onChangeText={setSearch} placeholder="Buscar cliente ou título" placeholderTextColor="#8b98a5" />
119
+ <TextInput style={styles.search} value={search} onChangeText={setSearch} placeholder="Buscar cliente ou título" placeholderTextColor={palette.placeholder} />
118
120
  </View>
119
121
  {loading ? (
120
122
  <ActivityIndicator style={styles.spinner} />
121
123
  ) : (
122
124
  <ScrollView horizontal style={styles.board} contentContainerStyle={styles.boardContent}>
123
125
  {columns.map(column => (
124
- <View key={column.key} style={[styles.column, {borderTopColor: column.color}]}>
126
+ <View key={column.key} style={[styles.column, column.color ? {borderTopColor: column.color} : null]}>
125
127
  <View style={styles.columnHeader}>
126
128
  <Text style={styles.columnTitle}>{column.title}</Text>
127
129
  <Text style={styles.columnCount}>{column.tasks.length}</Text>
@@ -28,13 +28,14 @@ const buildColumns = (statuses, tasks, triage = []) => {
28
28
  return ra - rb || ia - ib;
29
29
  });
30
30
  const columns = [
31
- {key: TRIAGE_COLUMN, title: 'Triagem IA', color: '#7c3aed', status: null, tasks: (triage || []).filter(isCustomerConversation)},
31
+ {key: TRIAGE_COLUMN, title: 'Triagem IA', color: null, status: null, tasks: (triage || []).filter(isCustomerConversation)},
32
32
  ];
33
33
  sorted.forEach(status => {
34
34
  columns.push({
35
35
  key: String(idOf(status)),
36
36
  title: status.status || status.name || `#${idOf(status)}`,
37
- color: status.color || '#1d9bf0',
37
+ // Status color comes from the database; without one the column uses the theme primary.
38
+ color: status.color || null,
38
39
  status,
39
40
  tasks: [],
40
41
  });
@@ -1,61 +1,55 @@
1
+ import {useMemo} from 'react';
1
2
  import {StyleSheet} from 'react-native';
3
+ import useChatPalette from '../../components/conversation/useChatPalette';
2
4
 
3
- // Same dark palette as /ai.
4
- export default StyleSheet.create({
5
- root: {flex: 1, backgroundColor: '#0f1419'},
6
- header: {flexDirection: 'row', alignItems: 'center', gap: 8, padding: 12, borderBottomWidth: 1, borderBottomColor: '#2a3441'},
7
- headerText: {flex: 1, minWidth: 0},
8
- title: {color: '#e7e9ea', fontSize: 18, fontWeight: '700'},
9
- subtitle: {color: '#8b98a5', fontSize: 12, marginTop: 2},
10
- search: {minWidth: 180, maxWidth: 280, flex: 1, borderWidth: 1, borderColor: '#38444d', borderRadius: 10, paddingHorizontal: 10, paddingVertical: 6, color: '#e7e9ea'},
11
- board: {flex: 1},
12
- boardContent: {padding: 12, gap: 12},
13
- column: {width: 290, backgroundColor: '#15202b', borderRadius: 12, borderTopWidth: 3, maxHeight: '100%'},
14
- columnHeader: {flexDirection: 'row', justifyContent: 'space-between', padding: 10},
15
- columnTitle: {color: '#e7e9ea', fontWeight: '700', fontSize: 13, textTransform: 'capitalize'},
16
- columnCount: {color: '#8b98a5', fontSize: 12},
17
- columnBody: {paddingHorizontal: 8, paddingBottom: 8},
18
- card: {backgroundColor: '#1e2732', borderRadius: 10, padding: 10, marginBottom: 8},
19
- cardTitle: {color: '#e7e9ea', fontSize: 13, fontWeight: '600'},
20
- cardMeta: {color: '#8b98a5', fontSize: 11, marginTop: 4},
21
- badges: {flexDirection: 'row', flexWrap: 'wrap', gap: 4, marginTop: 6},
22
- badge: {borderRadius: 6, paddingHorizontal: 6, paddingVertical: 2, backgroundColor: '#2a3441'},
23
- badgeAi: {backgroundColor: '#4c1d95'},
24
- badgeText: {color: '#e7e9ea', fontSize: 10, fontWeight: '600'},
25
- cardActions: {flexDirection: 'row', gap: 6, marginTop: 8},
26
- iconBtn: {borderWidth: 1, borderColor: '#38444d', borderRadius: 8, paddingHorizontal: 8, paddingVertical: 4},
27
- iconBtnText: {color: '#e7e9ea', fontSize: 12},
28
- emptyText: {color: '#8b98a5', fontSize: 12, padding: 8},
29
- spinner: {marginTop: 24},
30
- // ticket screen
31
- messages: {padding: 12, paddingBottom: 24},
32
- bubble: {maxWidth: '80%', borderRadius: 12, paddingHorizontal: 12, paddingVertical: 8, marginVertical: 4},
33
- bubbleLeft: {alignSelf: 'flex-start', backgroundColor: '#1f3a2b'},
34
- bubbleAi: {alignSelf: 'flex-start', backgroundColor: '#212a33'},
35
- bubbleRight: {alignSelf: 'flex-end', backgroundColor: '#1d9bf0'},
36
- bubbleNote: {alignSelf: 'center', backgroundColor: '#3a2f12', borderWidth: 1, borderColor: '#8a6d1d'},
37
- bubbleAuthor: {color: '#c9d1d9', fontSize: 11, fontWeight: '700', marginBottom: 2},
38
- bubbleText: {color: '#e7e9ea', fontSize: 14, lineHeight: 20},
39
- bubbleMeta: {color: '#c9d1d9', fontSize: 10, marginTop: 4, opacity: 0.8},
40
- composer: {padding: 10, borderTopWidth: 1, borderTopColor: '#2a3441', gap: 8},
41
- modeRow: {flexDirection: 'row', gap: 6},
42
- modeChip: {borderWidth: 1, borderColor: '#38444d', borderRadius: 14, paddingHorizontal: 10, paddingVertical: 4},
43
- modeChipActive: {backgroundColor: '#1d9bf0', borderColor: '#1d9bf0'},
44
- modeChipNote: {backgroundColor: '#8a6d1d', borderColor: '#8a6d1d'},
45
- modeChipText: {color: '#e7e9ea', fontSize: 12},
46
- composerRow: {flexDirection: 'row', alignItems: 'flex-end', gap: 8},
47
- input: {flex: 1, minHeight: 40, maxHeight: 140, borderWidth: 1, borderColor: '#38444d', borderRadius: 12, paddingHorizontal: 12, paddingVertical: 8, color: '#e7e9ea', backgroundColor: '#15202b'},
48
- primaryBtn: {backgroundColor: '#1d9bf0', borderRadius: 10, paddingHorizontal: 14, paddingVertical: 10, alignItems: 'center', justifyContent: 'center'},
49
- primaryBtnText: {color: '#fff', fontWeight: '700'},
50
- ghostBtn: {borderWidth: 1, borderColor: '#1d9bf0', borderRadius: 10, paddingHorizontal: 12, paddingVertical: 8},
51
- ghostBtnText: {color: '#1d9bf0', fontWeight: '600', fontSize: 12},
52
- aiBar: {flexDirection: 'row', alignItems: 'center', gap: 8, paddingHorizontal: 12, paddingVertical: 8, backgroundColor: '#1b1530', borderBottomWidth: 1, borderBottomColor: '#2a3441'},
53
- aiBarText: {flex: 1, color: '#d8ccff', fontSize: 12},
54
- // modal
55
- modalBackdrop: {flex: 1, backgroundColor: 'rgba(0,0,0,0.6)', justifyContent: 'center', alignItems: 'center', padding: 16},
56
- modalCard: {width: '100%', maxWidth: 480, backgroundColor: '#15202b', borderRadius: 14, padding: 16, gap: 10},
57
- modalTitle: {color: '#e7e9ea', fontSize: 16, fontWeight: '700'},
58
- modalText: {color: '#8b98a5', fontSize: 13, lineHeight: 18},
59
- modalInput: {minHeight: 90, flex: 0},
60
- modalActions: {flexDirection: 'row', justifyContent: 'flex-end', gap: 8},
61
- });
5
+ /*
6
+ * @agents Ticket funnel/modal styles. Colors come only from the theme (useChatPalette → theme store +
7
+ * company theme); no color literals here (agents-mcp code-quality: theme tokens only).
8
+ */
9
+ export const makeTicketStyles = p =>
10
+ StyleSheet.create({
11
+ root: {flex: 1, backgroundColor: p.background},
12
+ header: {flexDirection: 'row', alignItems: 'center', gap: 8, padding: 12, borderBottomWidth: 1, borderBottomColor: p.border},
13
+ headerText: {flex: 1, minWidth: 0},
14
+ title: {color: p.text, fontSize: 18, fontWeight: '700'},
15
+ subtitle: {color: p.muted, fontSize: 12, marginTop: 2},
16
+ search: {minWidth: 180, maxWidth: 280, flex: 1, borderWidth: 1, borderColor: p.inputBorder, borderRadius: 10, paddingHorizontal: 10, paddingVertical: 6, color: p.inputText, backgroundColor: p.input},
17
+ board: {flex: 1},
18
+ boardContent: {padding: 12, gap: 12},
19
+ column: {width: 290, backgroundColor: p.panel, borderRadius: 12, borderTopWidth: 3, borderTopColor: p.primary, maxHeight: '100%'},
20
+ columnHeader: {flexDirection: 'row', justifyContent: 'space-between', padding: 10},
21
+ columnTitle: {color: p.text, fontWeight: '700', fontSize: 13, textTransform: 'capitalize'},
22
+ columnCount: {color: p.muted, fontSize: 12},
23
+ columnBody: {paddingHorizontal: 8, paddingBottom: 8},
24
+ card: {backgroundColor: p.otherBubble, borderWidth: 1, borderColor: p.border, borderRadius: 10, padding: 10, marginBottom: 8},
25
+ cardTitle: {color: p.text, fontSize: 13, fontWeight: '600'},
26
+ cardMeta: {color: p.muted, fontSize: 11, marginTop: 4},
27
+ badges: {flexDirection: 'row', flexWrap: 'wrap', gap: 4, marginTop: 6},
28
+ badge: {borderRadius: 6, paddingHorizontal: 6, paddingVertical: 2, backgroundColor: p.chip},
29
+ badgeAi: {backgroundColor: p.chipActive},
30
+ badgeText: {color: p.chipText, fontSize: 10, fontWeight: '600'},
31
+ badgeAiText: {color: p.chipActiveText},
32
+ cardActions: {flexDirection: 'row', gap: 6, marginTop: 8},
33
+ iconBtn: {borderWidth: 1, borderColor: p.border, borderRadius: 8, paddingHorizontal: 8, paddingVertical: 4},
34
+ iconBtnText: {color: p.text, fontSize: 12},
35
+ emptyText: {color: p.muted, fontSize: 12, padding: 8},
36
+ spinner: {marginTop: 24},
37
+ input: {flex: 1, minHeight: 40, maxHeight: 140, borderWidth: 1, borderColor: p.inputBorder, borderRadius: 12, paddingHorizontal: 12, paddingVertical: 8, color: p.inputText, backgroundColor: p.input},
38
+ primaryBtn: {backgroundColor: p.chipActive, borderRadius: 10, paddingHorizontal: 14, paddingVertical: 10, alignItems: 'center', justifyContent: 'center'},
39
+ primaryBtnText: {color: p.chipActiveText, fontWeight: '700'},
40
+ ghostBtn: {borderWidth: 1, borderColor: p.chipActive, borderRadius: 10, paddingHorizontal: 12, paddingVertical: 8},
41
+ ghostBtnText: {color: p.chipActive, fontWeight: '600', fontSize: 12},
42
+ // modal
43
+ modalBackdrop: {flex: 1, backgroundColor: p.overlay, justifyContent: 'center', alignItems: 'center', padding: 16},
44
+ modalCard: {width: '100%', maxWidth: 480, backgroundColor: p.modalBackground || p.panel, borderRadius: 14, padding: 16, gap: 10},
45
+ modalTitle: {color: p.modalHeaderText || p.text, fontSize: 16, fontWeight: '700'},
46
+ modalText: {color: p.modalText || p.muted, fontSize: 13, lineHeight: 18},
47
+ modalInput: {minHeight: 90, flex: 0},
48
+ modalActions: {flexDirection: 'row', justifyContent: 'flex-end', gap: 8},
49
+ });
50
+
51
+ export default function useTicketStyles() {
52
+ const palette = useChatPalette();
53
+ const styles = useMemo(() => makeTicketStyles(palette), [palette]);
54
+ return {styles, palette};
55
+ }