@controleonline/ui-crm 1.0.42
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.
- package/.github/actions/workers/manager/action.yml +147 -0
- package/.github/actions/workers/qa/action.yml +44 -0
- package/.github/actions/workers/security/action.yml +44 -0
- package/.github/actions/workers/technical-documenter/action.yml +51 -0
- package/.github/workflows/manager-worker.yml +167 -0
- package/.github/workflows/publish-npm.yml +40 -0
- package/.github/workflows/pull-request-checks.yml +29 -0
- package/.scrutinizer.yml +24 -0
- package/AGENTS.md +56 -0
- package/FUNDING.yml +1 -0
- package/docs/technical/Cliente-Vendedor-Vinculo-e-Permissoes.md +121 -0
- package/docs/technical/Income-Statements-Demonstrativo.md +38 -0
- package/docs/technical/Oportunidades-Ordenacao-por-Data-de-Retorno.md +134 -0
- package/docs/technical/Propostas-Filtro-de-Status.md +147 -0
- package/docs/technical/Royalties-a-pagar-Franqueado.md +51 -0
- package/docs/technical/Visao-Vendedor-Comissoes.md +58 -0
- package/docs/wiki.md +1 -0
- package/package.json +43 -0
- package/scripts/validate-wiki-pointer.cjs +13 -0
- package/src/react/components/AnimatedModal.js +149 -0
- package/src/react/components/AnimatedModal.styles.js +21 -0
- package/src/react/components/CreateContractModal.js +151 -0
- package/src/react/components/CreateContractModal.styles.js +43 -0
- package/src/react/hooks/useToastMessage.js +59 -0
- package/src/react/index.js +4 -0
- package/src/react/pages/ModelTemplatesPage.js +1461 -0
- package/src/react/pages/ModelTemplatesPage.styles.js +441 -0
- package/src/react/pages/comissions/IncomeStatementDetailsModal.js +102 -0
- package/src/react/pages/comissions/IncomeStatementsFilters.js +120 -0
- package/src/react/pages/comissions/SellerCommissionsPage.js +368 -0
- package/src/react/pages/comissions/SellerCommissionsPage.styles.js +219 -0
- package/src/react/pages/comissions/incomeStatementsHelpers.js +233 -0
- package/src/react/pages/comissions/index.js +309 -0
- package/src/react/pages/comissions/index.styles.js +381 -0
- package/src/react/pages/comissions/sellerCommissionsHelpers.js +222 -0
- package/src/react/pages/crm/components/CrmHeader.js +117 -0
- package/src/react/pages/crm/components/MarketingEventsSection.js +142 -0
- package/src/react/pages/crm/components/MarketingEventsSection.styles.js +105 -0
- package/src/react/pages/crm/components/OpportunityCard.js +138 -0
- package/src/react/pages/crm/components/OpportunityFormModal.js +279 -0
- package/src/react/pages/crm/components/OpportunityList.js +113 -0
- package/src/react/pages/crm/components/OpportunitySkeletons.js +53 -0
- package/src/react/pages/crm/components/ProviderSelectModal.js +166 -0
- package/src/react/pages/crm/components/SelectModal.js +178 -0
- package/src/react/pages/crm/conversation.js +342 -0
- package/src/react/pages/crm/conversation.styles.js +206 -0
- package/src/react/pages/crm/hooks/useCrmData.js +494 -0
- package/src/react/pages/crm/hooks/useOpportunityForms.js +306 -0
- package/src/react/pages/crm/index.js +262 -0
- package/src/react/pages/crm/index.styles.js +13 -0
- package/src/react/pages/crm/marketingEventsHelpers.js +41 -0
- package/src/react/pages/crm/styles/card.styles.js +178 -0
- package/src/react/pages/crm/styles/layout.styles.js +184 -0
- package/src/react/pages/crm/styles/modal.styles.js +347 -0
- package/src/react/pages/home/index.js +559 -0
- package/src/react/pages/home/index.styles.js +268 -0
- package/src/react/pages/proposals/CreateProposalsModal.js +466 -0
- package/src/react/pages/proposals/CreateProposalsModal.styles.js +344 -0
- package/src/react/pages/proposals/CreateProposalsPickers.js +187 -0
- package/src/react/pages/proposals/CreateProposalsProductSection.js +117 -0
- package/src/react/pages/proposals/ProposalCard.js +112 -0
- package/src/react/pages/proposals/ProposalDetails.js +263 -0
- package/src/react/pages/proposals/ProposalDetails.styles.js +195 -0
- package/src/react/pages/proposals/index.js +488 -0
- package/src/react/pages/proposals/index.styles.js +248 -0
- package/src/react/pages/proposals/proposalListHelpers.js +216 -0
- package/src/react/pages/proposals/proposalNavigation.js +26 -0
- package/src/react/pages/royalties/ReceivablePage.js +233 -0
- package/src/react/pages/royalties/RoyaltiesPayablePage.js +260 -0
- package/src/react/pages/royalties/index.js +2 -0
- package/src/react/pages/royalties/royaltiesReceivableHelpers.js +68 -0
- package/src/react/pages/settings/GeneralSettings.js +317 -0
- package/src/react/pages/settings/GeneralSettings.shared.js +490 -0
- package/src/react/pages/settings/GeneralSettings.styles.js +746 -0
- package/src/react/pages/settings/GeneralSettingsSection.js +57 -0
- package/src/react/pages/settings/generalSettingsActiveTab.js +85 -0
- package/src/react/pages/settings/sections/CrmSection.js +281 -0
- package/src/react/pages/settings/sections/DeviceRuntimeFooterSection.js +128 -0
- package/src/react/pages/settings/sections/DisplayPreparationSection.js +155 -0
- package/src/react/pages/settings/sections/IntegrationsSection.js +392 -0
- package/src/react/pages/settings/sections/LogSection.js +322 -0
- package/src/react/pages/settings/sections/LoginSection.js +137 -0
- package/src/react/pages/settings/sections/LoyaltyProductPicker.js +230 -0
- package/src/react/pages/settings/sections/LoyaltySection.js +451 -0
- package/src/react/pages/settings/sections/MaintenanceSection.js +205 -0
- package/src/react/pages/settings/sections/MapsSection.js +629 -0
- package/src/react/pages/settings/sections/MenuCatalogSection.js +405 -0
- package/src/react/pages/settings/sections/OperationsSection.js +303 -0
- package/src/react/pages/settings/sections/OrderPaymentSection.js +379 -0
- package/src/react/pages/settings/sections/OrderPrintSection.js +308 -0
- package/src/react/pages/settings/sections/ShopSection.js +490 -0
- package/src/react/pages/settings/sections/shop/FranchiseMapPreview.js +124 -0
- package/src/react/pages/settings/sections/shop/ShopDomainCreateForm.js +57 -0
- package/src/react/pages/settings/sections/shop/ShopDomainPanel.js +184 -0
- package/src/react/pages/settings/sections/shop/ShopDomainShowcasesSection.js +237 -0
- package/src/react/pages/settings/sections/shop/ShopDomainShowcasesSection.styles.js +256 -0
- package/src/react/pages/settings/sections/shop/ShopDomainTabs.js +61 -0
- package/src/react/pages/settings/sections/shop/ShopFranchiseLocatorSection.js +526 -0
- package/src/react/pages/settings/sections/shop/ShopLoyaltySection.js +426 -0
- package/src/react/pages/settings/sections/shop/ShopSettingsSection.js +10 -0
- package/src/react/pages/settings/sections/shop/mapsFranchiseMapHelpers.js +163 -0
- package/src/react/pages/settings/sections/shop/shopDomainShowcasesUtils.js +68 -0
- package/src/react/pages/settings/sections/shop/shopFranchiseVisibility.js +158 -0
- package/src/react/pages/settings/sections/shop/shopSettingsShared.js +427 -0
- package/src/react/router/routes.js +135 -0
- package/src/react/utils/opportunityDate.js +82 -0
- package/src/react/utils/opportunityEditorReferences.js +76 -0
- package/src/react/utils/opportunityEmptyState.js +20 -0
- package/src/react/utils/opportunityPeople.js +111 -0
- package/src/react/utils/opportunityPhone.js +82 -0
- package/src/react/utils/opportunityStage.js +30 -0
- package/src/react/utils/opportunityStatusFilter.js +54 -0
- package/src/react/utils/proposalCreateHelpers.js +61 -0
- package/src/react/utils/proposalProductSelection.js +71 -0
- package/src/react/utils/royaltiesPayableParams.js +37 -0
- package/src/react/utils/translateWithFallback.js +42 -0
- package/src/store/crm/index.js +2 -0
- package/src/store/model/index.js +104 -0
- package/src/tests/browser/crm/create-proposal-product-category-filter.spec.js +149 -0
- package/src/tests/browser/crm/crm-index-status-filter.spec.js +263 -0
- package/src/tests/browser/crm/crm-opportunity-category-editor.spec.js +269 -0
- package/src/tests/browser/crm/royalties-payable.spec.js +122 -0
- package/src/tests/browser/crm/royalties-receivable.spec.js +121 -0
- package/src/tests/browser/crm/seller-commissions.spec.js +214 -0
- package/src/tests/browser/manager/general-settings-maps.spec.js +400 -0
- package/src/tests/react/pages/comissions/incomeStatementsHelpers.test.js +181 -0
- package/src/tests/react/pages/comissions/sellerCommissionsHelpers.test.js +132 -0
- package/src/tests/react/pages/crm/marketingEventsHelpers.test.cjs +53 -0
- package/src/tests/react/pages/crm/opportunitySearchParams.test.cjs +44 -0
- package/src/tests/react/pages/proposals/navigation.test.js +71 -0
- package/src/tests/react/pages/proposals/proposalListHelpers.test.js +42 -0
- package/src/tests/react/pages/royalties/royaltiesReceivableHelpers.test.js +60 -0
- package/src/tests/react/pages/settings/generalSettings.shared.test.js +102 -0
- package/src/tests/react/pages/settings/sections/shop/shopDomainShowcasesUtils.test.js +60 -0
- package/src/tests/react/pages/settings/sections/shop/shopFranchiseVisibility.test.js +80 -0
- package/src/tests/react/utils/opportunityEditorReferences.test.js +70 -0
- package/src/tests/react/utils/opportunityEmptyState.test.js +39 -0
- package/src/tests/react/utils/opportunityStatusFilter.test.cjs +81 -0
- package/src/tests/react/utils/proposalCreateHelpers.test.js +25 -0
- package/src/tests/react/utils/proposalProductSelection.test.js +76 -0
- package/src/tests/react/utils/royaltiesPayableParams.test.js +44 -0
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @agents Keep the visual tokens for the settings page centralized here.
|
|
3
|
+
* The screen and its sections should share the same spacing, radius, and typography rhythm.
|
|
4
|
+
*/
|
|
5
|
+
import {useMemo} from 'react';
|
|
6
|
+
import {StyleSheet} from 'react-native';
|
|
7
|
+
|
|
8
|
+
import {useStore} from '@store';
|
|
9
|
+
|
|
10
|
+
const normalizeGeneralSettingsThemeColors = themeColors => {
|
|
11
|
+
if (!themeColors) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof themeColors === 'object' && !Array.isArray(themeColors)) {
|
|
16
|
+
return themeColors;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof themeColors !== 'string') {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const parsedColors = JSON.parse(themeColors);
|
|
25
|
+
return parsedColors &&
|
|
26
|
+
typeof parsedColors === 'object' &&
|
|
27
|
+
!Array.isArray(parsedColors)
|
|
28
|
+
? parsedColors
|
|
29
|
+
: {};
|
|
30
|
+
} catch {
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const buildGeneralSettingsPalette = themeColors => ({
|
|
36
|
+
badgeBorder: themeColors.badgeBorder,
|
|
37
|
+
badgeDisabledBackground: themeColors.badgeDisabledBackground,
|
|
38
|
+
badgeDisabledText: themeColors.badgeDisabledText,
|
|
39
|
+
badgeSelectedBackground: themeColors.badgeSelectedBackground,
|
|
40
|
+
badgeSelectedBorder: themeColors.badgeSelectedBorder,
|
|
41
|
+
badgeSelectedText: themeColors.badgeSelectedText,
|
|
42
|
+
buttonBackground: themeColors.buttonBackground,
|
|
43
|
+
buttonBackgroundSecondary: themeColors.buttonBackgroundSecondary,
|
|
44
|
+
buttonBorder: themeColors.buttonBorder,
|
|
45
|
+
buttonBorderSecondary: themeColors.buttonBorderSecondary,
|
|
46
|
+
buttonIcon: themeColors.buttonIcon,
|
|
47
|
+
buttonIconSecondary: themeColors.buttonIconSecondary,
|
|
48
|
+
buttonText: themeColors.buttonText,
|
|
49
|
+
buttonTextSecondary: themeColors.buttonTextSecondary,
|
|
50
|
+
cardBackground: themeColors.cardBackground,
|
|
51
|
+
cardBorder: themeColors.cardBorder,
|
|
52
|
+
cardIconColor: themeColors.cardIconColor,
|
|
53
|
+
cardIconBackground: themeColors.cardIconBackground,
|
|
54
|
+
cardIconBorder: themeColors.cardIconBorder,
|
|
55
|
+
cardText: themeColors.cardText,
|
|
56
|
+
containerTransparentBackground: themeColors.containerTransparentBackground,
|
|
57
|
+
error: themeColors.error,
|
|
58
|
+
iconActive: themeColors.iconActive,
|
|
59
|
+
iconDanger: themeColors.iconDanger,
|
|
60
|
+
iconDisabled: themeColors.iconDisabled,
|
|
61
|
+
iconInfo: themeColors.iconInfo,
|
|
62
|
+
iconSuccess: themeColors.iconSuccess,
|
|
63
|
+
iconWarning: themeColors.iconWarning,
|
|
64
|
+
info: themeColors.info,
|
|
65
|
+
inputBackground: themeColors.inputBackground,
|
|
66
|
+
inputBorder: themeColors.inputBorder,
|
|
67
|
+
inputDisabledBackground: themeColors.inputDisabledBackground,
|
|
68
|
+
inputDisabledText: themeColors.inputDisabledText,
|
|
69
|
+
inputIcon: themeColors.inputIcon,
|
|
70
|
+
inputPlaceholderText: themeColors.inputPlaceholderText,
|
|
71
|
+
inputText: themeColors.inputText,
|
|
72
|
+
listItemBackground: themeColors.listItemBackground,
|
|
73
|
+
listItemBorder: themeColors.listItemBorder,
|
|
74
|
+
listItemSelectedBackground: themeColors.listItemSelectedBackground,
|
|
75
|
+
listItemSelectedBorder: themeColors.listItemSelectedBorder,
|
|
76
|
+
listItemSubtitleText: themeColors.listItemSubtitleText,
|
|
77
|
+
listItemText: themeColors.listItemText,
|
|
78
|
+
loadingSpinner: themeColors.loadingSpinner,
|
|
79
|
+
modalBackground: themeColors.modalBackground,
|
|
80
|
+
modalBorder: themeColors.modalBorder,
|
|
81
|
+
modalCloseIcon: themeColors.modalCloseIcon,
|
|
82
|
+
modalHeaderText: themeColors.modalHeaderText,
|
|
83
|
+
modalText: themeColors.modalText,
|
|
84
|
+
navigationActiveBackground: themeColors.navigationActiveBackground,
|
|
85
|
+
navigationBackground: themeColors.navigationBackground,
|
|
86
|
+
navigationBorder: themeColors.navigationBorder,
|
|
87
|
+
navigationText: themeColors.navigationText,
|
|
88
|
+
pageBackground: themeColors.pageBackground,
|
|
89
|
+
primary: themeColors.primary,
|
|
90
|
+
success: themeColors.success,
|
|
91
|
+
switchDisabledThumb: themeColors.switchDisabledThumb,
|
|
92
|
+
switchDisabledTrack: themeColors.switchDisabledTrack,
|
|
93
|
+
switchOffThumb: themeColors.switchOffThumb,
|
|
94
|
+
switchOffTrack: themeColors.switchOffTrack,
|
|
95
|
+
switchOnThumb: themeColors.switchOnThumb,
|
|
96
|
+
switchOnTrack: themeColors.switchOnTrack,
|
|
97
|
+
textMuted: themeColors.textMuted,
|
|
98
|
+
textPrimary: themeColors.textPrimary,
|
|
99
|
+
textSecondary: themeColors.textSecondary,
|
|
100
|
+
warning: themeColors.warning,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export const getGeneralSettingsSwitchProps = ({
|
|
104
|
+
disabled = false,
|
|
105
|
+
palette,
|
|
106
|
+
value = false,
|
|
107
|
+
}) => {
|
|
108
|
+
const offTrackColor = disabled
|
|
109
|
+
? palette.switchDisabledTrack
|
|
110
|
+
: palette.switchOffTrack;
|
|
111
|
+
const onTrackColor = disabled
|
|
112
|
+
? palette.switchDisabledTrack
|
|
113
|
+
: palette.switchOnTrack;
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
ios_backgroundColor: offTrackColor,
|
|
117
|
+
thumbColor: disabled
|
|
118
|
+
? palette.switchDisabledThumb
|
|
119
|
+
: value
|
|
120
|
+
? palette.switchOnThumb
|
|
121
|
+
: palette.switchOffThumb,
|
|
122
|
+
trackColor: {
|
|
123
|
+
false: offTrackColor,
|
|
124
|
+
true: onTrackColor,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const createGeneralSettingsStyles = palette =>
|
|
130
|
+
StyleSheet.create({
|
|
131
|
+
pageTitle: {
|
|
132
|
+
fontSize: 28,
|
|
133
|
+
fontWeight: '700',
|
|
134
|
+
color: palette.textPrimary,
|
|
135
|
+
marginTop: 16,
|
|
136
|
+
},
|
|
137
|
+
pageSubtitle: {
|
|
138
|
+
fontSize: 14,
|
|
139
|
+
color: palette.textSecondary,
|
|
140
|
+
marginTop: 6,
|
|
141
|
+
marginBottom: 18,
|
|
142
|
+
},
|
|
143
|
+
tabBar: {
|
|
144
|
+
backgroundColor: palette.navigationBackground,
|
|
145
|
+
borderRadius: 16,
|
|
146
|
+
borderWidth: 1,
|
|
147
|
+
borderColor: palette.navigationBorder,
|
|
148
|
+
},
|
|
149
|
+
tabBarContent: {
|
|
150
|
+
flexDirection: 'row',
|
|
151
|
+
gap: 6,
|
|
152
|
+
padding: 6,
|
|
153
|
+
},
|
|
154
|
+
tabItem: {
|
|
155
|
+
flexDirection: 'row',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
gap: 6,
|
|
159
|
+
paddingVertical: 12,
|
|
160
|
+
paddingHorizontal: 16,
|
|
161
|
+
borderRadius: 8,
|
|
162
|
+
borderWidth: 1,
|
|
163
|
+
},
|
|
164
|
+
tabLabel: {
|
|
165
|
+
fontSize: 13,
|
|
166
|
+
fontWeight: '600',
|
|
167
|
+
},
|
|
168
|
+
tabLabelActive: {
|
|
169
|
+
fontWeight: '700',
|
|
170
|
+
},
|
|
171
|
+
tabHelper: {
|
|
172
|
+
fontSize: 13,
|
|
173
|
+
lineHeight: 18,
|
|
174
|
+
color: palette.textSecondary,
|
|
175
|
+
marginTop: 10,
|
|
176
|
+
marginBottom: 18,
|
|
177
|
+
},
|
|
178
|
+
sectionCard: {
|
|
179
|
+
backgroundColor: palette.cardBackground,
|
|
180
|
+
borderRadius: 18,
|
|
181
|
+
borderWidth: 1,
|
|
182
|
+
borderColor: palette.cardBorder,
|
|
183
|
+
padding: 18,
|
|
184
|
+
marginBottom: 18,
|
|
185
|
+
},
|
|
186
|
+
sectionHeader: {
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
alignItems: 'flex-start',
|
|
189
|
+
marginBottom: 16,
|
|
190
|
+
},
|
|
191
|
+
sectionIconWrap: {
|
|
192
|
+
width: 42,
|
|
193
|
+
height: 42,
|
|
194
|
+
borderRadius: 14,
|
|
195
|
+
alignItems: 'center',
|
|
196
|
+
justifyContent: 'center',
|
|
197
|
+
borderWidth: 1,
|
|
198
|
+
borderColor: palette.cardIconBorder,
|
|
199
|
+
marginRight: 12,
|
|
200
|
+
},
|
|
201
|
+
sectionHeaderCopy: {
|
|
202
|
+
flex: 1,
|
|
203
|
+
},
|
|
204
|
+
sectionTitle: {
|
|
205
|
+
fontSize: 18,
|
|
206
|
+
fontWeight: '700',
|
|
207
|
+
color: palette.cardText,
|
|
208
|
+
},
|
|
209
|
+
sectionTitleRow: {
|
|
210
|
+
flexDirection: 'row',
|
|
211
|
+
alignItems: 'center',
|
|
212
|
+
},
|
|
213
|
+
sectionTitleHelp: {
|
|
214
|
+
marginLeft: 8,
|
|
215
|
+
},
|
|
216
|
+
sectionDescription: {
|
|
217
|
+
fontSize: 13,
|
|
218
|
+
lineHeight: 18,
|
|
219
|
+
color: palette.textSecondary,
|
|
220
|
+
marginTop: 4,
|
|
221
|
+
},
|
|
222
|
+
statusRow: {
|
|
223
|
+
flexDirection: 'row',
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
justifyContent: 'space-between',
|
|
226
|
+
marginBottom: 8,
|
|
227
|
+
},
|
|
228
|
+
settingRow: {
|
|
229
|
+
flexDirection: 'row',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
justifyContent: 'space-between',
|
|
232
|
+
marginBottom: 14,
|
|
233
|
+
},
|
|
234
|
+
settingCopy: {
|
|
235
|
+
flex: 1,
|
|
236
|
+
marginRight: 12,
|
|
237
|
+
},
|
|
238
|
+
settingDescription: {
|
|
239
|
+
fontSize: 12,
|
|
240
|
+
lineHeight: 18,
|
|
241
|
+
color: palette.textSecondary,
|
|
242
|
+
marginTop: 4,
|
|
243
|
+
},
|
|
244
|
+
statusLabel: {
|
|
245
|
+
fontSize: 14,
|
|
246
|
+
fontWeight: '600',
|
|
247
|
+
color: palette.textPrimary,
|
|
248
|
+
},
|
|
249
|
+
statusChip: {
|
|
250
|
+
flexDirection: 'row',
|
|
251
|
+
alignItems: 'center',
|
|
252
|
+
paddingHorizontal: 12,
|
|
253
|
+
paddingVertical: 8,
|
|
254
|
+
borderRadius: 999,
|
|
255
|
+
borderWidth: 1,
|
|
256
|
+
borderColor: palette.badgeBorder,
|
|
257
|
+
},
|
|
258
|
+
statusChipEnabled: {
|
|
259
|
+
backgroundColor: palette.badgeSelectedBackground,
|
|
260
|
+
borderColor: palette.badgeSelectedBorder,
|
|
261
|
+
},
|
|
262
|
+
statusChipDisabled: {
|
|
263
|
+
backgroundColor: palette.badgeDisabledBackground,
|
|
264
|
+
},
|
|
265
|
+
statusChipText: {
|
|
266
|
+
fontSize: 13,
|
|
267
|
+
fontWeight: '700',
|
|
268
|
+
marginLeft: 6,
|
|
269
|
+
},
|
|
270
|
+
helperText: {
|
|
271
|
+
fontSize: 13,
|
|
272
|
+
color: palette.textSecondary,
|
|
273
|
+
marginBottom: 14,
|
|
274
|
+
},
|
|
275
|
+
emptyBox: {
|
|
276
|
+
borderRadius: 14,
|
|
277
|
+
backgroundColor: palette.pageBackground,
|
|
278
|
+
borderWidth: 1,
|
|
279
|
+
borderColor: palette.cardBorder,
|
|
280
|
+
padding: 14,
|
|
281
|
+
},
|
|
282
|
+
emptyTitle: {
|
|
283
|
+
fontSize: 14,
|
|
284
|
+
fontWeight: '700',
|
|
285
|
+
color: palette.textPrimary,
|
|
286
|
+
marginBottom: 4,
|
|
287
|
+
},
|
|
288
|
+
emptyText: {
|
|
289
|
+
fontSize: 13,
|
|
290
|
+
lineHeight: 18,
|
|
291
|
+
color: palette.textSecondary,
|
|
292
|
+
},
|
|
293
|
+
printerList: {
|
|
294
|
+
gap: 10,
|
|
295
|
+
},
|
|
296
|
+
giftProductResult: {
|
|
297
|
+
marginTop: 10,
|
|
298
|
+
},
|
|
299
|
+
printerItem: {
|
|
300
|
+
flexDirection: 'row',
|
|
301
|
+
alignItems: 'center',
|
|
302
|
+
borderRadius: 14,
|
|
303
|
+
borderWidth: 1,
|
|
304
|
+
borderColor: palette.listItemBorder,
|
|
305
|
+
backgroundColor: palette.listItemBackground,
|
|
306
|
+
paddingHorizontal: 14,
|
|
307
|
+
paddingVertical: 12,
|
|
308
|
+
},
|
|
309
|
+
printerItemActive: {
|
|
310
|
+
borderColor: palette.listItemSelectedBorder,
|
|
311
|
+
backgroundColor: palette.listItemSelectedBackground,
|
|
312
|
+
},
|
|
313
|
+
printerCopy: {
|
|
314
|
+
flex: 1,
|
|
315
|
+
marginLeft: 12,
|
|
316
|
+
},
|
|
317
|
+
printerName: {
|
|
318
|
+
fontSize: 14,
|
|
319
|
+
fontWeight: '700',
|
|
320
|
+
color: palette.listItemText,
|
|
321
|
+
},
|
|
322
|
+
printerDevice: {
|
|
323
|
+
fontSize: 12,
|
|
324
|
+
color: palette.listItemSubtitleText,
|
|
325
|
+
marginTop: 2,
|
|
326
|
+
},
|
|
327
|
+
franchiseAddressGroupList: {
|
|
328
|
+
gap: 12,
|
|
329
|
+
},
|
|
330
|
+
franchiseAddressGroup: {
|
|
331
|
+
borderRadius: 16,
|
|
332
|
+
borderWidth: 1,
|
|
333
|
+
borderColor: palette.cardBorder,
|
|
334
|
+
backgroundColor: palette.cardBackground,
|
|
335
|
+
padding: 14,
|
|
336
|
+
},
|
|
337
|
+
franchiseAddressGroupHeader: {
|
|
338
|
+
flexDirection: 'row',
|
|
339
|
+
alignItems: 'center',
|
|
340
|
+
marginBottom: 12,
|
|
341
|
+
},
|
|
342
|
+
franchiseAddressGroupBadge: {
|
|
343
|
+
width: 38,
|
|
344
|
+
height: 38,
|
|
345
|
+
borderRadius: 12,
|
|
346
|
+
alignItems: 'center',
|
|
347
|
+
justifyContent: 'center',
|
|
348
|
+
backgroundColor: palette.cardIconBackground,
|
|
349
|
+
borderWidth: 1,
|
|
350
|
+
borderColor: palette.cardIconBorder,
|
|
351
|
+
},
|
|
352
|
+
franchiseAddressGroupCopy: {
|
|
353
|
+
flex: 1,
|
|
354
|
+
marginLeft: 10,
|
|
355
|
+
},
|
|
356
|
+
franchiseAddressAddBtn: {
|
|
357
|
+
width: 30,
|
|
358
|
+
height: 30,
|
|
359
|
+
borderRadius: 8,
|
|
360
|
+
alignItems: 'center',
|
|
361
|
+
justifyContent: 'center',
|
|
362
|
+
backgroundColor: palette.buttonBackgroundSecondary,
|
|
363
|
+
borderWidth: 1,
|
|
364
|
+
borderColor: palette.buttonBorderSecondary,
|
|
365
|
+
marginLeft: 8,
|
|
366
|
+
},
|
|
367
|
+
franchiseAddressOptionList: {
|
|
368
|
+
gap: 8,
|
|
369
|
+
},
|
|
370
|
+
franchiseAddressOption: {
|
|
371
|
+
flexDirection: 'row',
|
|
372
|
+
alignItems: 'center',
|
|
373
|
+
borderRadius: 14,
|
|
374
|
+
borderWidth: 1,
|
|
375
|
+
borderColor: palette.listItemBorder,
|
|
376
|
+
backgroundColor: palette.listItemBackground,
|
|
377
|
+
paddingHorizontal: 14,
|
|
378
|
+
paddingVertical: 12,
|
|
379
|
+
},
|
|
380
|
+
franchiseAddressOptionActive: {
|
|
381
|
+
borderColor: palette.listItemSelectedBorder,
|
|
382
|
+
backgroundColor: palette.listItemSelectedBackground,
|
|
383
|
+
},
|
|
384
|
+
franchiseAddressOptionCopy: {
|
|
385
|
+
flex: 1,
|
|
386
|
+
marginLeft: 12,
|
|
387
|
+
},
|
|
388
|
+
franchiseAddressName: {
|
|
389
|
+
fontSize: 14,
|
|
390
|
+
fontWeight: '700',
|
|
391
|
+
color: palette.listItemText,
|
|
392
|
+
},
|
|
393
|
+
primaryButton: {
|
|
394
|
+
marginTop: 16,
|
|
395
|
+
justifyContent: 'center',
|
|
396
|
+
},
|
|
397
|
+
secondaryButton: {
|
|
398
|
+
marginTop: 10,
|
|
399
|
+
justifyContent: 'center',
|
|
400
|
+
backgroundColor: palette.buttonBackgroundSecondary,
|
|
401
|
+
},
|
|
402
|
+
primaryButtonDisabled: {
|
|
403
|
+
opacity: 0.6,
|
|
404
|
+
},
|
|
405
|
+
primaryButtonText: {
|
|
406
|
+
color: palette.buttonText,
|
|
407
|
+
fontWeight: '700',
|
|
408
|
+
},
|
|
409
|
+
fieldBlock: {
|
|
410
|
+
marginTop: 16,
|
|
411
|
+
},
|
|
412
|
+
fieldLabel: {
|
|
413
|
+
fontSize: 14,
|
|
414
|
+
fontWeight: '600',
|
|
415
|
+
color: palette.textPrimary,
|
|
416
|
+
marginBottom: 6,
|
|
417
|
+
},
|
|
418
|
+
selectorRow: {
|
|
419
|
+
flexDirection: 'row',
|
|
420
|
+
alignItems: 'center',
|
|
421
|
+
gap: 10,
|
|
422
|
+
},
|
|
423
|
+
selectorInput: {
|
|
424
|
+
flex: 1,
|
|
425
|
+
marginTop: 0,
|
|
426
|
+
},
|
|
427
|
+
selectorListButton: {
|
|
428
|
+
minHeight: 48,
|
|
429
|
+
paddingHorizontal: 14,
|
|
430
|
+
borderRadius: 10,
|
|
431
|
+
backgroundColor: palette.buttonBackground,
|
|
432
|
+
flexDirection: 'row',
|
|
433
|
+
alignItems: 'center',
|
|
434
|
+
justifyContent: 'center',
|
|
435
|
+
},
|
|
436
|
+
selectorListButtonText: {
|
|
437
|
+
color: palette.buttonText,
|
|
438
|
+
fontSize: 13,
|
|
439
|
+
fontWeight: '700',
|
|
440
|
+
marginLeft: 6,
|
|
441
|
+
},
|
|
442
|
+
input: {
|
|
443
|
+
minHeight: 48,
|
|
444
|
+
borderRadius: 10,
|
|
445
|
+
borderWidth: 1,
|
|
446
|
+
borderColor: palette.inputBorder,
|
|
447
|
+
backgroundColor: palette.inputBackground,
|
|
448
|
+
color: palette.inputText,
|
|
449
|
+
paddingHorizontal: 14,
|
|
450
|
+
paddingVertical: 10,
|
|
451
|
+
marginTop: 6,
|
|
452
|
+
},
|
|
453
|
+
inputDisabled: {
|
|
454
|
+
backgroundColor: palette.inputDisabledBackground,
|
|
455
|
+
color: palette.inputDisabledText,
|
|
456
|
+
},
|
|
457
|
+
multilineInput: {
|
|
458
|
+
minHeight: 96,
|
|
459
|
+
textAlignVertical: 'top',
|
|
460
|
+
},
|
|
461
|
+
logPolicyList: {
|
|
462
|
+
gap: 12,
|
|
463
|
+
},
|
|
464
|
+
logPolicyCard: {
|
|
465
|
+
borderRadius: 14,
|
|
466
|
+
borderWidth: 1,
|
|
467
|
+
borderColor: palette.cardBorder,
|
|
468
|
+
backgroundColor: palette.pageBackground,
|
|
469
|
+
padding: 14,
|
|
470
|
+
},
|
|
471
|
+
profileRow: {
|
|
472
|
+
flexDirection: 'row',
|
|
473
|
+
alignItems: 'center',
|
|
474
|
+
marginTop: 10,
|
|
475
|
+
},
|
|
476
|
+
profileInput: {
|
|
477
|
+
flex: 1,
|
|
478
|
+
marginTop: 0,
|
|
479
|
+
},
|
|
480
|
+
profileInputSpacing: {
|
|
481
|
+
marginLeft: 10,
|
|
482
|
+
},
|
|
483
|
+
removeProfileButton: {
|
|
484
|
+
alignItems: 'center',
|
|
485
|
+
borderRadius: 8,
|
|
486
|
+
borderWidth: 1,
|
|
487
|
+
height: 34,
|
|
488
|
+
justifyContent: 'center',
|
|
489
|
+
marginLeft: 10,
|
|
490
|
+
width: 34,
|
|
491
|
+
},
|
|
492
|
+
selectionModal: {
|
|
493
|
+
backgroundColor: palette.modalBackground,
|
|
494
|
+
borderTopLeftRadius: 24,
|
|
495
|
+
borderTopRightRadius: 24,
|
|
496
|
+
height: '88%',
|
|
497
|
+
paddingBottom: 20,
|
|
498
|
+
},
|
|
499
|
+
selectionModalHeader: {
|
|
500
|
+
flexDirection: 'row',
|
|
501
|
+
alignItems: 'flex-start',
|
|
502
|
+
justifyContent: 'space-between',
|
|
503
|
+
paddingHorizontal: 20,
|
|
504
|
+
paddingTop: 18,
|
|
505
|
+
paddingBottom: 14,
|
|
506
|
+
borderBottomWidth: 1,
|
|
507
|
+
borderBottomColor: palette.modalBorder,
|
|
508
|
+
},
|
|
509
|
+
selectionModalHeaderCopy: {
|
|
510
|
+
flex: 1,
|
|
511
|
+
marginRight: 12,
|
|
512
|
+
},
|
|
513
|
+
selectionModalTitle: {
|
|
514
|
+
fontSize: 17,
|
|
515
|
+
fontWeight: '800',
|
|
516
|
+
color: palette.modalHeaderText,
|
|
517
|
+
},
|
|
518
|
+
selectionModalSubtitle: {
|
|
519
|
+
fontSize: 12,
|
|
520
|
+
lineHeight: 18,
|
|
521
|
+
color: palette.modalText,
|
|
522
|
+
marginTop: 4,
|
|
523
|
+
},
|
|
524
|
+
selectionModalClose: {
|
|
525
|
+
width: 34,
|
|
526
|
+
height: 34,
|
|
527
|
+
borderRadius: 17,
|
|
528
|
+
backgroundColor: palette.inputBackground,
|
|
529
|
+
borderWidth: 1,
|
|
530
|
+
borderColor: palette.inputBorder,
|
|
531
|
+
alignItems: 'center',
|
|
532
|
+
justifyContent: 'center',
|
|
533
|
+
},
|
|
534
|
+
selectionSearchWrap: {
|
|
535
|
+
flexDirection: 'row',
|
|
536
|
+
alignItems: 'center',
|
|
537
|
+
marginHorizontal: 16,
|
|
538
|
+
marginTop: 16,
|
|
539
|
+
paddingHorizontal: 14,
|
|
540
|
+
paddingVertical: 10,
|
|
541
|
+
backgroundColor: palette.inputBackground,
|
|
542
|
+
borderRadius: 12,
|
|
543
|
+
borderWidth: 1,
|
|
544
|
+
borderColor: palette.inputBorder,
|
|
545
|
+
},
|
|
546
|
+
selectionSearchIcon: {
|
|
547
|
+
marginRight: 8,
|
|
548
|
+
},
|
|
549
|
+
selectionSearchInput: {
|
|
550
|
+
flex: 1,
|
|
551
|
+
fontSize: 14,
|
|
552
|
+
color: palette.inputText,
|
|
553
|
+
padding: 0,
|
|
554
|
+
},
|
|
555
|
+
selectionModalList: {
|
|
556
|
+
flex: 1,
|
|
557
|
+
marginTop: 12,
|
|
558
|
+
},
|
|
559
|
+
selectionModalListContent: {
|
|
560
|
+
paddingHorizontal: 16,
|
|
561
|
+
paddingBottom: 8,
|
|
562
|
+
},
|
|
563
|
+
selectionModalActionButton: {
|
|
564
|
+
flex: 0,
|
|
565
|
+
minHeight: 52,
|
|
566
|
+
marginHorizontal: 16,
|
|
567
|
+
marginTop: 16,
|
|
568
|
+
paddingHorizontal: 20,
|
|
569
|
+
borderRadius: 16,
|
|
570
|
+
alignSelf: 'stretch',
|
|
571
|
+
},
|
|
572
|
+
selectionModalItem: {
|
|
573
|
+
flexDirection: 'row',
|
|
574
|
+
alignItems: 'center',
|
|
575
|
+
borderRadius: 14,
|
|
576
|
+
borderWidth: 1,
|
|
577
|
+
borderColor: palette.listItemBorder,
|
|
578
|
+
backgroundColor: palette.listItemBackground,
|
|
579
|
+
paddingHorizontal: 14,
|
|
580
|
+
paddingVertical: 12,
|
|
581
|
+
marginBottom: 10,
|
|
582
|
+
},
|
|
583
|
+
selectionModalItemActive: {
|
|
584
|
+
borderColor: palette.listItemSelectedBorder,
|
|
585
|
+
backgroundColor: palette.listItemSelectedBackground,
|
|
586
|
+
},
|
|
587
|
+
selectionModalItemCopy: {
|
|
588
|
+
flex: 1,
|
|
589
|
+
marginLeft: 12,
|
|
590
|
+
},
|
|
591
|
+
selectionModalItemTitle: {
|
|
592
|
+
fontSize: 14,
|
|
593
|
+
fontWeight: '700',
|
|
594
|
+
color: palette.listItemText,
|
|
595
|
+
},
|
|
596
|
+
selectionModalItemMeta: {
|
|
597
|
+
fontSize: 12,
|
|
598
|
+
lineHeight: 18,
|
|
599
|
+
color: palette.listItemSubtitleText,
|
|
600
|
+
marginTop: 2,
|
|
601
|
+
},
|
|
602
|
+
searchEmptyState: {
|
|
603
|
+
alignItems: 'center',
|
|
604
|
+
justifyContent: 'center',
|
|
605
|
+
paddingHorizontal: 18,
|
|
606
|
+
paddingVertical: 36,
|
|
607
|
+
},
|
|
608
|
+
searchEmptyStateTitle: {
|
|
609
|
+
fontSize: 14,
|
|
610
|
+
fontWeight: '700',
|
|
611
|
+
color: palette.textPrimary,
|
|
612
|
+
marginTop: 10,
|
|
613
|
+
marginBottom: 4,
|
|
614
|
+
textAlign: 'center',
|
|
615
|
+
},
|
|
616
|
+
searchEmptyStateText: {
|
|
617
|
+
fontSize: 13,
|
|
618
|
+
lineHeight: 18,
|
|
619
|
+
color: palette.textSecondary,
|
|
620
|
+
textAlign: 'center',
|
|
621
|
+
marginTop: 8,
|
|
622
|
+
},
|
|
623
|
+
sectionLoader: {
|
|
624
|
+
marginTop: 18,
|
|
625
|
+
},
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
export const useGeneralSettingsStyles = () => {
|
|
629
|
+
const themeStore = useStore('theme');
|
|
630
|
+
const peopleStore = useStore('people');
|
|
631
|
+
const themeColors = useMemo(
|
|
632
|
+
() => ({
|
|
633
|
+
...normalizeGeneralSettingsThemeColors(themeStore.getters.colors),
|
|
634
|
+
...normalizeGeneralSettingsThemeColors(
|
|
635
|
+
peopleStore.getters.currentCompany?.theme?.colors,
|
|
636
|
+
),
|
|
637
|
+
}),
|
|
638
|
+
[
|
|
639
|
+
themeStore.getters.colors,
|
|
640
|
+
peopleStore.getters.currentCompany?.id,
|
|
641
|
+
peopleStore.getters.currentCompany?.theme?.colors,
|
|
642
|
+
],
|
|
643
|
+
);
|
|
644
|
+
const palette = useMemo(
|
|
645
|
+
() => buildGeneralSettingsPalette(themeColors),
|
|
646
|
+
[themeColors],
|
|
647
|
+
);
|
|
648
|
+
|
|
649
|
+
return useMemo(() => createGeneralSettingsStyles(palette), [palette]);
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
export const useGeneralSettingsPalette = () => {
|
|
653
|
+
const themeStore = useStore('theme');
|
|
654
|
+
const peopleStore = useStore('people');
|
|
655
|
+
|
|
656
|
+
const themeColors = useMemo(
|
|
657
|
+
() => ({
|
|
658
|
+
...normalizeGeneralSettingsThemeColors(themeStore.getters.colors),
|
|
659
|
+
...normalizeGeneralSettingsThemeColors(
|
|
660
|
+
peopleStore.getters.currentCompany?.theme?.colors,
|
|
661
|
+
),
|
|
662
|
+
}),
|
|
663
|
+
[
|
|
664
|
+
themeStore.getters.colors,
|
|
665
|
+
peopleStore.getters.currentCompany?.id,
|
|
666
|
+
peopleStore.getters.currentCompany?.theme?.colors,
|
|
667
|
+
],
|
|
668
|
+
);
|
|
669
|
+
|
|
670
|
+
return useMemo(
|
|
671
|
+
() => buildGeneralSettingsPalette(themeColors),
|
|
672
|
+
[themeColors],
|
|
673
|
+
);
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
const legacyPalette = {
|
|
677
|
+
badgeBorder: '#FCA5A5',
|
|
678
|
+
badgeDisabledBackground: '#FEE2E2',
|
|
679
|
+
badgeDisabledText: '#991B1B',
|
|
680
|
+
badgeSelectedBackground: '#DCFCE7',
|
|
681
|
+
badgeSelectedBorder: '#86EFAC',
|
|
682
|
+
badgeSelectedText: '#166534',
|
|
683
|
+
buttonBackground: '#334155',
|
|
684
|
+
buttonBackgroundSecondary: '#334155',
|
|
685
|
+
buttonBorder: '#334155',
|
|
686
|
+
buttonBorderSecondary: '#E2E8F0',
|
|
687
|
+
buttonIcon: '#FFFFFF',
|
|
688
|
+
buttonIconSecondary: '#FFFFFF',
|
|
689
|
+
buttonText: '#FFFFFF',
|
|
690
|
+
buttonTextSecondary: '#FFFFFF',
|
|
691
|
+
cardBackground: '#FFFFFF',
|
|
692
|
+
cardBorder: '#E2E8F0',
|
|
693
|
+
cardIconColor: '#0F766E',
|
|
694
|
+
cardIconBackground: '#ECFEFF',
|
|
695
|
+
cardIconBorder: '#A5F3FC',
|
|
696
|
+
cardText: '#0F172A',
|
|
697
|
+
containerTransparentBackground: 'transparent',
|
|
698
|
+
error: '#c10015',
|
|
699
|
+
iconActive: '#0F766E',
|
|
700
|
+
iconDanger: '#c10015',
|
|
701
|
+
iconDisabled: '#94A3B8',
|
|
702
|
+
iconInfo: '#0369A1',
|
|
703
|
+
iconSuccess: '#0F766E',
|
|
704
|
+
iconWarning: '#B45309',
|
|
705
|
+
info: '#0369A1',
|
|
706
|
+
inputBackground: '#F8FAFC',
|
|
707
|
+
inputBorder: '#CBD5E1',
|
|
708
|
+
inputDisabledBackground: '#F1F5F9',
|
|
709
|
+
inputDisabledText: '#64748B',
|
|
710
|
+
inputIcon: '#94A3B8',
|
|
711
|
+
inputPlaceholderText: '#94A3B8',
|
|
712
|
+
inputText: '#0F172A',
|
|
713
|
+
listItemBackground: '#F8FAFC',
|
|
714
|
+
listItemBorder: '#E2E8F0',
|
|
715
|
+
listItemSelectedBackground: '#EFF6FF',
|
|
716
|
+
listItemSelectedBorder: '#93C5FD',
|
|
717
|
+
listItemSubtitleText: '#64748B',
|
|
718
|
+
listItemText: '#0F172A',
|
|
719
|
+
loadingSpinner: '#64748B',
|
|
720
|
+
modalBackground: '#FFFFFF',
|
|
721
|
+
modalBorder: '#E2E8F0',
|
|
722
|
+
modalCloseIcon: '#64748B',
|
|
723
|
+
modalHeaderText: '#0F172A',
|
|
724
|
+
modalText: '#64748B',
|
|
725
|
+
navigationActiveBackground: '#F8FAFC',
|
|
726
|
+
navigationBackground: '#FFFFFF',
|
|
727
|
+
navigationBorder: '#E2E8F0',
|
|
728
|
+
navigationText: '#94A3B8',
|
|
729
|
+
pageBackground: '#F8FAFC',
|
|
730
|
+
primary: '#1D4ED8',
|
|
731
|
+
success: '#0F766E',
|
|
732
|
+
switchDisabledThumb: '#94A3B8',
|
|
733
|
+
switchDisabledTrack: '#E2E8F0',
|
|
734
|
+
switchOffThumb: '#FFFFFF',
|
|
735
|
+
switchOffTrack: '#CBD5E1',
|
|
736
|
+
switchOnThumb: '#FFFFFF',
|
|
737
|
+
switchOnTrack: '#2563EB',
|
|
738
|
+
textMuted: '#64748B',
|
|
739
|
+
textPrimary: '#334155',
|
|
740
|
+
textSecondary: '#64748B',
|
|
741
|
+
warning: '#B45309',
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
const localStyles = createGeneralSettingsStyles(legacyPalette);
|
|
745
|
+
|
|
746
|
+
export default localStyles;
|